Zookeeper: FAILED TO WRITE PID
Asked Answered
V

3

1

So I'm trying to to get started with Accumulo. I installed Hadoop and it runs w/o problems but when I try to start Zookeeper I get:

JMX enabled by default
Using config: /opt/zookeeper/bin/../conf/zoo.cfg
-n Starting zookeeper ... 
/opt/zookeeper/bin/zkServer.sh: line 103: /tmp/zookeeper/zookeeper_server.pid: No such file or directory
FAILED TO WRITE PID

I've looked around can't seem to find an answer.

Vigilance answered 18/6, 2012 at 23:48 Comment(1)
try starting server with "start-foreground" to see full log of problemAerial
F
3

I 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

Fillbert answered 30/3, 2015 at 12:58 Comment(0)
B
1

I have never heard of zookeeper, but it could be a permissions issue trying to write the file zookeeper_server.pid or perhaps the directory /tmp/zookeeper/ doesn't exist and the shell script isn't accounting for that possibility. Check the permissions and existence of those directories.

Brevity answered 18/6, 2012 at 23:56 Comment(1)
Thanks for the reply. It was stupid me. I was supposed to ssh localhost first and then run the command.Vigilance
S
1

zookeeper distributed with default conf, uses /tmp/zookeeper as dataDir for just example sake. It is suggested changing this value in /path/to/zookeeper/conf/zoo.cfg to /var/lib/zookeeper.

Creating /var/lib/zookeeper needs root access, so sudo is required. This directory when created will have following permissions.

ls -al  /var/lib/zookeeper/
drwxr-xrwx  4 root           wheel  128 May  9 14:03 .

When zookeeper is started without root permission, it cannot write to this directory. hence fails with error

... /usr/local/zookeeper/bin/zkServer.sh: line 169: /var/lib/zookeeper/zookeeper_server.pid: Permission denied
FAILED TO WRITE PID

You need to give write permissions to allow user starting zookeeper to write to /var/lib/zookeeper. In my case, as I am using it in local, I used the following command and it worked

sudo chmod o+w /var/lib/zookeeper
Steward answered 9/5, 2020 at 8:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.