使用ll命令和chown命令对zookeeper文件的拥有者进行修改后,在普通用户hadoop下启动zookeeper,但是报一下错误:
[hadoop@Slave1 zookeeper]$ bin/zkServer.sh start JMX enabled by default Using config: /usr/local/zookeeper/bin/../conf/zoo.cfg Starting zookeeper ... bin/zkServer.sh: line 113: /usr/local/zookeeper/zkdata/zookeeper_server.pid: Permission denied FAILED TO WRITE PID [hadoop@Slave1 zookeeper]$
主要错误点是:Permission denied FAILED TO WRITE PID,字面意思是没有写权限。
接下来,使用chmod命令增加权限,再次启动,成功:
[hadoop@Slave1 local]$ su Password: [root@Slave1 local]# chmod a+xwr zookeeper/ [root@Slave1 local]# exit exit [hadoop@Slave1 local]$ cd zookeeper/ [hadoop@Slave1 zookeeper]$ bin/zkServer.sh start JMX enabled by default Using config: /usr/local/zookeeper/bin/../conf/zoo.cfg Starting zookeeper ... STARTED [hadoop@Slave1 zookeeper]$