Updated on 2026-05-08 GMT+08:00

Connecting to an Instance by Binding an EIP to a Node

Scenarios

By default, GeminiDB Redis instances are accessible only over a private network to help ensure data security and access efficiency. To access a GeminiDB Redis instance from outside the private network, you can bind an EIP to a node in the instance and connect through that EIP.

This section uses a Linux ECS as an example to describe how to connect to a GeminiDB Redis instance using redis-cli. You can connect to an instance over SSL or non-SSL connections. SSL encrypts data and is more secure. For details, see Connecting a GeminiDB Redis Instance over SSL. This section describes how to connect to a GeminiDB Redis instance over a non-SSL connection.

Connecting to an instance by binding an EIP directly to an instance node increases security risks. If security rules are misconfigured or a vulnerability is exploited, an attacker may obtain your access credentials and perform malicious operations on database resources. You are advised to connect to an instance by binding a public gateway address instead.

Usage Notes

  • To connect to a DB instance over a non-SSL connection, SSL must be disabled. For details about how to disable SSL, see Encrypting Data over SSL.
  • You need to estimate required bandwidth and buy an EIP with sufficient bandwidth resources. Client access exceptions caused by poor public network performance will not be included in the SLA.
  • Redis Cluster instances do not support this function.

Prerequisites

  • An ECS has been created. The following uses a Linux ECS as an example. For details about how to create an ECS, see Purchasing an ECS in the Elastic Cloud Server documentation.
  • Security group rules have been configured. For details, see Setting Security Group Rules.
  • You have bound an EIP to an instance node to enable public access.

Procedure

  1. Log in to the ECS. For details, see How Do I Log In to My ECS? in the Elastic Cloud Server documentation.
  2. 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 installation package and upload it to the ECS.

  3. Decompress the client package.

    tar -xzf redis-6.2.0.tar.gz

  4. Open the src directory and connect to the DB instance.

    cd redis-6.2.0
    make
    cd src
    ./redis-cli -h <DB_HOST> -p <DB_PORT> -a <DB_PWD>

    Example:

    ./redis-cli -h 192.168.0.208 -p 6379 -a <DB_PWD>
    Table 1 Parameter description

    Parameter

    Description

    <DB_HOST>

    EIP bound to the instance to be connected.

    To obtain the EIP, perform the following steps:

    On the Instances page, click the target instance name. In the navigation pane, choose Node Management. You can see the EIP in the Node Information area. If your GeminiDB Redis instance has multiple nodes, you can use the EIP of any node to connect to the instance.

    <DB_PORT>

    Port for accessing the target instance. Configure this parameter based on service requirements.

    To obtain the port number, perform the following steps:

    On the Instances page, click the instance name to go to the Basic Information page. In the Connection Information area, you can see the instance port next to Database Port.

    <DB_PWD>

    Administrator password set when you buy a GeminiDB Redis instance.

  5. Check the results. If the following information is displayed, the connection is successful.

    IP:port>