Support Questions

Find answers, ask questions, and share your expertise

zookeeper gets permission problem on /var/lib/zookeeper

avatar
Contributor

Hello

zookeeper could not start because of the java.io.FileNotFoundException: /var/lib/zookeeper/version-2/snapshot.0 (Permission denied) error

Normally zookeeper user could write in this directory

 

[root@testos1 ~]# ll /var/lib | grep zoo
drwxr-xr-x. 3 zookeeper zookeeper 4096 Aug 12 18:54 zookeeper
You have new mail in /var/spool/mail/root
[root@testos1 ~]# ll /var/lib/zookeeper/
total 4
drwxr-xr-x. 2 zookeeper zookeeper 4096 Aug 13 11:31 version-2
[root@testos1 ~]# ll /var/lib/zookeeper/version-2/
total 0
[root@testos1 ~]#

 

My environment has 1 server and tried to install from parcels

 

cloudera-manager-agent.x86_64 5.4.3-1.cm543.p0.258.el6 @/cloudera-manager-agent-5.4.3-1.cm543.p0.258.el6.x86_64
cloudera-manager-daemons.x86_64 5.4.3-1.cm543.p0.258.el6 @/cloudera-manager-daemons-5.4.3-1.cm543.p0.258.el6.x86_64
cloudera-manager-server.x86_64 5.4.3-1.cm543.p0.258.el6 @/cloudera-manager-server-5.4.3-1.cm543.p0.258.el6.x86_64


var/log/zookeeper/zookeeper-cmf-zookeeper-SERVER-testos1.localdomain.log file has following error lines


Aug 13, 1:08:54.630 PM INFO org.apache.zookeeper.server.ZooKeeperServer

Server environment:user.name=cloudera-scm

Aug 13, 1:08:54.630 PM INFO org.apache.zookeeper.server.ZooKeeperServer

Server environment:user.home=/home/cloudera-scm

Aug 13, 1:08:54.630 PM INFO org.apache.zookeeper.server.ZooKeeperServer

Server environment:user.dir=/var/run/cloudera-scm-agent/process/115-zookeeper-server

Aug 13, 1:08:54.631 PM DEBUG org.apache.zookeeper.server.persistence.FileTxnSnapLog

Opening datadir:/var/lib/zookeeper snapDir:/var/lib/zookeeper

Aug 13, 1:08:54.631 PM INFO org.apache.zookeeper.server.ZooKeeperServer

tickTime set to 2000

Aug 13, 1:08:54.631 PM INFO org.apache.zookeeper.server.ZooKeeperServer

minSessionTimeout set to 4000

Aug 13, 1:08:54.632 PM INFO org.apache.zookeeper.server.ZooKeeperServer

maxSessionTimeout set to 60000

Aug 13, 1:08:54.654 PM INFO org.apache.zookeeper.server.NIOServerCnxnFactory

binding to port 0.0.0.0/0.0.0.0:2181

Aug 13, 1:08:54.674 PM INFO org.apache.zookeeper.server.persistence.FileTxnSnapLog

Snapshotting: 0x0 to /var/lib/zookeeper/version-2/snapshot.0

Aug 13, 1:08:54.675 PM ERROR org.apache.zookeeper.server.ZooKeeperServer

Severe unrecoverable error, exiting
java.io.FileNotFoundException: /var/lib/zookeeper/version-2/snapshot.0 (Permission denied)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
at org.apache.zookeeper.server.persistence.FileSnap.serialize(FileSnap.java:225)
at org.apache.zookeeper.server.persistence.FileTxnSnapLog.save(FileTxnSnapLog.java:275)
at org.apache.zookeeper.server.ZooKeeperServer.takeSnapshot(ZooKeeperServer.java:270)
at org.apache.zookeeper.server.ZooKeeperServer.loadData(ZooKeeperServer.java:265)
at org.apache.zookeeper.server.ZooKeeperServer.startdata(ZooKeeperServer.java:377)
at org.apache.zookeeper.server.NIOServerCnxnFactory.startup(NIOServerCnxnFactory.java:122)
at org.apache.zookeeper.server.ZooKeeperServerMain.runFromConfig(ZooKeeperServerMain.java:118)
at org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:91)
at org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:53)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:121)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:79)

Aug 13, 1:08:56.903 PM INFO org.apache.zookeeper.server.quorum.QuorumPeerConfig

Reading configuration from: /var/run/cloudera-scm-agent/process/115-zookeeper-server/zoo.cfg

Aug 13, 1:08:56.918 PM ERROR org.apache.zookeeper.server.quorum.QuorumPeerConfig

Invalid configuration, only one server specified (ignoring)

Aug 13, 1:08:56.919 PM INFO org.apache.zookeeper.server.DatadirCleanupManager

autopurge.snapRetainCount set to 5

Aug 13, 1:08:56.920 PM INFO org.apache.zookeeper.server.DatadirCleanupManager

autopurge.purgeInterval set to 24

Aug 13, 1:08:56.920 PM WARN org.apache.zookeeper.server.quorum.QuorumPeerMain

Either no config or no quorum defined in config, running in standalone mode

 

 

1 ACCEPTED SOLUTION

avatar
Explorer

Hi again,

 

Your configuration is correct and looks like mine.


I think the problem is the permission of the folder and specially the period at the end of the permission.
[root@testos1 ~]# ll /var/lib | grep zoo
drwxr-xr-x. 3 zookeeper zookeeper 4096 Aug 12 18:54 zookeeper

                       

You have to check your ACL and the SeLinux. It is better to disable the SeLinux on your server.

 

BRs,

Spyros

View solution in original post

10 REPLIES 10

avatar
Contributor

Hello

 

I changed directory permission to 755 and then change ACL of it, then it's working now.

I will restart whole environment and then check again

 

Thanks for your inputs

msuluhan