1.
$ zkServer.sh start
bash: zkServer.sh: command not found
解决办法,使用./zkServer.sh start
2.
/zkServer.sh start
ZooKeeper JMX enabled by default
Using config: C:\Users\tools\zookeeper\zookeeper2\conf\zoo.cfg
Starting zookeeper ... FAILED TO START
修改zoo.cfg如下:
initLimit=5
syncLimit=2
tickTime=2000
clientPort=4182
3.
Error: Could not find or load main class org.apache.zookeeper.ZooKeeperMain
Caused by: java.lang.ClassNotFoundException: org.apache.zookeeper.ZooKeeperMain.
根本原因:本地java的版本为java11.
解决办法: 卸载java11,重新安装java8即可。
4.
zookeeper NIOServerCnxn: Too many connections from IP- max is 10
原因:zookeeper的默认链接数量是10,超过10之后就无法链接。
解决办法:修改默认连接数量,或是关闭掉不必要的连接。修改的配置:
修改zoo.cfg配置文件:
maxClientCnxns=300