I am new to Zookeeper and it has being a real issue to install it and run. I am not sure what is wrong in here but I will explain what I\'ve being doing to make it more clear:
try to use sudo -E bin/zkServer.sh start
This happens to me due to low disk space. cause zookeeper cant create pid file inside zookeeper data folder.
I have faced the same issue while starting the zookeeper with this command:
hadoop@ubuntu:~/hadoop/zookeeper/zookeeper-3.4.8$ bin/zkServer.sh start
ERROR [main] client.ConnectionManager$HConnectionImplementation: The node /hbase is not in ZooKeeper.
It should have been written by the master. Check the value configured in zookeeper.znode.parent
. There could be a mismatch with the one configured in the master.
But running the script as su
rectified the issue:
hadoop@ubuntu:~/hadoop/zookeeper/zookeeper-3.4.8$ sudo bin/zkServer.sh start
ZooKeeper JMX enabled by default Using config: /home/hadoop/hadoop/zookeeper/zookeeper-3.4.8/bin/../conf/zoo.cfg Starting zookeeper ... STARTED
The default zookeeper installation (tar extract) comes with the conf file named conf/zoo_sample.cfg
while the same extract's bin/zkServer.sh
expects the conf file to be called zoo.cfg
thereby resulting in a "No such file or dir" and the "failed to write pid" error. So before running zkServer.sh to start or stop zookeeper instance, either:
zoo_sample.cfg
in the conf dir to zoo.cfg
, orI have had the same problem. In my case was useful to start Zookeeper and directly specify a configuration file:
/bin/zkServer.sh start conf/zoo.conf
When you create the Directory for dataDir make sure to use the -p
option. This will allow subsequent directories to be created as required by the application placing files.
mkdir -p /var/log/zookeeperData
Then set:
dataDir=/var/log/zookeeperData