访问远程计算机中的kafka代理错误

时间:2014-12-16 07:23:14

标签: apache-kafka

我在172.19.91.125中运行zookeeper和大多数我的kafka服务器。我很好地运行了这台机器中的所有东西。

但是当我尝试使用消费者访问172.19.101.61中的kafka服务时: bin / kafka-console-consumer.sh --zookeeper 172.19.91.125:2181 --from-beginning --topic my-topic

我收到以下错误消息:

[2014-12-16 01:52:42,531] ERROR Producer connection to linux:9100 unsuccessful (kafka.producer.SyncProducer)
java.nio.channels.UnresolvedAddressException
    at sun.nio.ch.Net.checkAddress(Net.java:48)
    at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:505)
    at kafka.network.BlockingChannel.connect(BlockingChannel.scala:57)
    at kafka.producer.SyncProducer.connect(SyncProducer.scala:141)
    at kafka.producer.SyncProducer.getOrMakeConnection(SyncProducer.scala:156)
    at kafka.producer.SyncProducer.kafka$producer$SyncProducer$$doSend(SyncProducer.scala:68)
    at kafka.producer.SyncProducer.send(SyncProducer.scala:112)
    at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:53)
    at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:88)
    at kafka.consumer.ConsumerFetcherManager$LeaderFinderThread.doWork(ConsumerFetcherManager.scala:66)
    at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:51)
[2014-12-16 01:52:42,531] WARN Fetching topic metadata with correlation id 66 for topics [Set(my-topic)] from broker [id:0,host:linux,port:9100] failed (kafka.client.ClientUtils$)
java.nio.channels.UnresolvedAddressException
    at sun.nio.ch.Net.checkAddress(Net.java:48)
    at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:505)
    at kafka.network.BlockingChannel.connect(BlockingChannel.scala:57)
    at kafka.producer.SyncProducer.connect(SyncProducer.scala:141)
    at kafka.producer.SyncProducer.getOrMakeConnection(SyncProducer.scala:156)
    at kafka.producer.SyncProducer.kafka$producer$SyncProducer$$doSend(SyncProducer.scala:68)
    at kafka.producer.SyncProducer.send(SyncProducer.scala:112)
    at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:53)
    at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:88)
    at kafka.consumer.ConsumerFetcherManager$LeaderFinderThread.doWork(ConsumerFetcherManager.scala:66)
    at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:51)

一定是一些配置问题,是否有人遇到同样的问题?

提前致谢!

1 个答案:

答案 0 :(得分:1)

最后,我自己解决了!

因为我没有选择,但是检查源代码,即使我对Java / scala知之甚少。

我发现主机:linux,端口:9100是代理套接字信息,应该打印一些ip地址。我认为这对主持人来说一定是错的。

然后我将配置server.properties,所有host.name字段更改为IP并重启它们,它运行良好!