我正在使用汇合平台,zookeeper处于活动状态查找状态。但是当我尝试用融合来启动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
答案 0 :(得分:3)
运行时看到的消息的最常见原因:
confluent start kafka
并通知您zookeeper已关闭,是否有另一个当前正在运行的zookeeper实例,并且新的zookeeper实例无法绑定到其所需的端口(默认情况下,此端口为2181)。
您可以使用一些选项来确定当您尝试发布confluent start kafka
时当前正在运行的其他zookeeper实例是什么:
jps
以查看正在运行的java进程。 Zookeeper是其进程ID旁边名为QuorumPeerMain
的进程。 (相当于运行ps xuaww | grep -i zookeeper
或等效的。)lsof -i :2181
以确定正在运行的进程并保留了默认的zookeeper端口(在此示例中为2181,但在您的系统中可能有所不同)。停止上述过程后,请再次尝试运行confluent start kafka
。
答案 1 :(得分:1)
我收到了同样的消息。在我的情况下,我没有正确设置$ JAVA_HOME变量。
答案 2 :(得分:1)
这是因为zookeeper已经在运行,您可以使用
检查进程ps aux|grep zookeeper
并手动终止该过程,它会起作用。
答案 3 :(得分:1)
运行$ confluent log zookeeper
,您将可以查看日志中是否有任何错误
动物园管理员很有可能已经在运行并且正在使用端口2181,
使用$ sudo lsof -i :1-2181
查看哪个进程正在使用该端口,然后尝试终止并重试,或者
运行$ sudo netstat -plten | grep java
来查看它们所在的进程和端口。
运行kill -9 <pid>
终止进程。
答案 4 :(得分:1)
您正在混合两个安装。
confluent start kafka
将取决于您运行confluent start zookeeper
。
相反,似乎您已经有运行Zookeeper的systemctl,因此,理想情况下,您应该只配置server.properties
并使用常规kafka-server-start
脚本。和/或为Kafka创建一个systemctl文件。