2013-07-16 49 views
5

Well..every服務可以連接到我的飼養員想到卡夫卡。下面是我在server.properties文件中的連接字符串卡夫卡無法連接KafkaServerStable啓動時zookeeper- FATAL致命錯誤世界

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

已經有兩個zookeeper服務器上的所有端口....總混雜模式。我甚至可以telnet到從卡夫卡服務器的動物園管理員服務器..

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

所以....而困惑爲什麼卡夫卡將無法連接到動物園管理員?

我使用Ubuntu 12.04和卡夫卡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 [email protected] (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) 
+4

我發現這個問題,卡夫卡不喜歡在連接與字符串> zk.connect = 1.dzk.syd.druid的空間。 neo.com:2181,2.dzk.syd.druid.neo.com:21 81 – Tampa

+0

我在連接到卡夫卡星火流應用程序相同的問題。刪除逗號後的空格也是修復之處。 – davidpricedev

+0

@Tampa你能在這裏添加您的評論作爲一個答案,並接受呢?這也適用於我連接Spark到HBase。 – adamdunson

回答

4

在您的卡夫卡/配置/ server.properties,應該有一個屬性

#host.name=localhost 

如果你註釋掉這一點,或此設置爲另一個名字,那名字應該是在/ etc/hosts文件

+0

沒有爲我的實際工作:( – Adelin