原因调查:

 

root@ubuntu:/home/wqxin01/zookeeper-3.4.6/bin# cat zookeeper.out 


(注意目录和文件名)

 

2017-08-18 20:19:31,903 [myid:] - INFO  [main:QuorumPeerConfig@103] - Reading configuration from: /home/wqxin01/zookeeper-3.4.6/bin/../conf/zoo.cfg
2017-08-18 20:19:31,940 [myid:] - ERROR [main:QuorumPeerMain@85] - Invalid config, exiting abnormally
org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException: Error processing /home/wqxin01/zookeeper-3.4.6/bin/../conf/zoo.cfg
        at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:123)
        at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:101)
        at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:78)
Caused by: java.lang.IllegalArgumentException: dataLogDir /home/wqxin01/zookeeper-3.4.6/logs is missing.
        at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties(QuorumPeerConfig.java:253)
        at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:119)
        ... 2 more
Invalid config, exiting abnormally

 

原来在 zoo.cfg文件中配置:dataLogDir=/home/wqxin01/zookeeper-3.4.6/logs  文件夹不存在。
所以只能手动建:

 

root@ubuntu:/home/wqxin01/zookeeper-3.4.6#  mkdir logs

 

然后重启zookeeper

root@ubuntu:/home/wqxin01/zookeeper-3.4.6/bin# zkServer.sh  stop
root@ubuntu:/home/wqxin01/zookeeper-3.4.6/bin# zkServer.sh  start

 

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐