To ensure security, ApsaraMQ for Kafka instances block the ping command. A failed ping does not indicate a connectivity problem. Use telnet to test connectivity instead.
Test connectivity with telnet
Run the telnet command to verify that your client can reach the ApsaraMQ for Kafka endpoint:
telnet <endpoint> <port>Replace the placeholders with the values from your instance details page in the ApsaraMQ for Kafka console:
| Placeholder | Description | Example |
|---|---|---|
<endpoint> | Endpoint address of your instance | alikafka-pre-cn-xxx.alikafka.aliyuncs.com |
<port> | Service port of your instance | 9092 |
A successful connection confirms network connectivity. If telnet fails or times out, check the following items based on your endpoint type.
Virtual private cloud (VPC) endpoint
If you use a VPC endpoint, verify that:
The client and the ApsaraMQ for Kafka instance are in the same VPC. A VPC endpoint is only reachable from within the same VPC.
The client's IP address is in the instance whitelist.
Public endpoint
If you use a public endpoint, verify that:
The client has Internet access.
The client's IP address is in the instance whitelist.
If your client is outside the VPC and you only have a VPC endpoint, upgrade to an Internet- and VPC-connected instance to get a public endpoint. For more information, see Upgrade instance configurations.