简体   繁体   English

在Kafka主题中生成消息时出错

[英]Error while producing messages in a kafka topic

I am getting below error while producing message in my kafka topic 我在kafka主题中生成消息时遇到错误

/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. 嗨,你好吗[2019-08-19 18:51:44,932]错误将消息发送到主题topic_elk时发生错误,键为:null,值:14个字节,错误为:(org.apache.kafka.clients.producer.internals.ErrorLoggingCallback )org.apache.kafka.common.errors.TimeoutException:60000毫秒后无法更新元数据。

/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 我的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. 尝试从运行生产者的计算机上将telnet运行到Kafka代理的地址。 If you are not able to connect to it, then possibly Kafka is not running. 如果您无法连接到它,则可能是Kafka没有运行。
  2. Ensure that the process that listens on that port is Kafka broker only and not any other process. 确保在该端口上侦听的进程仅是Kafka代理,而不是其他任何进程。
  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. 您在末尾有一个` ,请尝试将其删除并检查。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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