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 fault:
Before connecting to a Kafka instance, ensure that the client and the instance are interconnected. If they cannot be connected, check the network connection.
For example, if you have enabled SASL_SSL to access the Kafka instance, run the following command:
curl -kv {ip}:{port}
View logs to check whether the parameters printed during the 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 file.
The following error is displayed:
Solution: Check the consumer.properties and producer.properties files, in which the ssl.endpoint.identification.algorithm parameter must be left empty, indicating that domain name verification is disabled.
ssl.endpoint.identification.algorithm=
The following error is displayed:
Solution:
ssl.truststore.password=dms@kafka
The following error is displayed:
Solution: Create another topic or enable the automatic topic creation function.