刚从kafka官网上下载的kafka_2.11-2.1.0,按官网上的教程,解压然后启动zookeeper在启动Zookeeper时,停止在INFO binding to port 0.0.0.0/0.0.0.0:21(org.apache.zookeeper.server.NIOServerCnxnFactory)不动了。
[2019-02-22 16:18:00,745] INFO Reading configuration from: config/zookeeper.properties (org.apache.zookeeper.server.quorum.QuorumPeerConfig) [2019-02-22 16:18:00,747] INFO autopurge.snapRetainCount set to 3 (org.apache.zookeeper.server.DatadirCleanupManager) [2019-02-22 16:18:00,747] INFO autopurge.purgeInterval set to 0 (org.apache.zookeeper.server.DatadirCleanupManager) [2019-02-22 16:18:00,748] INFO Purge task is not scheduled. (org.apache.zookeeper.server.DatadirCleanupManager) [2019-02-22 16:18:00,748] WARN Either no config or no quorum defined in config, running in standalone mode (org.apache.zookeeper.server.quorum.QuorumPeerMain) [2019-02-22 16:18:00,778] INFO Reading configuration from: config/zookeeper.properties (org.apache.zookeeper.server.quorum.QuorumPeerConfig) [2019-02-22 16:18:00,779] INFO Starting server (org.apache.zookeeper.server.ZooKeeperServerMain) [2019-02-22 16:18:00,789] INFO Server environment:zookeeper.version=3.4.13-2d71af4dbe22557fda74f9a9b4309b15a7487f03, built on 06/29/2018 00:39 GMT (org.apache.zookeeper.server.ZooKeeperServer) [2019-02-22 16:18:00,789] INFO Server environment:host.name=hwb (org.apache.zookeeper.server.ZooKeeperServer) [2019-02-22 16:18:00,789] INFO Server environment:java.version=11.0.2 (org.apache.zookeeper.server.ZooKeeperServer) [2019-02-22 16:18:00,789] INFO Server environment:java.vendor=Oracle Corporation (org.apache.zookeeper.server.ZooKeeperServer) [2019-02-22 16:18:00,789] INFO Server environment:java.home=/opt/jdk-11.0.2 (org.apache.zookeeper.server.ZooKeeperServer) @ @ @ @ "nohup.out" 41L, 9027C
恭喜你,成功了,这个是会话前端保持的,你加&可以后台运行。
在哪里加&?启动命令?bin/zookeeper-server-start.sh config/zookeeper.properties
我刚接触,对这块不太懂
nohup bin/zookeeper-server-start.sh config/zookeeper.properties &
nohup: 忽略输入并把输出追加到"nohup.out"
[2]+ 退出 1 nohup bin/zookeeper-server-start.sh config/zookeeper.properties
运行结果,好像没成功啊,telnet端口没通
看下nohup.out里面打印的什么
[2019-02-22 16:18:00,745] INFO Reading configuration from: config/zookeeper.properties (org.apache.zookeeper.server.quorum.QuorumPeerConfig)
[2019-02-22 16:18:00,747] INFO autopurge.snapRetainCount set to 3 (org.apache.zookeeper.server.DatadirCleanupManager)
[2019-02-22 16:18:00,747] INFO autopurge.purgeInterval set to 0 (org.apache.zookeeper.server.DatadirCleanupManager)
[2019-02-22 16:18:00,748] INFO Purge task is not scheduled. (org.apache.zookeeper.server.DatadirCleanupManager)
[2019-02-22 16:18:00,748] WARN Either no config or no quorum defined in config, running in standalone mode (org.apache.zookeeper.server.quorum.QuorumPeerMain)
[2019-02-22 16:18:00,778] INFO Reading configuration from: config/zookeeper.properties (org.apache.zookeeper.server.quorum.QuorumPeerConfig)
[2019-02-22 16:18:00,779] INFO Starting server (org.apache.zookeeper.server.ZooKeeperServerMain)
[2019-02-22 16:18:00,789] INFO Server environment:zookeeper.version=3.4.13-2d71af4dbe22557fda74f9a9b4309b15a7487f03, built on 06/29/2018 00:39 GMT (org.apache.zookeeper.server.ZooKeeperServer)
[2019-02-22 16:18:00,789] INFO Server environment:host.name=hwb (org.apache.zookeeper.server.ZooKeeperServer)
[2019-02-22 16:18:00,789] INFO Server environment:java.version=11.0.2 (org.apache.zookeeper.server.ZooKeeperServer)
[2019-02-22 16:18:00,789] INFO Server environment:java.vendor=Oracle Corporation (org.apache.zookeeper.server.ZooKeeperServer)
[2019-02-22 16:18:00,789] INFO Server environment:java.home=/opt/jdk-11.0.2 (org.apache.zookeeper.server.ZooKeeperServer)
@ @ @ @
"nohup.out" 41L, 9027C
telnet localhost 2181
telnet localhost 2181
Trying ::1...
Connected to localhost.
Escape character is '^]'.
这是通了吗?
嗯。zk启动成功了
好的,非常感谢。困扰了我一天,原来是启动成功了的。新手上路。。。
客气了,结贴吧。
你的答案