1. 程式人生 > >關於zookeeper不能啟動的一種情況

關於zookeeper不能啟動的一種情況

[[email protected]_0_3_centos bin]# ./zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper-3.4.11/bin/../conf/zoo.cfg
grep: /usr/local/zookeeper-3.4.11/bin/../conf/zoo.cfg: No such file or directory
mkdir: cannot create directory `': No such file or directory
Starting zookeeper ... STARTED
[[email protected]_0_3_centos bin]# ./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper-3.4.11/bin/../conf/zoo.cfg
grep: /usr/local/zookeeper-3.4.11/bin/../conf/zoo.cfg: No such file or directory
mkdir: cannot create directory `': No such file or directory
grep: /usr/local/zookeeper-3.4.11/bin/../conf/zoo.cfg: No such file or directory
grep: /usr/local/zookeeper-3.4.11/bin/../conf/zoo.cfg: No such file or directory
Error contacting service. It is probably not running.

這裡的原因是因為下載下來的zoo.cfg名字是zoo_sample.cfg,只需要改名字即可

mv zoo_sample.cfg zoo.cfg
成功啟動
[[email protected]_0_3_centos bin]# ./zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper-3.4.11/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[[email protected]_0_3_centos bin]# ./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper-3.4.11/bin/../conf/zoo.cfg
Mode: standalone

希望有所幫助,哈哈