无法启动带有“严重不可恢复的错误”的zookeeper服务

时间:2017-07-13 10:21:35

标签: apache-zookeeper

我无法启动zookeeper服务。请查看堆栈跟踪。

  • 跟踪1: org.apache.zookeeper.server.ZooKeeperServer:

    Severe unrecoverable error, exiting
    java.io.FileNotFoundException: /var/lib/zookeeper/version-2/snapshot.40003a3c3 (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:225)
      at org.apache.zookeeper.server.persistence.FileTxnSnapLog.save(FileTxnSnapLog.java:275)
      at org.apache.zookeeper.server.ZooKeeperServer.takeSnapshot(ZooKeeperServer.java:270)
      at org.apache.zookeeper.server.SyncRequestProcessor$1.run(SyncRequestProcessor.java:123)
    
  • 跟踪2: org.apache.zookeeper.server.SyncRequestProcessor:

    Severe unrecoverable error, exiting
    java.io.FileNotFoundException: /var/lib/zookeeper/version-2/log.40003a3c5 (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.FileTxnLog.append(FileTxnLog.java:205)
      at org.apache.zookeeper.server.persistence.FileTxnSnapLog.append(FileTxnSnapLog.java:347)
      at org.apache.zookeeper.server.ZKDatabase.append(ZKDatabase.java:476)
      at org.apache.zookeeper.server.SyncRequestProcessor.run(SyncRequestProcessor.java:110)
    

我试过了 -

  1. 将所有权更改为zookeeper:zookeeper。
  2. 将权限级别更改为755,将/var/lib/zookeeper更改为最后777。
  3. 将默认dataLogDir和dataDir覆盖为/var/lib/zookeeper2
  4. 从服务器中删除zookeeper角色服务并再次添加回来。
  5. 停用完整服务器并在群集服务器中再次添加。

1 个答案:

答案 0 :(得分:0)

你需要使用'/ var / lib /文件夹作为dataDir吗? '/ var / lib'文件夹是一个特殊的文件夹,通常由os包使用。

如果您将dataDir和dataLogDir更改为用户特定位置,它将起作用。