我在运行时遇到错误kafka-zookeeper脚本。
我尝试运行脚本的命令是
root > /etc/init.d/kafka-zookeeper start
问题
2014-01-22 13:05:26,683] FATAL Severe unrecoverable error, exiting (org.apache.zookeeper.server.ZooKeeperServer)
java.io.FileNotFoundException: /tmp/zookeeper/version-2/snapshot.12 (Permission denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
at org.apache.zookeeper.server.persistence.FileSnap.serialize(FileSnap.java:224)
at org.apache.zookeeper.server.persistence.FileTxnSnapLog.save(FileTxnSnapLog.java:257)
at org.apache.zookeeper.server.ZooKeeperServer.takeSnapshot(ZooKeeperServer.java:259)
at org.apache.zookeeper.server.ZooKeeperServer.loadData(ZooKeeperServer.java:254)
at org.apache.zookeeper.server.ZooKeeperServer.startdata(ZooKeeperServer.java:366)
at org.apache.zookeeper.server.NIOServerCnxn$Factory.startup(NIOServerCnxn.java:160)
at org.apache.zookeeper.server.ZooKeeperServerMain.runFromConfig(ZooKeeperServerMain.java:110)
at org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:85)
at org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:51)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:108)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:76)
笔记
允许是
cmd > ls -ld /etc/init.d/kafka-zookeeper -rwxr-xr-x. 1 root root 1470 Jan 22 12:45 /etc/init.d/kafka-zookeeper
/tmp/zookeeper/version-2/snapshot.12
文件仅存在权限问题。
答案1
我认为你应该运行以下两行,然后尝试运行
chmod 755 /tmp/zookeeper/version-2/snapshot.12
chown root:root /tmp/zookeeper/version-2/snapshot.12