我使用的是合流平台,zookeeper在状态查找中处于活动状态。但当我试着用confluent开始Kafka时,它显示zookeeper已经失败了。
$ sudo service zookeeper status
Redirecting to /bin/systemctl status zookeeper.service
● zookeeper.service - Zookeeper
Loaded: loaded (/etc/systemd/system/zookeeper.service; disabled; vendor preset: disabled)
Active: active (running) since Tue 2017-08-08 17:25:34 PDT; 16h ago
Docs: http://kafka.apache.org/documentation.html
Process: 3774 ExecStop=/var/www/confluent/bin/zookeeper-server-stop (code=exited, status=1/FAILURE)
Main PID: 3785 (java)
CGroup: /system.slice/zookeeper.service
└─3785 java -Xmx512M -Xms512M -server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+DisableExplicitGC -Djava.awt.headless=true -Xloggc:/var/log...
zookeeper[3785]: [2017-08-08 17:26:09,005] INFO Processed session termination for sessionid: 0x15dc460fd0c0000 (org.apache.zooke...Processor)
zookeeper[3785]: [2017-08-08 17:26:39,000] INFO Expiring session 0x15dc4364baf0004, timeout of 60000ms exceeded (org.apache.zook...perServer)
zookeeper[3785]: [2017-08-08 17:26:39,000] INFO Expiring session 0x15dc4364baf0002, timeout of 60000ms exceeded (org.apache.zook...perServer)
zookeeper[3785]: [2017-08-08 17:26:39,000] INFO Expiring session 0x15dc4364baf0003, timeout of 60000ms exceeded (org.apache.zook...perServer)
zookeeper[3785]: [2017-08-08 17:26:39,001] INFO Processed session termination for sessionid: 0x15dc4364baf0004 (org.apache.zooke...Processor)
zookeeper[3785]: [2017-08-08 17:26:39,002] INFO Processed session termination for sessionid: 0x15dc4364baf0002 (org.apache.zooke...Processor)
zookeeper[3785]: [2017-08-08 17:26:39,002] INFO Processed session termination for sessionid: 0x15dc4364baf0003 (org.apache.zooke...Processor)
zookeeper[3785]: [2017-08-09 09:56:26,711] INFO Accepted socket connection from /127.0.0.1:46446 (org.apache.zookeeper.server.NI...xnFactory)
zookeeper[3785]: [2017-08-09 09:59:14,796] WARN Exception causing close of session 0x0 due to java.io.IOException: Len error -72...erverCnxn)
zookeeper[3785]: [2017-08-09 09:59:14,796] INFO Closed socket connection for client /127.0.0.1:46446 (no session established for...erverCnxn)
Hint: Some lines were ellipsized, use -l to show in full.
$ confluent start kafka
Starting zookeeper
|Zookeeper failed to start
zookeeper is [DOWN]
Cannot start Kafka, Zookeeper is not running. Check your deployment
5条答案
按热度按时间7kjnsjlb1#
运行时出现此消息的最常见原因是:
并通知您zookeeper已关闭,即当前正在运行另一个zookeeper示例,并且新的zookeeper示例无法绑定到其所需的端口(默认情况下,此端口为2181)。
有几个选项可供您选择,以确定在尝试发布时当前正在运行的另一个zookeeper示例是什么
confluent start kafka
是:跑
jps
查看正在运行的java进程。zookeeper是名为QuorumPeerMain
在其进程id旁边(相当于runningps xuaww | grep -i zookeeper
或同等产品)。跑
lsof -i :2181
找出正在运行并保留了默认zookeeper端口的进程(在本例中为2181,但在您的系统中可能不同)。试着跑步
confluent start kafka
在停止上述过程后再次。xienkqul2#
跑
$ confluent log zookeeper
您将能够查看日志中的任何错误zookeeper很有可能已经在运行并使用2181端口,
使用
$ sudo lsof -i :1-2181
查看哪个进程正在使用该端口,然后尝试终止并重试,或者跑
$ sudo netstat -plten | grep java
查看它们所在的进程和端口。跑
kill -9 <pid>
终止进程。u4dcyp6a3#
这是因为zookeeper已经在运行,您可以使用
手动终止进程,它就可以工作了。
xxls0lw84#
你混合了两个装置。
confluent start kafka
就看你跑了confluent start zookeeper
.更确切地说,似乎您已经有运行zookeeper的systemctl了,所以您最好只配置
server.properties
使用常规的kafka-server-start
脚本。和/或为kafka创建systemctl文件。beq87vna5#
我收到了同样的信息。在我的例子中,我没有正确设置$java\u home变量。