kafka消息传递失败

lyr7nygr  于 2021-06-08  发布在  Kafka
关注(0)|答案(2)|浏览(460)

我正在尝试使用kafka ruby客户端-https://github.com/zendesk/ruby-kafka 给Kafka贴日志。下面是Kafka的日志

I, [2016-08-03T17:54:38.131775 #14887]  INFO -- : Fetching cluster metadata from kafka://10.10.10.162:9092
D, [2016-08-03T17:54:38.131939 #14887] DEBUG -- : Opening connection to 10.40.50.16:9092 with client id ruby-kafka...
D, [2016-08-03T17:54:38.133199 #14887] DEBUG -- : Sending request 1 to 10.40.50.16:9092
D, [2016-08-03T17:54:38.133339 #14887] DEBUG -- : Waiting for response 1 from 10.40.50.16:9092
D, [2016-08-03T17:54:38.134763 #14887] DEBUG -- : Received response 1 from 10.40.50.16:9092
I, [2016-08-03T17:54:38.134823 #14887]  INFO -- : Discovered cluster metadata; nodes: kafka1:9092 (node_id=1), kafka2:9092 (node_id=2), kafka3:9092 (node_id=3)
D, [2016-08-03T17:54:38.134882 #14887] DEBUG -- : Closing socket to 10.40.50.16:9092
D, [2016-08-03T17:54:38.135018 #14887] DEBUG -- : Current leader for TRANSACTION_GOCARS/0 is node kafka2:9092 (node_id=2)
I, [2016-08-03T17:54:38.135092 #14887]  INFO -- : Sending 1 messages to kafka2:9092 (node_id=2)
D, [2016-08-03T17:54:38.135195 #14887] DEBUG -- : Opening connection to kafka2:9092 with client id ruby-kafka...
E, [2016-08-03T17:54:38.135750 #14887] ERROR -- : Failed to connect to kafka2:9092: getaddrinfo: Name or service not known
E, [2016-08-03T17:54:38.135825 #14887] ERROR -- : Could not connect to broker kafka2:9092 (node_id=2): getaddrinfo: Name or service not known

有人知道怎么修吗。

vohkndzv

vohkndzv1#

试着平或 curl 头发 kafka2 你的应用程序中的代理,看你是否可以连接到它。或者你能告诉我们 server.properties 关于 kafka2 . 可能无法访问主机名。

to94eoyn

to94eoyn2#

我认为这个错误信息对你来说是非常有用的- kafka2 是不可路由的,因此您应该配置连接以便您尝试访问的计算机 kafka2 从是真的可以达到它或改变 advertised.host.name 在Kafka的 server.properties 为客户端公开不同的地址

相关问题