By default, ApsaraDB for Redis local disk-based cluster instances provide proxy connection. You can also enable the direct connection mode for a local disk-based cluster instance to obtain a private endpoint. Then, clients can use the endpoint to bypass proxy nodes and connect to the instance in the same manner as they connect to a native Redis cluster.

Prerequisites

  • The instance is a local disk-based cluster instance.
    Note The direct connection mode is not supported by cloud disk-based cluster instances that have the proxy mode enabled.
  • The instance is deployed in a virtual private cloud (VPC). If the instance is deployed in the classic network, you can change the network type to VPC. For more information, see Change the network type from classic network to VPC.
  • SSL encryption is disabled for the instance. For more information, see Configure SSL encryption.
  • The vSwitch to which the instance is connected has sufficient IP addresses that can be allocated. For more information, see Obtain the number of available IP addresses in the vSwitch to which an ApsaraDB for Redis instance is connected.
    Note For example, an ApsaraDB for Redis instance contains eight shards and you want to apply for a private endpoint for the instance. An IP address is allocated to the master node of each shard in the instance, and an additional IP address is allocated to the private endpoint. Therefore, the vSwitch must provide at least nine IP addresses. Otherwise, you cannot enable the direct connection mode for the instance.

Comparison of connection modes

  • Proxy mode: By default, a cluster instance that has the proxy mode enabled provides a proxy endpoint. You can use the endpoint to connect to the cluster instance in the same manner as you connect to a standard instance. For more information, see Features of proxy nodes.
  • Direct connection mode: An instance for which the direct connection mode is enabled provides a private endpoint. Clients can use the endpoint to bypass proxy nodes and access backend data nodes in the instance in the same manner as they access a native Redis cluster.

Precautions

  • Connectivity performance degrades because the proxy nodes are bypassed. For cluster instances of the ApsaraDB for Redis Community Edition, the maximum number of connections for a single shard is 10,000 and the number of new connections per second is 2,000. For cluster instances of the ApsaraDB for Redis Enhanced Edition (Tair), the maximum number of connections for a single shard is 30,000 and the number of new connections per second is 2,000. For more information, see Overview.
  • Data skew may take place for ApsaraDB for Redis cluster instances. Data skew occurs when one data shard in an instance receives a large number of requests while other data shards in the instance remain idle. During data skew, the maximum number of connections to a data shard may be reached and new connections to the shard may be rejected. In this case, the overall performance of the instance is affected.
    Note In most cases, data skew is caused by hotkeys or large keys. For more information about how to troubleshoot hotkeys and large keys, see Use the real-time key statistics feature and Offline key analysis.
  • If you cannot perform the following operations, you must release the private endpoint first. For more information, see Release a private endpoint for an ApsaraDB for Redis instance.

Procedure

  1. Log on to the ApsaraDB for Redis console and go to the Instances page. In the top navigation bar, select the region in which the instance is deployed. Then, find the instance and click its ID.
  2. In the Connection Type section, click Apply for Endpoint to the right of Private Endpoint.
  3. Optional: In the panel that appears, specify an endpoint and a port number.
    Parameter Description
    Endpoint
    • You can modify only the endpoint prefix. By default, the prefix is the instance ID.
    • The prefix must be 8 to 64 characters in length and contain lowercase letters and digits. It must start with a lowercase letter.
    Port When you modify the endpoint, you can also modify the port number. Valid values of the port number: 1024 to 65535.
  4. Click OK.

FAQ

  • Q: My instance meets the requirements of the prerequisites. What do I do if I am unable to find Apply for Endpoint to the right of Private Endpoint?

    A: You can update your instance to the latest minor version. For more information, see Update the minor version.

  • Q: Is the ApsaraDB for Redis service interrupted when I enable the direct connection mode?

    A: No, the service is not interrupted when you enable the direct connection mode.

  • Q: Can I enable both the direct connection mode and the proxy mode for an ApsaraDB for Redis instance at the same time?

    A: Yes, you can enable the two modes for an instance at the same time. If your instance is a local disk-based cluster instance, you can enable the two modes for the instance at the same time. If your instance is a cloud disk-based cluster instance, you can enable only a single mode for the instance.

References