By default, ApsaraDB for Redis classic cluster instances provide the proxy connection mode. You can also enable the direct connection mode for a classic 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.
The instance meets the following requirements:
A cluster instance is created.
The Deployment Mode parameter of the instance is set to Classic (Local Disk-based).Note
By default, cluster instances that have the Deployment Mode parameter set to Cloud-native (Cloud Disk-based) run in direct connection mode. You do not need to manually enable the direct connection mode for these instances. The direct connection mode is not supported for cluster instances that have the Deployment Mode parameter set to Cloud-native (Cloud Disk-based) and run in proxy mode.
TLS (SSL) encryption is disabled for the instance. For more information, see Enable TLS 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, your 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 ApsaraDB for Redis instance.
Comparison of connection modes
Direct connection mode: An instance for which the direct connection mode is enabled is allocated a private endpoint. Clients can use the endpoint to bypass proxy nodes and access backend data nodes in the instance. This reduces the response time of ApsaraDB for Redis.
Proxy mode: By default, an instance that has the proxy mode enabled is allocated a proxy endpoint. Requests from the client are forwarded from proxy nodes to data nodes. For more information, see Features of proxy nodes.
Bypassing proxy nodes in a cluster instance and connecting directly to individual shards can result in decreased connection performance. For ApsaraDB for Redis Community Edition cluster instances, the maximum number of connections to a single shard is 10,000 and the number of new connections per second is 2,000. For ApsaraDB for Redis Enhanced Edition (Tair) cluster instances, the maximum number of connections to 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 shard in an instance receives a large number of requests while other shards in the instance remain idle. During data skew, the maximum number of connections to a shard may be reached and new connections to the shard may be rejected. In this case, the overall performance of the instance is affected.
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.
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 that you want to manage resides. Then, find the instance and click the instance ID.
In the Connection Information section, click Apply for Endpoint to the right of Private Endpoint.
In the panel that appears, enter an endpoint and a port number.
You can modify only the prefix of the endpoint. By default, the prefix is the instance ID.
The prefix must be 8 to 40 characters in length and can contain lowercase letters and digits. It must start with a lowercase letter.
When you modify the endpoint, you can also modify the port number. Valid values for this parameter: 1024 to 65535.
For information about how to use a private endpoint to connect to your ApsaraDB for Redis instance, see Use a private endpoint to connect to an ApsaraDB for Redis instance.
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?
You can update your instance to the latest minor version. For more information, see Update the minor version.
Is the ApsaraDB for Redis service interrupted when I enable the direct connection mode?
No, the service is not interrupted when you enable the direct connection mode.
Can I enable both the direct connection mode and the proxy mode for an ApsaraDB for Redis instance at the same time?
You can enable both the direct connection mode and the proxy mode at the same time for classic cluster instances. If you use a cloud-native cluster instance, you can enable only the direct connection mode or the proxy mode.
Related API operations
Applies for a private endpoint for an ApsaraDB for Redis cluster instance.
Releases a private endpoint for an ApsaraDB for Redis cluster instance.