With the health check function enabled, when a backend ECS instance is declared as unhealthy through the health check, the Server Load Balancer system will distribute requests from the client to other healthy ECS instances, and will distribute requests to this ECS instance again when it becomes healthy.
For a Layer-7 load balancing service, do the following when a backend ECS instance is declared as unhealthy:
Check whether the application service is running. Ensure that you can access your application service through ECS directly.
Check the listener configuration. Ensure that the backend server has enabled the corresponding port, and this port is the same backend port configured in the listener.
Check whether the backend ECS has enabled firewall or configured other security protection software, which may block the IP address of the Server Load Balancer system so that the communication between the Server Load Balancer system and the backend server is blocked.
Check whether the Server Load Balancer health check configurations are correctly set. We recommend that you use the default values.
Check whether the web page that is used to do the health check is a static page. If you do not use the default page to do the health check, you have to specify the URL of the web page used for the health check. We recommend that you use a simple HTML page, do not use PHP or other dynamic scripting language.
Check whether there is a high load on the backend ECS resources, which may cause ECS to respond slowly.
Additionally, you can also check the intranet access. Because the Server Load Balancer and backend ECS communicate with each other over the intranet, the ECS instance has to listen to all the intranet ports. The following introduces how to check intranet communication:
Check if the listener function works
Assume that the font-end port of the listener is 80, the port of the backend ECS instance is also 80, the internal IP address for the ECS instance is 10.11.192.1, run the following command to check the listener function. If you see that 10.11.192.1:80 or 0.0.0.0:80 is being listened, then the listener works fine.
For Windows ECS:
netstat -ano | findstr :80
For Linux ECS:
netstat -anp | grep :80
Check whether the server intranet firewall allows the port 80. The firewall can be temporarily closed for testing, run the following command to close the firewall:
For Windows system:
For Linux system:
Check the response status code.
For the Layer-4 load balancing service, use the
telnetcommand to test, for example, run
telnet 10.11.192.1 80.
For the Layer-7 load balancing service, do the following:
For Windows: enter the intranet IP address in the browser in the ECS server to check whether it is normal.
For Linux: use the
curl -Icommand to check whether the response returned is HTTP/1.1 200 OK.