KafkaServerStable 启动期间 kafka 无法连接到 Zookeeper-FATAL 致命错误 [英] kafka cant connect to zookeeper- FATAL Fatal error during KafkaServerStable startup

查看:47
本文介绍了KafkaServerStable 启动期间 kafka 无法连接到 Zookeeper-FATAL 致命错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗯..世界上的每个服务都可以连接到我的动物园管理员,除了 kafka.下面是我在 server.properties 文件中的连接字符串

Well..every service in the world can connect to my zookeeper expect kafka. Below is my connection string in server.properties file

zk.connect=1.dzk.syd.druid.neo.com:2181, 2.dzk.syd.druid.neo.com:2181

在两个zookeeper服务器上拥有所有端口......完全混杂模式.我什至可以从kafka服务器telnet到zookeeper服务器..

Have have all ports on the two zookeeper servers ....total promiscuous mode. I can even telnet into the zookeeper server from the kafka server..

telnet  2.dzk.syd.druid.neo.com 2181
Trying 54.252.183.218...
Connected to 2.dzk.syd.druid.neo.com.
Escape character is '^]'.

所以....对为什么 kafka 无法连接到 zookeeper 感到困惑?

So....rather confused on why kafka will not connect to zookeeper?

我使用的是 ubuntu 12.04 和 kafka 0.7.2

I am using ubuntu 12.04 and kafka 0.7.2

[2013-07-16 04:36:49,915] INFO Client environment:user.home=/root (org.apache.zookeeper.ZooKeeper)
[2013-07-16 04:36:49,915] INFO Client environment:user.dir=/etc/sv/kafka (org.apache.zookeeper.ZooKeeper)
[2013-07-16 04:36:49,916] INFO Initiating client connection, connectString=1.dzk.syd.druid.neo.com:2181, 2.dzk.syd.druid.neo.com:2181 sessionTimeout=6000 watcher=org.I0Itec.zkclient.ZkClient@39cc65b1 (org.apache.zookeeper.ZooKeeper)
[2013-07-16 04:36:49,935] INFO Terminate ZkClient event thread. (org.I0Itec.zkclient.ZkEventThread)
[2013-07-16 04:36:49,938] FATAL Fatal error during KafkaServerStable startup. Prepare to shutdown (kafka.server.KafkaServerStartable)
org.I0Itec.zkclient.exception.ZkException: Unable to connect to 1.dzk.syd.druid.neo.com:2181, 2.dzk.syd.druid.neo.com:2181
    at org.I0Itec.zkclient.ZkConnection.connect(ZkConnection.java:66)
    at org.I0Itec.zkclient.ZkClient.connect(ZkClient.java:872)
    at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:98)
    at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:84)
    at kafka.server.KafkaZooKeeper.startup(KafkaZooKeeper.scala:44)
    at kafka.log.LogManager.<init>(LogManager.scala:93)
    at kafka.server.KafkaServer.startup(KafkaServer.scala:58)
    at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:34)
    at kafka.Kafka$.main(Kafka.scala:47)
    at kafka.Kafka.main(Kafka.scala)
Caused by: java.net.UnknownHostException:  2.dzk.syd.druid.neo.com: Name or service not known
    at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
    at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:894)
    at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1286)
    at java.net.InetAddress.getAllByName0(InetAddress.java:1239)
    at java.net.InetAddress.getAllByName(InetAddress.java:1155)
    at java.net.InetAddress.getAllByName(InetAddress.java:1091)
    at org.apache.zookeeper.ClientCnxn.<init>(ClientCnxn.java:387)
    at org.apache.zookeeper.ClientCnxn.<init>(ClientCnxn.java:332)
    at org.apache.zookeeper.ZooKeeper.<init>(ZooKeeper.java:383)
    at org.I0Itec.zkclient.ZkConnection.connect(ZkConnection.java:64)
    ... 9 more
[2013-07-16 04:36:49,942] INFO Shutting down Kafka server (kafka.server.KafkaServer)
[2013-07-16 04:36:49,943] INFO shutdown scheduler kafka-logcleaner- (kafka.utils.KafkaScheduler)
[2013-07-16 04:36:49,944] INFO Kafka server shut down completed (kafka.server.KafkaServer)

推荐答案

在你的 kafka/config/server.properties 中,应该有一个属性

In your kafka/config/server.properties, there should be a property

#host.name=localhost

如果您取消了注释,或将其设置为其他名称,则该名称应在/etc/hosts 文件中

if you have uncommented this, or set this to another name, then that name should be in the /etc/hosts file

这篇关于KafkaServerStable 启动期间 kafka 无法连接到 Zookeeper-FATAL 致命错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆