我在ec2示例上部署了kafka集群 ip a.b.c.d
,生产者和使用者也部署在另一个ec2示例上(都在同一个示例上) ip a2.b2.c2.d2
,在 catalina.out
的日志文件 producer/consumer
我总是对错误进行罚款
java.net.UnknownHostException: ip-a2-b2-c2-d2: ip-a2-b2-c2-d2: Name or service not known
at java.net.InetAddress.getLocalHost(InetAddress.java:1496)
at kafka.consumer.ZookeeperConsumerConnector.<init>(ZookeeperConsumerConnector.scala:107)
at kafka.consumer.ZookeeperConsumerConnector.<init>(ZookeeperConsumerConnector.scala:128)
at kafka.consumer.Consumer$.create(ConsumerConnector.scala:89)
at kafka.consumer.Consumer.create(ConsumerConnector.scala)
at com.wsg.promo.kafka.listener.ConsumerClient.run(ConsumerClient.java:90)
at com.wsg.promo.kafka.listener.ConsumerClient.run(ConsumerClient.java:62)
Caused by: java.net.UnknownHostException: ip-a2-b2-c2-d2: Name or service not known
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:922)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1316)
at java.net.InetAddress.getLocalHost(InetAddress.java:1492)
... 6 more
哪个州 producer/consumer
机器试图连接到自身( ip-a2-b2-c2-d2
是为了 producer/consumer
机器),
为什么是 producer/consumer
机器试图连接到自身(这正常吗?)我如何解决这个问题?我已经花了16个小时了。想弄清楚,但运气不好
暂无答案!
目前还没有任何答案,快来回答吧!