记一次zookeeper启动异常:Snapshot directory has log files. Check if dataLogDir and dataDir configuration is

记一次zookeeper启动异常:org.apache.zookeeper.server.persistence.FileTxnSnapLog$SnapDirContentCheckException:Snapshot directory has log files. Check if dataLogDir and dataDir configuration is correct.

今天启动zookeeper时:
记一次zookeeper启动异常:Snapshot directory has log files. Check if dataLogDir and dataDir configuration is_第1张图片
记一次zookeeper启动异常:Snapshot directory has log files. Check if dataLogDir and dataDir configuration is_第2张图片
本以为一切正常,然鹅…当我查看jps时发现,空空如也:
空空如也
啥也别说了,查看日志

[vera@hadoop000 zoo1]$ cat zookeeper.out

记一次zookeeper启动异常:Snapshot directory has log files. Check if dataLogDir and dataDir configuration is_第3张图片
记一次zookeeper启动异常:Snapshot directory has log files. Check if dataLogDir and dataDir configuration is_第4张图片
报错信息如下:
org.apache.zookeeper.server.persistence.FileTxnSnapLog$SnapDirContentCheckException: Snapshot directory has log files. Check if dataLogDir and dataDir configuration is correct.
经过一番Baidu和Google之后发现,删除zookeeper配置中zoo1/version-2, zoo2/version-2和zoo3/version-2即可
(首先关闭上次启动失败的zookeeper,即使启动失败了也要关闭一遍)再次启动zookeeper并且jps:
记一次zookeeper启动异常:Snapshot directory has log files. Check if dataLogDir and dataDir configuration is_第5张图片
启动成功!

总结:应该是zookeeper的同步出现了问题,删掉version-2之后,问题得以解决。如果大家不放心,可以先把version-2改个名字,待问题解决,启动成功后再彻底删除。

你可能感兴趣的:(大数据#Hadoop)