Skip to main content

Access Huawei Cloud Distributed Cache Service Redis Instances through Gateway

Huawei Cloud Distributed Cache Service Redis instances do not provide public internet connection addresses, hence it is not possible to directly connect to the instances via public internet connection addresses. However, you can access the instances through the NineData gateway in the form of internal network access.

Prerequisites

  • You have purchased a Huawei Cloud ECS instance, and its Virtual Private Cloud (VPC) must be consistent with the one used by the Huawei Cloud Distributed Cache Service Redis instance. As shown in the following figures:

    • Virtual Private Cloud (VPC) of the Huawei Cloud Distributed Cache Service Redis instance.

      img

    • Virtual Private Cloud (VPC) of the Huawei Cloud ECS instance.

      img

  • The Huawei Cloud ECS instance must have access to the public internet.

Notes

Currently, the only Redis that can be connected through the gateway is . If your Redis deployment architecture is master-slave or other multi-node modes, then after the Redis system performs master-slave switching, the data source you are connected to may change from the master node to the slave node.

Step One: Deploy the Gateway

  1. Log in to the Huawei Cloud ECS instance.

  2. Log in to the NineData Console, and in the left navigation bar, click on .

  3. Click on on the page.

  4. Configure the parameters according to the table below.

    ParameterDescription
    The name of the gateway, for easy later search and management, supports manual specification.
    Select the operating system of the gateway host to be deployed, display the corresponding gateway installation method. Supports the following operating systems:
    • Windows(x86_64)
    • Linux(x86_64)
    • macOS
    Select the region closest to the location of the host where the gateway is deployed to get a relatively fast access speed.
    No configuration required.
  5. Install and configure the gateway in the Huawei Cloud ECS instance according to the installation method shown below. After the configuration is completed, the connection diagram on the right side of the page will change from to .

  6. Click on , and in the pop-up window, select the data source you need to add, and proceed to Step Two.

Step Two: Connect to Redis Data Source

  1. On the page, configure the parameters according to the table below.

    Parameter
    Description
    Enter the name of the data source, for easy subsequent search and management, please use a meaningful name.
    Select .
    Select .
    Select the gateway ID deployed in Step One.
    The access address and port of the Redis data source, you can view it in the Connection Information area on the overview page of the Huawei Cloud Distributed Cache Service Redis instance.image-20240228155045678
    Enter the login username for Redis, leave it blank if not set.
    Enter the login password for Redis, leave it blank if not set.
    Select the region closest to the location of your Redis host to effectively reduce network latency.
    Choose according to the actual business purpose of the data source, as the environmental identifier of the data source. Default provides and environments, and also supports you to create a custom environment.
    Note: Under the organization mode, the database environment can also be applied to permission policy management, for example, the default role only supports access to data sources in the environment, and cannot access data sources in other environments. More information, please refer to manage roles.
    Whether to use encrypted transmission mode to access the data source (default off). If the data source enforces encrypted connections, this switch must be turned on, otherwise the connection will fail.
    Click the switch on the right to turn on or off encrypted transmission. Click the > on the left side of to expand detailed configuration.
    • : Supports the following two methods.
      • : Automatically detect the server's SSL status, if the server has enabled SSL, it will connect through SSL first, if the server has not enabled SSL, it will connect in a non-SSL manner.
      • : Always use SSL mode to connect to the data source, if the server does not support this method or fails to establish an SSL connection for other reasons, the connection will fail.
    • : If the server uses a certificate issued by a self-signed CA, you need to upload the root certificate of this CA here.
    • : If the server requires the client to provide a certificate, you need to upload the client's certificate and key here, the MySQL server will verify the information you upload to ensure the security of the connection.
  2. After all configurations are completed, click on to the right of to test whether the data source can be accessed normally, if prompted , you can click on to complete the addition of the data source. Otherwise, please recheck the connection settings until the connection test is successful.

Step Three: Manage Huawei Cloud Distributed Cache Service Redis Instances with SQL Console

  1. Log in to the NineData Console.

  2. Click on in the left navigation bar.

    tip

    If you have logged in to the data source before and have not closed it, you will automatically enter the data source page.

  3. Click on the text box below , and the available data sources will pop up, find and click on the entered Huawei Cloud Distributed Cache Service Redis instance, click on , and jump to the SQL Console.

  4. Test query a certain Key to check if the instance is accessible.

    image-20240228160222309