Zookeeper 无法在磁盘上加载数据库

eeq64g8w  于 2022-12-09  发布在  Apache
关注(0)|答案(1)|浏览(238)

当我停止我的zookeeper示例并复制其他路径中的zookeeper的所有数据并更改zookeeper.properties中的dataDir=/data/zookeeper-data时,出现此错误。

ERROR Unable to load database on disk (org.apache.zookeeper.server.quorum.QuorumPeer)
java.io.IOException: Unreasonable length = 198238896
at org.apache.jute.BinaryInputArchive.checkLength(BinaryInputArchive.java:127)
at org.apache.jute.BinaryInputArchive.readBuffer(BinaryInputArchive.java:92)
at org.apache.zookeeper.server.persistence.Util.readTxnBytes(Util.java:233)
at org.apache.zookeeper.server.persistence.FileTxnLog$FileTxnIterator.next(FileTxnLog.java:629)
at org.apache.zookeeper.server.persistence.FileTxnSnapLog.restore(FileTxnSnapLog.java:166)
at org.apache.zookeeper.server.ZKDatabase.loadDataBase(ZKDatabase.java:223)
at org.apache.zookeeper.server.quorum.QuorumPeer.loadDataBase(QuorumPeer.java:601)
at org.apache.zookeeper.server.quorum.QuorumPeer.start(QuorumPeer.java:591)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.runFromConfig(QuorumPeerMain.java:164)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:111)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:78)

似乎文件夹/opt/confluent/zookeeper/data/version-2下的一些快照文件已损坏或没有权限,因为当我使用systemctl start confluent-zookeeper时,我得到了thsi错误,如果我手动启动zookeeper,我就不会有这个问题。

8oomwypt

8oomwypt1#

这是从systemd想写日志的路径是root:root,它没有权限,所以当我使用chown -R Kafka:kafka dir/to/log/path并更改权限,我的问题解决了。

相关问题