简体   繁体   中英

Error while producing messages in a kafka topic

I am getting below error while producing message in my kafka topic

/data/kafka_2.11-1.1.1/bin/kafka-console-producer.sh /data/kafka_2.11-1.1.1/config/client-ssl.properties --broker-list kafka-001.edb.test.swissport.aero:9093,kafka-002.edb.test.swissport.aero:9093,kafka-003.edb.test.swissport.aero:9093 --topic topic_elk

hi how are you [2019-08-19 18:51:44,932] ERROR Error when sending message to topic topic_elk with key: null, value: 14 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback) org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms.

/data/kafka_2.11-1.1.1/bin/kafka-topics.sh --zookeeper detcsasplx0010:2181 --describe --topic topic_elk
Topic:topic_elk PartitionCount:1  ReplicationFactor:3 Configs:
Topic: topic_elk  Partition: 0    Leader: 2 Replicas: 2,1,0 Isr: 2,1,0

My server.properties

listeners=SSL://kafka-002.edb.test.swissport.aero:9093
advertised.listeners=SSL://kafka-002.edb.test.swissport.aero:9093`
security.inter.broker.protocol = SSL
ssl.client.auth=required

Please suggest.

From your exception...

(org.apache.kafka.clients.producer.internals.ErrorLoggingCallback) org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms.

there appears to be a problem while fetching the metadata itself.

Here are some ways to troubleshoot..

  1. Try running telnet to the address of the Kafka broker from the machine on which you are running the producer. If you are not able to connect to it, then possibly Kafka is not running.
  2. Ensure that the process that listens on that port is Kafka broker only and not any other process.
  3. Ensure that the advertised listeners does not route your request to a localhost or to somewhere to which your producer program cannot connect to.

Don't know if this is really the cause. (From what you pasted, you have)

advertised.listeners=SSL://kafka-002.edb.test.swissport.aero:9093`

you have a ` at the end, try removing that and check.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM