Troubleshooting Kafka Connection Exceptions
Overview
This section describes how to troubleshoot Kafka connection problems.
Problem Classification
If the connection to a Kafka instance is abnormal, perform the following operations to troubleshoot the problem:
Checking the Network
Ensure that the client and the Kafka instance can be connected. If they cannot be connected, check the network.
For example, if you have enabled SASL for the Kafka instance, run the following command:
curl -kv {ip}:{port}
- If the network is normal, information similar to the following is displayed:
- If the network is abnormal or disconnected, information similar to the following is displayed:
- Check whether the client and the Kafka instance are in the same VPC. If they are not in the same VPC, establish a VPC peering connection
- Check whether the security group rules are correctly configured. For details, see How Do I Select and Configure a Security Group?
Checking Consumer and Producer Configurations
View logs to check whether the parameters printed during initialization of the consumer and producer are the same as those set in the configuration files.
If they are different, check the parameters in the configuration files.
Checking for Common Errors on Java Clients
- Error 1: Domain name verification is not disabled.
The following error information is displayed:
Solution: Leave the ssl.endpoint.identification.algorithm parameter in the consumer.properties and producer.properties files empty to disable domain name verification.
ssl.endpoint.identification.algorithm=
- Error 2: SSL certificates fail to be loaded.
The following error information is displayed:
Solution:
- Check whether the client.truststore.jks file exists in the corresponding address.
- Check the permissions on the processes and files.
- Check whether the ssl.truststore.password parameter in the consumer.properties and producer.properties files is correctly set.
ssl.truststore.password is the server certificate password, which must be set to dms@kafka and cannot be changed.
ssl.truststore.password=dms@kafka
- Error 3: The topic name is incorrect.
The following error information is displayed:
Solution: Create a new topic or enable the automatic topic creation function.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot