To connect to an ApsaraDB for Redis instance, you must obtain the endpoint of the Redis instance. The virtual IP address (VIP) of a Redis instance may change due to maintenance or configuration change. We recommend that you connect to a Redis instance by using an endpoint (such as r-2vcl6xcftp1nu7****.com
) to ensure service availability. You can view different types of endpoints in the ApsaraDB for Redis console.
Prerequisites
The IP address of your client is added to a whitelist of the ApsaraDB for Redis instance. For more information, see Configure whitelists.
Procedure
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, view different types of endpoints and port numbers.
NoteIf you want to connect to the ApsaraDB for Redis instance over the Internet, apply for a public endpoint for the instance. For more information, see Apply for a public endpoint for an ApsaraDB for Redis instance.
You cannot apply for a public endpoint for a cloud disk-based cluster instance that runs in direct connection mode. For more information, see View endpoints.
Then, you can connect to the ApsaraDB for Redis instance. For more information, see Use redis-cli to connect to an ApsaraDB for Redis instance.
Proxy mode and direct connection mode
ApsaraDB for Redis supports the following connection modes:
Proxy mode
Clients connect to ApsaraDB for Redis instances by using proxy nodes.
Proxy nodes are developed in-house to enable architecture changes, route commands, balance loads, perform failovers, and run in-house commands for Tair instances in proxy mode. The connection mode offers several advantages, including aggregated connections, enhanced read performance, and ease of use. This can help you design more efficient business systems. For more information, see Features of proxy nodes.
Direct connection mode
For standard master-replica instances, clients directly connect to the master nodes of the instances.
For ApsaraDB for Redis cluster instances, clients directly connect to the instances, and tasks such as load balancing are handled by the instances. This is exactly the same as the direct connection to native Redis clusters.
Supported network types and connection modes for instances of different architectures
In the following table, ️️✔️ indicates that the item is supported and ❌ indicates that the item is not supported.
Deployment mode | Architecture | Connection mode | VPC | Internet |
Cloud disk-based | Standard architecture | Direct connection mode | ✔️ | ✔️ |
Cluster architecture1 | Direct connection mode | ✔️ | ❌ | |
Proxy mode | ✔️ | ✔️ | ||
Read/write splitting architecture | Proxy mode | ✔️ | ✔️ | |
Local disk-based | Standard architecture | Direct connection mode | ✔️ | ✔️ |
Cluster architecture2 | Proxy mode Direct connection mode | ✔️ | ✔️ | |
Read/write splitting architecture | Proxy mode | ✔️ | ✔️ |
1Cloud disk-based cluster instances can only support either direct connection mode or proxy mode, but not both simultaneously.
2Local disk-based cluster instances can support both direct connection mode and proxy mode simultaneously.
VPC and Internet
Network types supported by ApsaraDB for Redis:
VPC
A virtual private cloud (VPC) is a private network that is isolated from other networks at the network layer on top of physical-layer protocols. VPCs provide high security, reliability, flexibility, scalability, and ease of use. For more information, see What is a VPC?
Scenario: An Elastic Compute Service (ECS) instance is deployed in the same VPC as your ApsaraDB for Redis instance, and the ECS instance can connect to your ApsaraDB for Redis instance over the VPC. This achieves higher security and lower network latency.
Internet
For more information, see Apply for a public endpoint for an ApsaraDB for Redis instance.
Although you are not charged for the traffic to connect to ApsaraDB for Redis instances over the Internet, the connection may incur risks. We recommend that you use a VPC to ensure higher security.
Scenario: Your ApsaraDB for Redis instance can be connected over the Internet by using your on-premises device, an ECS instance deployed in a different VPC, or a device within a third-party cloud service.
FAQ
Why is the endpoint of an instance not displayed after I connect to the instance?
Why am I unable to find the entry point to apply for a public endpoint for an instance?
How do I know whether an instance is a cloud disk-based cluster instance that runs in direct connection mode?
What do I do if the connection to an instance fails?
Am I able to connect to a replica node? Why am I unable to see the endpoint of a replica node?
References
Methods to connect to Redis instances:
If your client fails to connect to an instance and an error is reported, you can refer to the solutions that are provided in Common errors and troubleshooting.