Enabling Public Access to Redis and Obtaining the Access Addresses
Public access to Redis 4.0 and later instances can be enabled using Elastic Load Balance (ELB). This section describes how to enable the public access, obtain the access addresses and ports, and add the instances or load balancers to IP whitelists. To enable public access to Redis 3.0 instances, see Public Access to a DCS Redis 3.0 Instance (Discontinued).

Currently, this function is open only in CN Beijing4, CN Shanghai1, CN Guangzhou, CN Guiyang1, AP-Bangkok, and AP-Singapore regions. To enable it in other regions, submit a ticket and contact customer service.
Video Tutorial
This video shows how to enable public access to Redis and obtain the address.
Notes and Constraints
- Public access can be enabled for single-node, master/standby, read/write splitting, and Proxy Cluster instances.
- Public access to Redis on a client has higher network latency than access to Redis on a client within a VPC.
- SLA does not include client access exceptions caused by public network performance issues.
- To access an IP-whitelisted DCS Redis instance using ELB on a client over a public network, add the private load balancer IP address to the whitelist. For details, see (Optional) Adding Private Load Balancer IP Addresses to the IP Address Whitelist of a Redis Instance.
- To access a DCS Redis instance using ELB on a client, and to configure a public IP address whitelist, add the public IP addresses to the IP address group of the load balancer. Adding these addresses to the instance whitelist takes no effect. For details, see (Optional) Adding Public Client IP Addresses to the IP Address Whitelist of a Load Balancer.
Prerequisites
- A load balancer has been prepared. Learn how to create one by referring to Creating a Dedicated Load Balancer. The load balancer must meet the following requirements.
- The type is Dedicated and IP as a Backend is enabled.
- Network load balancing(TCP/UDP) is enabled in the specifications.
- The VPC is the same as the Redis instance.
- An Elastic IP (EIP) is bound.
- A port is available.
- Binding a load balancer to multiple DCS instances will limit the Redis performance to balancer specifications.
- For network security purposes, the Redis instance must be password-protected. Password-free instances do not support public access. To change the instance to be password-protected, see Resetting an Instance Password.
Procedure
- Log in to the DCS console.
- Click
in the upper left corner of the management console and select the region where your instance is located.
- In the navigation pane, choose Cache Manager.
- Click an instance name to go to the instance basic information page.
- Click On after Public Access.
- Select desired balancers and click OK.
If there is no available load balancer, click Create one to go to the ELB console. If the load balancer exists, but is not in the list, check whether the load balancer can be bound by referring to Prerequisites.
- When a load balancer is bound to a Redis instance, do not delete the load balancer and listener. Ensure that the load balancer is available or public access to Redis may be affected.
- To delete a load balancer, unbind it (disable public access) on the Redis instance details page. Then, delete it on the ELB console.
Figure 1 Binding a load balancer - When the task for enabling public access is in the Successful state, the public access is enabled.
- Choose Basic Information in the navigation pane and check public access. To disable public access, click Off.
- After public access is enabled, the EIP is the public access address of the Redis instance and the port of the Listener is the public access port.
Figure 2 Public access address
- Enabling public access for a master/standby instance generates two listeners. The listener (starting with listener-master) listens to the master node. The listener (starting with listener-slave) listens to the standby node. For public access to a master/standby instance, use the master listener port to connect to the master node of the instance. To configure read/write splitting for a master/standby instance, use the master and standby listener ports to connect to the master and standby nodes.
Figure 3 Public access addresses for a master/standby instance
- Connection Address and IP Address are the "domain name:port" and "IP address:port" for accessing Redis on a client within a VPC.
- After public access is enabled, the EIP is the public access address of the Redis instance and the port of the Listener is the public access port.
(Optional) Adding Private Load Balancer IP Addresses to the IP Address Whitelist of a Redis Instance
When an IP whitelist is enabled for the Redis instance, add the private ELB IP addresses to the whitelist of the Redis instance to ensure that ELB can access the Redis instance. Otherwise, all IP addresses can access the instance and no private load balancer IP addresses are required in the whitelist.
- Click the ELB address in Public Access.
- Copy ID of ELB.
- Click Private IPv4 address.
- On the IP Addresses tab page, in the second search box, filter private ELB IP addresses by resource ID (copied ELB ID).
- Add all the private IP addresses of ELB to the IP whitelist of Redis. For details, see Configuring DCS Redis Access Whitelist.
(Optional) Adding Public Client IP Addresses to the IP Address Whitelist of a Load Balancer
To configure a public IP address whitelist, add the public IP addresses of the DCS Redis instance to the IP address group of a load balancer. For details, see IP Address Group.
Only whitelisted public IP addresses can access the load balancer and then Redis. If no IP address whitelist is configured, all public IP addresses can access the load balancer by default.
Related Documents
- DCS supports enabling or disabling public access by calling an API. See Enabling/Modifying Public Access and Disabling Public Access to an Instance.
- For more information about how to access Redis from a client, see Connecting to Redis on a Client.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot