All Products
Search
Document Center

Tair (Redis® OSS-Compatible):How do I use the telnet command to test connectivity to the port used by Tair?

Last Updated:Nov 05, 2024

Checking port connectivity is one of the important steps in troubleshooting connection issues in Tair (Redis OSS-compatible).

Background information

You are unable to connect to Tair (Redis OSS-compatible), but the ping command shows a successful connection between the Elastic Compute Service (ECS) instance and the Tair instance. In this case, you must use the telnet command to check whether the service port of Tair is available.

Prerequisites

The Telnet client is installed on a Linux ECS instance or the Telnet client is enabled on a Windows ECS instance.

Procedure

  1. View the endpoint of the Tair instance. For more information, see View endpoints.

  2. Log on to the ECS instance and run the following command in the CLI:

    telnet <host> 6379
    Note
    • In this command, <host> specifies the endpoint that you obtained in Step 1.

    • 6379 is the default port number of the Tair (Redis OSS-compatible) instance.

    • You can run this command in both Windows and Linux operating systems.

    Figure 1. Run the telnet command in Linux

    Figure 2. Run the telnet command in Windows

  3. Check the test result. The following examples show the results of running the command in Linux and Windows.

    • The following figures show that the telnet connection is successful.

      Figure 3. Successful telnet connection in Linux

      Figure 4. Successful telnet connection in Windows Windows系统telnet成功示例

    • The following figures show that the telnet connection failed.

      Figure 5. Failed telnet connection in Linux Linux系统telnet连接阿里云Redis失败示例

      Figure 6. Failed telnet connection in Windows Windows系统telnet连接阿里云Redis失败示例

Result analysis

  • If a connection issue occurs on the Tair instance, but you can use telnet to connect the ECS instance to the Tair instance, the connection between the ECS instance and the Tair instance is normal. You need to investigate other factors, such as the client, business code, and potential service blocking issues related to the business environment. For more information, see How do I troubleshoot connection issues in Tair?

  • If the telnet connection fails, but the ping command shows a successful connection between the ECS instance and the Tair instance, the ECS instance probably has abnormal behavior and some services are disabled. For example, the ECS instance attacks port 6379 of the Tair instance due to malicious programs. In this case, we recommend that you monitor the data on the ECS instance to locate and handle abnormal traffic, or submit a ticket to request technical support.

  • If the telnet connection fails and the Name or service not known error is reported, the endpoint may be incorrect or a Domain Name System (DNS) resolution error occurs. Make sure that the endpoint is correct, and refer to How do I troubleshoot connection issues caused by failed DNS resolution? to resolve the issue.

  • If the telnet connection fails and the ping command shows a failed connection between the ECS instance and the Tair instance, refer to How do I troubleshoot connection issues in Tair? to resolve the issue.