kafka生产者/消费者机器试图连接到自己

时间:2017-10-24 09:05:34

标签: java amazon-ec2 apache-kafka kafka-consumer-api kafka-producer-api

我在EC2实例上部署了kafka集群,ip a.b.c.d,生产者和使用者也部署在{{1}上ip a2.b2.c2.d2的另一个EC2实例(在同一个实例上)上{{1} 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机器试图连接到自己? (这是正常的吗?)我该如何解决这个问题?我已经花了大约16个小时。弄清楚,但没有运气

0 个答案:

没有答案