By default, Tair classic cluster instances provide the proxy connection mode. If you want an instance to be compatible with the native Redis Cluster protocol, you can enable the direct connection mode for the instance according to the instructions in this topic, and then connect to the private endpoint in your client. You can use the endpoint to bypass proxy nodes and connect to the Tair instance in the same manner as you connect to a native Redis cluster.
Prerequisites
The instance meets the following requirements:
The instance uses the cluster architecture.
The instance is deployed in classic mode.
NoteBy default, cloud-native cluster instances in direct connection mode are allocated private endpoints. You do not need to enable private endpoints for these instances. The direct connection mode is not supported for cloud-native cluster instances 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 Query the number of IP addresses available on the vSwitch to which a Tair instance is connected.
NoteFor example, your Tair 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 Tair 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 Tair.
Proxy mode: By default, Tair instances in proxy mode are allocated proxy endpoints. Requests from clients are forwarded from proxy nodes to data nodes. For more information, see Features of proxy nodes.
Precautions
Connection performance degrades because the proxy nodes are bypassed. For 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 about instance specifications, see Overview.
Data skew may take place for 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.
NoteIn 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 Use the offline key analysis feature.
After you enable the direct connection mode for an instance, you cannot change the zone to which the instance belongs. To change the zone, you must release the private endpoint first. For more information, see Migrate an instance across zones and Release a private endpoint for a Tair instance.
If you want to change the configurations of an instance for which the direct connection mode is enabled, you can change only the number of shards or shard specifications at a time. For more information, see Why am I unable to change the configurations of a classic (local disk-based) cluster instance?
Procedure
Log on to the Tair 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.
Parameter
Description
Endpoint
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.
Port
When you modify the endpoint, you can also modify the port number. Valid values for this parameter: 1024 to 65535.
Click OK.
For information about how to use a private endpoint to connect to your Tair instance, see Use a private endpoint to connect to a Tair instance.
FAQ
My instance meets the requirements for enabling the direct connection mode. 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 of an instance.
Is the service interrupted when I enable the direct connection mode?
No, the Tair service is not interrupted when you enable the direct connection mode.
Can I enable both the direct connection mode and the proxy mode for a Tair instance at the same time?
If your instance is a classic cluster instance, you can enable these two modes for the instance at the same time. If your instance is a cloud-native cluster instance, you can enable only a single mode for the instance.
Related API operations
API operation | Description |
Applies for a private endpoint for a Tair instance. | |
Releases the private endpoint of a Tair instance. |