Server load balancer (SLB) has a high score. four web servers use server load balancer. four db servers also use server load balancer. I want to write something to check whether the eight servers connected to the two server load balancer can be connected, sometimes one or two servers are down but I don't know, so I want to write something for manual detection. your server load balancer technology also solves high load balancing problems by itself.
Four web servers use server load balancer
Four db servers also use server load balancer
I want to write something myself
Checks whether eight servers connected by two server load balancer instances can be connected,
Sometimes one or two servers are suspended.
But I don't know,
So I want to write something for manual detection.
------ Solution --------------------
What is your own load balancing technology? If you are not using this function, it will certainly provide such a function.
------ Solution --------------------
Check whether he is alive. check whether he can ping the server. if not, try using socket communication.
------ Solution --------------------
Set up a monitored machine cacti
------ Solution --------------------
Apache server load balancer is implemented by reverse proxy. apache has an extension module mod_proxy dedicated to this. After the configuration is complete, apache will handle the server load balancer by itself. The PHP end does not need to care about anything. As for the failure of the backend server, other monitoring software can be used for monitoring. Snmp is generally used, for example, cacti mentioned above.
For mysql server load balancer, you must first set up replication for multiple mysql instances, one master, multiple slaves (one write, multiple reads). in the mysql package, mysql_proxy is used to proxy the backend mysql instances, it can separate read/write and has multiple load balancing modes. After the configuration is complete, PHP does not need to worry about anything. you only need to change the default port 3306 to the port 4040 of mysql_proxy. The same is true for monitoring.
------ Solution --------------------
Lz understands nginx and load balancing nginx is quite useful
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service