Connecting to an Instance Using a Private Domain Name
This section describes how to connect to a GeminiDB Redis instance using a private domain name on a Linux ECS.
Precautions
- The target instance must be in the same VPC and subnet as the ECS.
- The ECS must be in a security group that has access to the instances.
Scenario 1: If the instance is associated with the default security group, you do not need to configure security group rules.
Scenario 2: If the instance is not associated with the default security group, check whether the security group rules allow the ECS to connect to the instance.
- If yes, the ECS can connect to the instance.
- If no, add an inbound rule to the security group.
For details about how to configure a security group, see Configuring Security Group Rules for Nodes.
Prerequisites
- An ECS has been created. The following uses a Linux ECS as an example. For details, see Purchasing an ECS in Getting Started with Elastic Cloud Server.
- Download the Redis client installation package.
Procedure
- Configure the private domain name for the GeminiDB Redis instance. For details, see Configuring a Private Domain Name.
- Log in to the ECS. For details, see Logging In to an ECS in Getting Started with Elastic Cloud Server.
- Obtain the Redis client.
Method 1
Run the following command to download the Redis client.
wget http://download.redis.io/releases/redis-6.2.0.tar.gz
Method 2
Download the Redis client from the address provided in Prerequisites and upload the Redis client installation package to the ECS.
- Decompress the client tool package.
tar -xzf redis-6.2.0.tar.gz
- Connect to the DB instance in the src directory.
cd redis-6.2.0
make
cd src
./redis-cli -h <DB_Domain_Name> -p <DB_PORT> -a <DB_PWD>
Example:
./redis-cli -h redis.com -p 8635 -a <DB_PWD>
Table 1 Parameter description Parameter
Description
<DB_Domain_Name>
The private domain name of the DB instance to be connected. The private domain name is the one created in 1.
<DB_PORT>
Port for accessing the target instance. Configure this parameter based on service requirements.
To obtain the instance port number, perform the following steps:
Click the target instance to go to the Basic Information page. In the Network Information area, you can find the database port.
<DB_PWD>
Administrator password set when you buy a GeminiDB Redis instance
- Check the results. If the following information is displayed, the connection is successful.
Domain_Name:port>
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