Connect a Redis Cluster
This guide describes how to connect to a Redis Cluster on vDB using redis-cli, via IP or Domain, with ACL user authentication.
Prerequisites
A Redis Cluster has been created on vDB. See Create a Redis Cluster.
redis-cli is installed on the connecting machine (or an equivalent redis client).
The connecting machine is in the same Network as the Instance, or in a Network with an ACL rule to the Instance's Endpoint Private.
Install redis-cli
If you don't have redis-cli, on Linux download and build the source as follows:
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make distclean # Ubuntu systems only
make
sudo make installStep 1 - Identify Endpoint & credentials
Open the Database management console and select the Redis Cluster to connect to.
Select the Connectivity & Security tab and review the Endpoint & Port section.
Note the Instance IP or Domain and the Port (default
6379).Get the authentication credentials: the ACL user (default
master-user) and password.

Step 2 - Configure Security Group Rules (optional)
Open the Connectivity & Security tab, under Security Group Rules, select EDIT.
Enter the trusted Remote IP in CIDR notation, or select ADD RULE to add a new rule.
Select Save and wait for the change to be saved.

By default the Instance allows access from anywhere (0.0.0.0/0). GreenNode recommends restricting access to only trusted Remote IPs.
Step 3 - Connect with redis-cli
When you create a Redis Cluster, a default ACL user named master-user is created automatically. You connect using master-user with the password set during creation.
Connect via IP:
Connect via Domain:
Replace 10.0.0.10 or my-redis-cluster.vdb-redis.vngcloud.vn with your Instance IP/Domain, and <PASSWORD> with the password set during creation.
Result
After a successful connection, you get the redis-cli prompt:
You can now run Redis commands against the Redis Cluster.
Last updated

