java.io.IOException: No snapshot found, but there are log entries
Posted 雅冰石
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java.io.IOException: No snapshot found, but there are log entries相关的知识,希望对你有一定的参考价值。
一 问题描述
启动zookeeper报错:
[2021-05-10 11:12:35,798] INFO zookeeper.snapshotSizeFactor = 0.33 (org.apache.zookeeper.server.ZKDatabase)
[2021-05-10 11:12:35,815] ERROR Unexpected exception, exiting abnormally (org.apache.zookeeper.server.ZooKeeperServerMain)
java.io.IOException: No snapshot found, but there are log entries. Something is broken!
……
zookeeper配置文件定义的dataDir路径是/tmp,我看根目录磁盘空间100%了,推测磁盘空间不足导致的zookeeper启动失败。
我删除了之前的几个log文件,还是报错。
二 解决办法
#迁移zookeeper的数据目录
这里从/tmp下迁移到/opt/kafka/zookeeper下
cd /opt/kafka
mkdir zookeeper
将zookeeper配置文件路径改为了/opt/kafka/zookeeper:
cd /opt/kafka/config
vi zookeeper.properties
dataDir=/opt/kafka/zookeeper
#启动zookeper
bin/zookeeper-server-start.sh config/zookeeper.properties &
#启动kafka也报错:
[2021-05-10 11:22:43,263] ERROR Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
kafka.common.InconsistentClusterIdException: The Cluster ID VLPFfY-WQkWmK7X9_C1aHQ doesn't match stored clusterId Some(0TVA9OzOTzCGMTqY50sBKA) in meta.properties. The broker is trying to join the wrong cluster. Configured zookeeper.connect may be wrong.
at kafka.server.KafkaServer.startup(KafkaServer.scala:220)
at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:44)
at kafka.Kafka$.main(Kafka.scala:84)
at kafka.Kafka.main(Kafka.scala)
解决办法:
cd /tmp/kafka-logs #kafka的Log.dirs路径
cp meta.properties meta.properties_bak
修改 meta.properties中的cluster.id值,示例:
我这里将0TVA9OzOTzCGMTqY50sBKA改成了VLPFfY-WQkWmK7X9_C1aHQ
以上是关于java.io.IOException: No snapshot found, but there are log entries的主要内容,如果未能解决你的问题,请参考以下文章
解决:java.io.IOException: No FileSystem for scheme: hdfs
java.io.IOException: No FileSystem for scheme: hdfs
java.io.IOException: No snapshot found, but there are log entries
java.io.IOException: No snapshot found, but there are log entries
GeoServer java.io.IOException: No such resource: generic.sld No such resource: generic.sld
Android的createNewFile()报错提示:java.io.IOException: No such file or directory