DCS Redis Help Documentation

Accessing with redis-cli

2024-05-24 10:14:15

redis-cli is the built-in CLI of the native Redis. You can use redis-cli to access the DCS Redis Version on a CT-ECS instance or local device for data management.

Before You Begin

1. Set an account password for your Redis instance. You can choose any of the following methods:

Set a password for the Redis default account. For details, see Resetting DCS Instance Password.

Create a new account and password. For details, see Creating and Managing an Account.

2. Obtain Redis connection information.

Using a private network connection: In the Redis console, obtain the private network connection address of the instance. Redis instances only provide private network connection addresses by default. For detailed operations, see Viewing the Connection Address.

Using an Internet connection: In the Redis console, bind and obtain the EIP address of the instance. For specific operations, see Binding an EIP.

Description

Note: Redis instances only provide private network connection addresses by default. When connecting through the Internet, you need to manually apply for an Internet connection address. For specific operations, see Environment Preparation.

Procedure

1. Log in to the device where redis-cli is installed, such as an eSurfing Cloud ECS instance or a local device. If you have not installed redis-cli, please see Connecting to the Instance – Procedure to install it.

2. Go to the redis-cli installation directory.

Windows: Open a command line window and go to the directory where redis-cli belongs.

Linux: Go to the directory where ..\redis\src belongs, for example, cd /home/redis-5.0.5/src.

3. Obtain the connection information and execute the following command to access the Redis instance:

 

redis-cli -h ip -p port



The description for each parameter is as follows:

Parameter

Description

Method of Obtaining

ip

Connection address of the Redis instance

Connecting through a private network: You need to obtain the private network connection address of the Redis instance. Connecting through the Internet: You need to obtain the EIP connection address of the Redis instance. For specific operations, see Viewing the Connection Address.

port

Port number of the Redis instance

Port number.

4. Execute the following command to complete password verification:

For the cluster version: instance name#instance password.

AUTH Instance Name#password




For the standard version: instance password.














AUTH password








Description

Fill in the account number and password: use the default account (account named after the instance name): For cluster version: instance name#instance password; For standard version: instance password.

For example, the instance name is DCS Redis2-9r0qom, and the custom password is Password21; then the password verification command for the cluster version is AUTH DCS2-9r0qom#Password21, and for the standard version is AUTH Password21.

The cluster version can use a newly created account. The password format is user#password. For instance, the custom account is testaccount, the password is Rp829dlwa, and then the password verification command is AUTH testaccount#Rp829dlwa.


_.OSQBCz7R0o