This topic describes how to troubleshoot connection issues in ApsaraDB for Redis.

For more information about how to troubleshoot errors returned by clients, see Common Errors and Troubleshooting.

Troubleshoot issues before a connection is established

Troubleshoot the network environment

Before you connect to an ApsaraDB for Redis instance, check the network environment of your client. The following figure shows the procedure.
Figure 1. Troubleshoot the network environment
Troubleshoot the network environment
  1. Check the network environment of your client.
    • VPC: If the client is hosted on an Elastic Compute Service (ECS) instance that resides in a Virtual Private Cloud (VPC), make sure that the ECS instance and the ApsaraDB for Redis instance to which you want to connect reside in the same VPC.
      • If both instances reside in the same VPC, the client can connect to the ApsaraDB for Redis instance over the VPC.
      • If the instances reside in different VPCs, chances are the instances reside in different regions or belong to different Alibaba Cloud accounts.
    • Internet.
  2. Obtain the endpoint that is used to connect to the ApsaraDB for Redis instance. For more information, see View endpoints.

    Make sure that you obtain the correct endpoint for your ApsaraDB for Redis instance. If you plan to connect to the instance over the Internet but you obtain the VPC endpoint, the connection cannot be established.

  3. Prepare to establish a connection.

Troubleshoot connection settings

The following figure shows the procedure to troubleshoot connection settings.
Figure 2. Troubleshoot connection settings
Troubleshoot connection settings
  1. Check whether the IP address or CIDR block of your client is added to a whitelist of the ApsaraDB for Redis instance. For more information, see Configure whitelists.
  2. Run the PING command to test whether the network between the ECS instance and the ApsaraDB for Redis instance is normal. For more information, see Run the PING command to check the connection between an ECS instance and an ApsaraDB for Redis instance.
  3. Check whether the credentials that you use to connect to the ApsaraDB for Redis instance are valid. For more information, see Logon methods.
  4. If you have checked the preceding settings and still cannot connect to the ApsaraDB for Redis instance, check the logs and error codes of the client. For more information, see Common Errors and Troubleshooting.

Troubleshoot connection issues during instance runtime

If connection issues occur during the runtime of the ApsaraDB for Redis instance, follow the instructions shown in the figure for troubleshooting.
Figure 3. Troubleshoot connection issues during instance runtime
Troubleshoot connection issues during instance runtime
  1. Check whether the ApsaraDB for Redis instance is undergoing a master-replica switchover. For more information, see Master-replica switchovers.

    During a master-replica switchover, it is normal for the instance to be disconnected for a few seconds. The connection will automatically recover without human intervention.

  2. Perform diagnostics on the instance. For more information about how to read instance diagnostic reports, see Analyze a diagnostic report.

Applicable scope