Testing port connectivity is an important step when you troubleshoot connection issues for a Tair (Redis OSS-compatible) instance.
Background
If you cannot connect to a Tair (Redis OSS-compatible) instance but a ping test from the ECS to the Tair instance is successful, use the telnet command to check the service port's availability.
Prerequisites
Telnet is installed on your Linux ECS instance, or the Telnet client is enabled on your Windows ECS instance.
Procedure
-
Log on to your ECS instance and run the following command:
telnet <host> 6379Note-
In the command, replace
<host>with the endpoint from the previous step. -
6379 is the default port of a Tair (Redis OSS-compatible) instance.
-
This command works on both Windows and Linux operating systems.
-
-
Check the test result. Refer to the following examples for Linux and Windows.
-
Successful connection:
Figure 3. Successful telnet connection in Linux
[root@xxx ]# telnet xxx.redis.rds.aliyuncs.com 6379 Trying 172.16.172.224... Connected to xxx.redis.rds.aliyuncs.com. Escape character is '^]'.Figure 4. Successful telnet connection in Windows. In Windows, a successful connection is indicated by a blank terminal screen with a blinking cursor in the upper-left corner. This means you have successfully connected to the Tair instance (
xxx.redis.rds.aliyuncs.com). -
Failed connection:
Figure 5. Failed telnet connection in Linux
[root@xxx ]# telnet xxx.redis.rds.aliyuncs.com 6379 Trying xxx... telnet: connect to address xxx 5: Connection timed out [root@xxx ]#Figure 6. Failed telnet connection in Windows
C:\Users\Administrator>telnet xxx.redis.rds.aliyuncs.com 6379 Connecting To xxx.redis.rds.aliyuncs.com...Could not open connection to the host, on port 6379: Connect failed
-
Result analysis
-
If you can connect to the Tair instance from an ECS instance using telnet but still experience connection issues, the network path between the ECS instance and the Tair instance is functioning correctly. In this case, investigate other potential causes, such as client-side issues, your application code, or services being blocked within your environment. For more information, see How do I troubleshoot connection issues in Tair.
-
If the telnet connection fails but a ping test succeeds, your ECS instance may be behaving abnormally. For example, malware on the ECS instance might cause it to attack ports, such as port 6379, leading the system to block some services. In this situation, monitor your ECS instance to identify and handle any unusual traffic, or submit a ticket for assistance from Alibaba Cloud engineers.
-
If the telnet connection fails with a
Name or service not knownerror, the endpoint may be incorrect or there may be a DNS resolution issue. Verify that the endpoint is correct and then refer to this topic for instructions on resolving this type of issue. -
If both the telnet connection and the ping test fail, see How do I troubleshoot connection issues in Tair.