zookeeper: ERROR java.io.EOFException Last transaction was partial.

При запуске zookeeper завершается с ошибкой "ERROR Last transaction was partial."

zookeeper

Данное поведение связано с тем что была повреждена последняя транзакция, по причине не корректного завершения работы сервера или сервиса, закончилось дисковое пространство..

Решение

Необходимо полностью очистить директорию данных zookeeper (/data_dir/version-2/) и перезапустить его.

В некоторых случаях может помочь удаление последней транзации, файла log и файла snapshot

Полный текст ошибки

[2022-02-14 12:36:46,193] INFO Reading snapshot /data_dir/version-2/snapshot.146 (org.apache.zookeeper.server.persistence.FileSnap)
[2022-02-14 12:36:46,206] ERROR Last transaction was partial. (org.apache.zookeeper.server.persistence.Util)
[2022-02-14 12:36:46,216] ERROR Last transaction was partial. (org.apache.zookeeper.server.persistence.Util)
[2022-02-14 12:36:46,217] ERROR Unexpected exception, exiting abnormally (org.apache.zookeeper.server.ZooKeeperServerMain)
java.io.EOFException
at java.base/java.io.DataInputStream.readInt(DataInputStream.java:397)
at org.apache.jute.BinaryInputArchive.readInt(BinaryInputArchive.java:84)
at org.apache.zookeeper.server.persistence.FileHeader.deserialize(FileHeader.java:67)
at org.apache.zookeeper.server.persistence.FileTxnLog$FileTxnIterator.inStreamCreated(FileTxnLog.java:640)
at org.apache.zookeeper.server.persistence.FileTxnLog$FileTxnIterator.createInputArchive(FileTxnLog.java:659)
at org.apache.zookeeper.server.persistence.FileTxnLog$FileTxnIterator.goToNextLog(FileTxnLog.java:625)
at org.apache.zookeeper.server.persistence.FileTxnLog$FileTxnIterator.next(FileTxnLog.java:705)
at org.apache.zookeeper.server.persistence.FileTxnSnapLog.fastForwardFromEdits(FileTxnSnapLog.java:294)
at org.apache.zookeeper.server.persistence.FileTxnSnapLog.lambda$restore$0(FileTxnSnapLog.java:229)
at org.apache.zookeeper.server.persistence.FileTxnSnapLog.restore(FileTxnSnapLog.java:253)
at org.apache.zookeeper.server.ZKDatabase.loadDataBase(ZKDatabase.java:240)
at org.apache.zookeeper.server.ZooKeeperServer.loadData(ZooKeeperServer.java:290)
at org.apache.zookeeper.server.ZooKeeperServer.startdata(ZooKeeperServer.java:450)
at org.apache.zookeeper.server.NIOServerCnxnFactory.startup(NIOServerCnxnFactory.java:764)
at org.apache.zookeeper.server.ServerCnxnFactory.startup(ServerCnxnFactory.java:98)
at org.apache.zookeeper.server.ZooKeeperServerMain.runFromConfig(ZooKeeperServerMain.java:144)
at org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:106)
at org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:64)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:128)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:82)
systemd[1]: zookeeper.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: zookeeper.service: Failed with result 'exit-code'./* Your code... */

 

Добавить комментарий