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 Architecture Type that can be connected through the gateway is Standalone. 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 Datasource**Gateway**.

  3. Click on Create Gateway on the page.

  4. Configure the parameters according to the table below.

    ParameterDescription
    NameThe name of the gateway, for easy later search and management, supports manual specification.
    EnvironmentSelect 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
    Access RegionSelect the region closest to the location of the host where the gateway is deployed to get a relatively fast access speed.
    AdvancedNo 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 Waiting for the local gateway to launch... to The local gateway is connected successfully.

  6. Click on Create Datasource, 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 Create Datasource page, configure the parameters according to the table below.

    Parameter
    Description
    NameEnter the name of the data source, for easy subsequent search and management, please use a meaningful name.
    Architecture TypeSelect Standalone.
    ConnectionSelect Gateway.
    GatewaySelect the gateway ID deployed in Step One.
    HostThe 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
    DB AccountEnter the login username for Redis, leave it blank if not set.
    DB PasswordEnter the login password for Redis, leave it blank if not set.
    Access RegionSelect the region closest to the location of your Redis host to effectively reduce network latency.
    EnvironmentChoose according to the actual business purpose of the data source, as the environmental identifier of the data source. Default provides PROD and DEV 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 Prod Admin role only supports access to data sources in the PROD environment, and cannot access data sources in other environments. More information, please refer to manage roles.
    EncryptionWhether 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 Encryption to expand detailed configuration.
    • SSL Options: Supports the following two methods.
      • If Available: 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.
      • Require: 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.
    • Verify Server Certificate (SSL CA): If the server uses a certificate issued by a self-signed CA, you need to upload the root certificate of this CA here.
    • Authenticate Client: 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 Connection Test to the right of Create Datasource to test whether the data source can be accessed normally, if prompted Connection Successfully, you can click on Create Datasource 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 DevOps**SQL Console** 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 SQL Console, and the available data sources will pop up, find and click on the entered Huawei Cloud Distributed Cache Service Redis instance, click on Query, and jump to the SQL Console.

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

    image-20240228160222309