If you want to test or manage an ApsaraDB for Redis instance that is deployed on an on-premises machine, you can apply for a public endpoint for the instance and connect to the instance over the Internet.

Precautions

No traffic fees are charged when you connect to an ApsaraDB for Redis instance over the Internet. However, this increases network latency, compromises the performance of the ApsaraDB for Redis service, and results in security risks. We recommend that you connect to ApsaraDB for Redis instances though VPC for lower network latency and higher security.

Procedure

  1. Select the following methods to obtain the public IP address of the on-premises machine based on the operating system:
    • Linux operating system

      Run the curl ipinfo.io |grep ip command on the on-premises machine to obtain the public IP address. The returned result is shown in the following figure.

      View the public IP address
    • Windows operating system

      On the on-premises machine, visit ipinfo to obtain the public IP address of the on-premises machine.

  2. Add the public IP address of the on-premises machine to the whitelist of the ApsaraDB for Redis instance. For more information, see Set IP address whitelists.
  3. Apply for a public endpoint for the ApsaraDB for Redis instance. For more information, see .
    Figure 1. The obtained public endpoint and ports
    Obtained public endpoint
  4. Use the redis-cli tool or a Redis client program to connect to the ApsaraDB for Redis instance based on the obtained public endpoint.