1. 程式人生 > >啟動Zookeeper出現錯誤bin/zkServer.sh: line 140: ./zookeeper.out: Permission denied

啟動Zookeeper出現錯誤bin/zkServer.sh: line 140: ./zookeeper.out: Permission denied

在阿里雲上搭建Zookeeper時,利用bin/zkServer.sh start啟動Zookeeper出現如下錯誤:

$ bin/zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /home/lmg/Softwares/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... bin/zkServer.sh: line 149: zookeeper/zkData/zookeeper_server.pid: Permission denied
FAILED TO WRITE PID
$ bin/zkServer.sh: line 140: ./zookeeper.out: Permission denied

根據日誌顯示分析,是對檔案操作時許可權不夠,則增加使用者許可權

使用命令:sudo chown -R xxx:xxx zookeeper/ 

問題解決:

$ bin/zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /home/lmg/Softwares/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED