View endpoints

更新时间:
复制 MD 格式

Before you connect to a Tair instance, you must obtain its endpoint. The virtual IP address (VIP) of an instance may change during maintenance or resizing. We recommend using the instance endpoint, such as r-2vcl6xcftp1nu7****.com, in your application to ensure connection availability. You can view different types of endpoints in the console.

Prerequisites

The IP address of your client is added to a whitelist of the Tair instance. For more information, see Configure whitelists.

Procedure

  1. Log on to the 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.

  2. In the Connection Information section, view different types of endpoints and port numbers.

    Note
    • If you want to connect to the instance over the Internet, apply for a public endpoint for the instance. For more information, see Apply for a public endpoint for an instance.

    • You cannot apply for a public endpoint for a cloud-native cluster instance that runs in direct connection mode. For more information, see View endpoints.

    Then, you can connect to the instance. For more information, see Use redis-cli to connect to an instance.

Proxy mode and direct connection mode

Tair (Redis OSS-compatible) supports the following connection modes:

  • proxy mode

    The client connects to the instance through a proxy.

    The proxy is a proprietary Alibaba Cloud service responsible for request routing, load balancing, mode switching, and failover. The proxy also supports proprietary Alibaba Cloud proxy commands. It provides benefits such as connection aggregation, improved read performance, and ease of use, which helps you build more efficient business systems. For more information, see Tair Proxy features.

  • direct connection mode

    If the instance uses the standard architecture, the client connects directly to the primary node.

    If the instance uses the cluster architecture, the client connects directly to the instance. The native Redis Cluster handles tasks such as load balancing. This connection is identical to connecting to an open-source Redis Cluster.

Feature matrix for different architectures and network connections

In the table, ✔️ indicates that the feature is supported, and ❌ indicates that the feature is not supported.

Deployment mode

Instance architecture

Connection type

VPC

Internet

cloud-native

standard architecture

direct connection mode

✔️

✔️

cluster architecture1

direct connection mode

✔️

proxy mode

✔️

✔️

read/write splitting

proxy mode

✔️

✔️

classic

standard architecture

direct connection mode

✔️

✔️

cluster architecture2

proxy mode

direct connection mode

✔️

✔️

read/write splitting

proxy mode

✔️

✔️

Important

1 A cloud-native instance that uses cluster architecture supports either direct connection mode or proxy mode, but not both.

2 A classic instance that uses cluster architecture supports both direct connection mode and proxy mode.

VPC and Internet

Network Type types supported by Tair (Redis OSS-compatible):

  • 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 Tair instance and the ECS instance can connect to your Tair instance over the VPC. This achieves higher security and lower network latency.

  • Internet

    For more information, see Apply for a public endpoint for an instance.

    Although you are not charged for the traffic to connect to Tair instances over the Internet, the connection may incur risks. We recommend that you use a VPC to ensure higher security.

    Scenario: Your Tair 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

Endpoint not displayed

The console displays the endpoint only after you add the IP address of the client to the instance whitelist. For more information, see Configure a whitelist.

Public endpoint unavailable

This can happen for two reasons:

  • If the VPC endpoint is also not displayed in the Connection Information section, a whitelist is not configured for the instance. You must configure a whitelist first. For more information, see Configure a whitelist.

  • Public endpoints are not supported for cloud-native cluster instances in direct connection mode. You can connect to these instances over VPC.

    Note

    To check whether your instance is a cloud-native instance that uses cluster architecture in direct connection mode, see How do I determine if my instance is a cloud-native instance that uses cluster architecture in direct connection mode?

    If your application is deployed on an ECS instance that is not in the same VPC as your Tair instance, or if your application is not on Alibaba Cloud, consider using a cloud-native instance that uses cluster architecture in proxy mode. You cannot directly change the connection mode of a cloud-native instance from direct connection mode to proxy mode. Instead, you can use the Restore Instance feature to migrate the data by restoring it from a backup set of the source instance to a new instance that uses Proxy Mode. For more information, see Restore data from a backup set.

    Warning

    After you resize the cluster architecture of a cloud-native instance, you must modify the connection code based on the new connection mode. Otherwise, the connection may fail. Proceed with caution.

Identify cloud-native direct connection

You can confirm whether an instance uses a cloud-native cluster architecture on the Instance Information page in the console. On the Instance Information page, in the Configuration Information section, confirm that the Instance Specification is Cluster Edition and the Deployment Mode is cloud-native.

In the Connection Information section of the Instance Information page, check whether the connection type is Direct connection.

A cloud-native instance that uses cluster architecture in direct connection mode does not support a public endpoint. Therefore, in the Connection Information section, the Apply For Endpoint button for Internet Access is grayed out.

Enable proxy mode

  • For instances that use read/write splitting or classic cluster architecture, the proxy mode endpoint is enabled by default. No manual action is required.

  • For a cloud-native instance that uses cluster architecture, you can select proxy mode or direct connection mode when you create the instance. After the instance is created, you cannot switch between direct connection mode and proxy mode.

  • Instances that use the standard architecture adopt a primary-secondary replication architecture. These instances do not require a proxy mode endpoint. Proxy mode is supported only for instances that use cluster architecture or read/write splitting.

Secondary node connection

The secondary node of a Tair (Redis OSS-compatible) instance provides high availability (HA) for failover and cannot be connected to directly.

References