运行脚本时出现问题

运行脚本时出现问题

我在运行时遇到错误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)

笔记

  1. 允许

    cmd > ls -ld /etc/init.d/kafka-zookeeper 
    -rwxr-xr-x. 1 root root 1470 Jan 22 12:45 /etc/init.d/kafka-zookeeper
    
  2. /tmp/zookeeper/version-2/snapshot.12文件仅存在权限问题。

答案1

我认为你应该运行以下两行,然后尝试运行

chmod 755 /tmp/zookeeper/version-2/snapshot.12
chown root:root /tmp/zookeeper/version-2/snapshot.12

相关内容