How to recover Zookeeper from java.io.EOFException after a server crash?

后端 未结 3 909
情深已故
情深已故 2020-12-10 04:30

How to recover from the following error that started happening after a server crash? Zookeeper won’t start and the following message is showing repeatedly on the log.

3条回答
  •  春和景丽
    2020-12-10 05:05

    The solution for me was to find the last log file (which had 0 byte length)

    You will find this inside the version-2 directory

    ls -l -r --sort=time
    
    -rw-r--r-- 1 chris chris  67108880 Jan 24 10:37 log.23c6a70
    -rw-r--r-- 1 chris chris         0 Jan 24 10:37 log.23d3fb4
    

    I've tried first to delete the snapshot and the last 2 logfiles which is also working but then you would have version which is "a bit" older.

    -rw-r--r-- 1 chris chris  3685904 Jan 24 00:56 snapshot.23c6a6e
    

    Maybe you have to delete the last snapshot file and the last logfile together and the 0 length logfile to be safe.

    btw. Logfile and snapshot have the same HEX pattern which have to match

    log.23c6a70

    snapshot.23c6a6e

    They have to match and be consistent and you should have this problem fixed.

提交回复
热议问题