This section describes how to troubleshoot Kafka connection problems.
If the connection to a Kafka instance is abnormal, perform the following operations to troubleshoot the problem:
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}
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.
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=
The following error information is displayed:
Solution:
ssl.truststore.password=dms@kafka
The following error information is displayed:
Solution: Create a new topic or enable the automatic topic creation function.