After you configure the active health check feature for services, the system automatically deactivates unhealthy nodes based on the health check result. The system also automatically activates nodes if the nodes are restored to a healthy state. The active health check feature helps improve the availability of routes to the service interface when multi-replica deployment is used for your backend services.
Procedure
If the gateway version is 1.2.1 or later, the TCP health check feature is automatically enabled when you create a service.
Log on to the MSE console. In the top navigation bar, select a region.
In the left-side navigation pane, choose Cloud-native Gateway > Gateways. On the Gateways page, click the name of the gateway.
In the left-side navigation pane, click Routes. On the page that appears, click the Services tab.
On the Services tab, find the desired service and click Health Check Settings in the Actions column. In the Configure Health Check panel, turn on Enable Health Check, configure the parameters, and then click OK.
Troubleshoot health check failures
Troubleshoot a health check failure that occurs in common scenarios
Determine whether a TCP health check or an HTTP health check fails:
If a TCP health check fails, the connection to the gateway node cannot be established. To troubleshoot the failure, perform the following operations:
Check whether the node exists.
Check whether an excessive number of concurrent connections are established.
If an HTTP health check fails, perform a TCP health check and check whether a connection to the node can be established. If a TCP health check passes, check whether the configured health check path is valid. To check the health check path, you can try to use tools such as cURL and Postman to perform access tests.
Troubleshoot a health check failure that occurs when you add a service for the first time
Perform the following operations in sequence:
Check whether the virtual private cloud (VPC) that you purchased is the same as the VPC in which the gateway is deployed or check whether the environment in which the service resides is connected to the VPC in which the gateway is deployed by using Cloud Enterprise Network (CEN) or physical connections. If the VPC that you purchased is not the same as the VPC in which the gateway is deployed and the two VPCs are not connected to each other, the IP address of the gateway cannot be accessed.
NoteThe gateway does not support on-premises services that are registered with Nacos and ZooKeeper instances.
Check whether the VPC that you purchased is the same as the VPC in which the gateway is deployed. If the VPC that you purchased is not the same as the VPC in which the gateway is deployed and the two VPCs are not connected to each other, the IP address of the gateway cannot be accessed.
Check whether security group authorization is performed. If the source of your service is a Container Service for Kubernetes (ACK) cluster, check whether the gateway is added to the security group of the ACK cluster. For more information, see Perform security group authorization.
If a public IP address is used for the unhealthy gateway, check whether an Internet NAT gateway is enabled for the VPC in which the gateway is deployed.