Home Backend Development PHP Tutorial 负载均衡有关问题 高分求解

负载均衡有关问题 高分求解

Jun 13, 2016 pm 01:44 PM
apache cacti mysql nginx proxy

负载均衡问题 高分求解
有四台web服务器使用了负载均衡
四台db服务器也使用率负载均衡
我想自己写个东西
检测两个负载均衡连接的八台服务器是否可以连接,
因为有的时候其中有一两台服务器挂掉了
但是我不知道,
所以想写一个东西来手动检测


------解决方案--------------------
你负载均衡的技术也自己实现的? 如果不是 你使用的那个肯定有提供这样的功能
------解决方案--------------------
检查他是否活着看他ping的通不啊,不晓得行不行获取用socket通信试试
------解决方案--------------------
搭建个监控的机器cacti
------解决方案--------------------
apache的负载均衡采用反向代理实现,apache有个扩展模块mod_proxy就是专门做这个的。配置完毕以后,apache会自己搞定负载均衡的事情,PHP端不需要管任何事情,至于后端服务器挂了,可以采用其他的监控软件进行监控。一般是采用snmp协议的,比如楼上有人提到的cacti。
mysql的负载均衡,首先要设置多台mysql的replication,一主多从(一写多读),mysql软件包里面有个mysql_proxy是用来代理这些后端的各台mysql的,它可以将读写分离开来,并有多种负载均衡的模式。同理配置完毕后PHP也不需要管任何事情,只需要把默认的3306端口改成mysql_proxy的4040端口即可。监控同理。
------解决方案--------------------
lz了解下nginx, 负载均衡nginx挺好用的

Nginx 简单的负载均衡配置示例[原创] http://blog.s135.com/post/306/
------解决方案--------------------

探讨

lz了解下nginx, 负载均衡nginx挺好用的

Nginx 简单的负载均衡配置示例[原创] http://blog.s135.com/post/306/
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1662
14
PHP Tutorial
1262
29
C# Tutorial
1235
24
MySQL and phpMyAdmin: Core Features and Functions MySQL and phpMyAdmin: Core Features and Functions Apr 22, 2025 am 12:12 AM

MySQL and phpMyAdmin are powerful database management tools. 1) MySQL is used to create databases and tables, and to execute DML and SQL queries. 2) phpMyAdmin provides an intuitive interface for database management, table structure management, data operations and user permission management.

Explain the purpose of foreign keys in MySQL. Explain the purpose of foreign keys in MySQL. Apr 25, 2025 am 12:17 AM

In MySQL, the function of foreign keys is to establish the relationship between tables and ensure the consistency and integrity of the data. Foreign keys maintain the effectiveness of data through reference integrity checks and cascading operations. Pay attention to performance optimization and avoid common errors when using them.

Compare and contrast MySQL and MariaDB. Compare and contrast MySQL and MariaDB. Apr 26, 2025 am 12:08 AM

The main difference between MySQL and MariaDB is performance, functionality and license: 1. MySQL is developed by Oracle, and MariaDB is its fork. 2. MariaDB may perform better in high load environments. 3.MariaDB provides more storage engines and functions. 4.MySQL adopts a dual license, and MariaDB is completely open source. The existing infrastructure, performance requirements, functional requirements and license costs should be taken into account when choosing.

How to safely store JavaScript objects containing functions and regular expressions to a database and restore? How to safely store JavaScript objects containing functions and regular expressions to a database and restore? Apr 19, 2025 pm 11:09 PM

Safely handle functions and regular expressions in JSON In front-end development, JavaScript is often required...

SQL vs. MySQL: Clarifying the Relationship Between the Two SQL vs. MySQL: Clarifying the Relationship Between the Two Apr 24, 2025 am 12:02 AM

SQL is a standard language for managing relational databases, while MySQL is a database management system that uses SQL. SQL defines ways to interact with a database, including CRUD operations, while MySQL implements the SQL standard and provides additional features such as stored procedures and triggers.

How to process and display percentage numbers in Java? How to process and display percentage numbers in Java? Apr 19, 2025 pm 10:48 PM

Display and processing of percentage numbers in Java In Java programming, the need to process and display percentage numbers is very common, for example, when processing Excel tables...

How does MySQL differ from Oracle? How does MySQL differ from Oracle? Apr 22, 2025 pm 05:57 PM

MySQL is suitable for rapid development and small and medium-sized applications, while Oracle is suitable for large enterprises and high availability needs. 1) MySQL is open source and easy to use, suitable for web applications and small and medium-sized enterprises. 2) Oracle is powerful and suitable for large enterprises and government agencies. 3) MySQL supports a variety of storage engines, and Oracle provides rich enterprise-level functions.

Beyond the Hype: Assessing Apache's Current Role Beyond the Hype: Assessing Apache's Current Role Apr 21, 2025 am 12:14 AM

Apache remains important in today's technology ecosystem. 1) In the fields of web services and big data processing, ApacheHTTPServer, Kafka and Hadoop are still the first choice. 2) In the future, we need to pay attention to cloud nativeization, performance optimization and ecosystem simplification to maintain competitiveness.

See all articles