zookeeper启动时./zkServer.sh: line 113: /root/zookeeper-3.4.6/data/zookeeper_server.pid: Permission d错误

在配置安装好zookeeper之后执行zkServer.sh start发现提示:

[itcast@localhost bin]$ ./zkServer.sh start
JMX enabled by default
Using config: /home/itcast/zookeeper-3.4.6/bin/../conf/zoo.cfg
mkdir: cannot create directory `/root': Permission denied
Starting zookeeper ... ./zkServer.sh: line 113: /root/zookeeper-3.4.6/data/zookeeper_server.pid: Permission denied
FAILED TO WRITE PID

原因是刚才/data/zookeeper是root权限,而不是doop权限的,修改/data权限即可解决

输入chown -R doop:hadoop /usr/doop/zookeeper-3.4.6/data回车

[root@localhost /]# chown -R doop:hadoop /usr/doop/zookeeper-3.4.6/data
chown: invalid user: `doop:hadoop'

然后回到zookeeper的bin目录输入命令

[root@localhost bin]# ./zkServer.sh start

[root@localhost bin]# ./zkServer.sh start
JMX enabled by default
Using config: /home/itcast/zookeeper-3.4.6/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED

这样就启动了!

你可能感兴趣的:(zookeeper启动时./zkServer.sh: line 113: /root/zookeeper-3.4.6/data/zookeeper_server.pid: Permission d错误)