If a client cannot access a backend server through a load balancer, the backend server is declared unhealthy. You can view the health check results for a backend server on the ELB console.
On the Load Balancers page, click the name of the load balancer to view its details. Click Backend Server Groups and locate the server group. You can find the health check results for backend servers in the Basic Information area.
On the Load Balancers page, click the name of the load balancer to view its details. Click Backend Server Groups and locate the server group. You can find the health check results for backend servers in the Basic Information area.
To check the health of backend servers, dedicated load balancers use the IP addresses from the VPC where they work to send heartbeat requests to backend servers, while shared load balancers use IP addresses in 100.125.0.0/16.
Dedicated load balancers: To ensure that health checks can be performed normally, ensure that traffic is allowed from the VPC where the load balancer is working to the backend servers.
Shared load balancers: To ensure that health checks can be performed normally, ensure that traffic is allowed from 100.125.0.0/16 to the backend servers.
If a backend server is considered unhealthy, ELB will not route traffic to it until it is declared healthy again.
If you change the weight of a healthy backend server to 0, the health check result of this server becomes Unhealthy.
Possible causes are described here in order of their probability.
Check these causes one by one until the cause of the fault is determined.
If you need to change the health check configuration, it takes a while for the changes to be applied. The required time depends on the health check interval and timeout duration. You can find the health check results in the backend server list of the load balancer.
Possible Cause |
Solution |
---|---|
Backend server group |
Checking Whether the Backend Server Group Is Associated with a Listener |
EIP or private IP address |
Checking Whether an EIP or a Private IP Address Is Bound to the Load Balancer |
Health check configuration |
|
Security group rules |
|
Network ACL rules |
|
Backend server listening configuration |
|
Backend server firewall configuration |
|
Backend server route configuration |
|
Backend server load |
|
Backend server host.deny file |
Check whether the backend server group that the unhealthy backend server belongs to is associated with a listener.
If you add a TCP or UDP listener to the load balancer, check whether the load balancer has an EIP or private IP address bound.
If the load balancer has no EIP or private IP address bound, bind one.
When you create a load balancer for the first time, if no EIP or private IP address is bound to the load balancer, the health check result of backend servers associated with a TCP or UDP listener is Unhealthy. After you bind an EIP or private IP address to the load balancer, the health check result becomes Healthy. If you unbind the EIP or private IP address from the load balancer, the health check result is still Healthy.
For dedicated and shared load balancers, click the name of the load balancer to view its details. Click Backend Server Groups and then click the name of the server group. On the Basic Information page, to the right of Health Check, click Configure. Check the following parameters:
If the URL is http://www.example.com or http://192.168.63.187:9096, the health check path is /.
If the URL is http://www.example.com/chat/try/, the health check path is /chat/try/.
If the URL is http://192.168.63.187:9096/chat/index.html, the health check path is /chat/index.html.
You can check the protocol and port in the Basic Information area of the backend server group.
You can check the protocol and port in the Basic Information area of the backend server group.
To control traffic in and out of a subnet, you can associate a firewall with the subnet. Similar to security groups, firewalls control access to subnets and add an additional layer of defense to your subnets. Default firewall rules reject all inbound and outbound traffic. If the subnet of a load balancer or associated backend servers has a firewall associated, the load balancer cannot receive traffic from the Internet or route traffic to backend servers, and backend servers cannot receive traffic from and respond to the load balancer.
Configure an inbound firewall rule to allow traffic from the VPC where the load balancer works to backend servers.
To control traffic in and out of a subnet, you can associate a firewall with the subnet. Similar to security groups, firewalls control access to subnets and add an additional layer of defense to your subnets. Default firewall rules reject all inbound and outbound traffic. If the subnet of a load balancer or associated backend servers has a firewall associated, the load balancer cannot receive traffic from the Internet or route traffic to backend servers, and backend servers cannot receive traffic from and respond to the load balancer.
Configure an inbound firewall rule to permit access from 100.125.0.0/16.
If the backend server runs a Windows OS, use a browser to access https://{Backend server IP address}:{Health check port}. If a 2xx or 3xx code is returned, the backend server is running normally.
netstat -anlp | grep port
If the health check port and LISTEN are displayed, the health check port is in the listening state. As shown in Figure 6, TCP port 880 is listened on.
If the health check port is not in the listening state, the backend server is not listened on. You need to start the application on the backend server and check whether the health check port is listened on.
curl {Private IP address of the backend server}:{Health check port}/{Health check path} -iv
To perform an HTTP health check, the load balancer initiates a GET request to the backend server. If the following response status codes are displayed, the backend server is considered healthy:
TCP listeners: 200
Dedicated load balancers: 200 for TCP/UDP/HTTP/HTTPS health checks
Shared load balancers: 200, 202, or 401 for HTTP health checks, and 200 for TCP health checks
On the Listeners tab page, modify the listener, select the backend server group for which TCP health check has been configured, or add a backend server group and select TCP as the health check protocol. After you complete the configuration, wait for a while and check the health check result.
If the firewall or other security software is enabled in the backend server, the software may block the IP addresses in the VPC CIDR block or 100.125.0.0/16.
For dedicated load balancers, configure inbound firewall rules to allow traffic from the VPC to which the load balancers work to backend servers.
For shared load balancers, configure inbound firewall rules to allow traffic from 100.125.0.0/16 to backend servers.
Check whether the default route configured for the primary NIC has been manually modified. If the default route is changed, health check packets may fail to reach the backend server.
ip route
Alternatively, run the following command:
route -n
Figure 10 shows the command output when the backend server route is normal.
If the command output does not contain the first route, or the route does not point to the gateway, configure or modify the default route to point to the gateway.
View the vCPU usage, memory usage, network connections of the backend server on the Cloud Eye console to check whether the backend server is overloaded.
If the load is high, connections or requests for health checks may time out.
Verify that IP addresses in from VPC where the load balancers work and 100.125.0.0/16 are not written to the /etc/hosts.deny file on the backend server.
For dedicated load balancers, verify that the IP addresses from the VPC where the load balancers work are not written into the file.
For shared load balancers, verify that IP addresses from 100.125.0.0/16 are not written into the file.