ZK—zookeeper无法启动,报“Unable to load database on dis”

问题描述:
部署zookeeper的服务器磁盘满了,引起服务异常,将zookeeper进程杀掉之后,重新启动zookeeper启动的时候显示成功了:

[[email protected] bin]# ./zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper-3.4.10/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED

但是zookeeper的进程和端口都没有起来。

查看zookeeper.out,发现有报错信息如下:

2018-05-07 10:33:58,556 [myid:3] - INFO  [main:[email protected]] - Reading snapshot /opt/data/zookeeper/version-2/snapshot.1900356f19
2018-05-07 10:33:58,966 [myid:3] - ERROR [main:[email protected]] - Last transaction was partial.
2018-05-07 10:33:58,968 [myid:3] - ERROR [main:[email protected]] - Unable to load database on disk
java.io.IOException: The accepted epoch, 19 is less than the current epoch, 3a
    at org.apache.zookeeper.server.quorum.QuorumPeer.loadDataBase(QuorumPeer.java:645)
    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)
2018-05-07 10:33:58,970 [myid:3] - ERROR [main:[email protected]] - Unexpected exception, exiting abnormally
java.lang.RuntimeException: Unable to run quorum server
    at org.apache.zookeeper.server.quorum.QuorumPeer.loadDataBase(QuorumPeer.java:649)
    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)
Caused by: java.io.IOException: The accepted epoch, 19 is less than the current epoch, 3a
    at org.apache.zookeeper.server.quorum.QuorumPeer.loadDataBase(QuorumPeer.java:645)
    ... 4 more
[[email protected] bin]# 

经过网上查询,得到解决方法:
将zookeeper的version-2目录备份一份,再重新创建一个新的version-2目录,然后重新启动zookeeper。

操作如下:

[[email protected] zookeeper]# ll
total 28
-rw-r--r-- 1 root root     2 Aug 30  2017 myid
drwxr-xr-x 2 root root 24576 May  7 10:36 version-2
-rw-r--r-- 1 root root     5 May  7 10:42 zookeeper_server.pid
[[email protected] zookeeper]# mv version-2 version-2.bak
[[email protected] zookeeper]# ll
total 28
-rw-r--r-- 1 root root     2 Aug 30  2017 myid
drwxr-xr-x 2 root root 24576 May  7 10:36 version-2.bak
-rw-r--r-- 1 root root     5 May  7 10:42 zookeeper_server.pid
[[email protected] zookeeper]# mkdir version-2
[[email protected] zookeeper]# ll
total 28
-rw-r--r-- 1 root root     2 Aug 30  2017 myid
drwxr-xr-x 2 root root     6 May  7 10:44 version-2
drwxr-xr-x 2 root root 24576 May  7 10:36 version-2.bak
-rw-r--r-- 1 root root     5 May  7 10:42 zookeeper_server.pid

然后重新启动zookeeper:

[[email protected] bin]# ./zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper-3.4.10/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[[email protected] bin]# netstat -tlunp|grep 2181
tcp6       0      0 :::2181                 :::*                    LISTEN      32695/java

原文地址:http://blog.51cto.com/10950710/2113493

时间: 2024-10-10 21:18:56

ZK—zookeeper无法启动,报“Unable to load database on dis”的相关文章

忘记导入struts2-xxx-plugin-x.x.x.jar导致服务器启动报Unable to load configuration.Caused by: Parent package is not defined: xxx-default

今天做的一个Struts2+MyFaces(JSF)+Spring的应用,为了使用JSF,我的struts.xml中使用了如下代码 <package name="jsf" extends="jsf-default"> <interceptors> <interceptor-stack name="jsfFullStack"> <interceptor-ref name="params"

xvfb启动PyQt4程序报Unable to load library icui18n错误

xvfb启动PyQt4程序报如下错误: Unable to load library icui18n "Cannot load library icui18n: (libicui18n.so.48: cannot open shared object file: No such file or directory)" 解决方法: sudo apt-get install libicu48 参考:https://forums.virtualbox.org/viewtopic.php?f=

zabbix启动报错:Connection to database &#39;xxx&#39; failed解决方法

Zabbix 分布式系统监视系统 zabbix是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案. zabbix能监视各种网络参数,保证服务器系统的安全运营:并提供灵活的通知机制以让系统管理员快速定位/解决存在的各种问题. 本文讲解的是zabbix无法启动报错:Connection to database 'xxx' failed: [1045] Access denied for user 'xxx'@'localhost' (using password: NO)

项目启动报Unable to acquire AES algorithm.

Spring boot项目启动时报 Unable to acquire AES algorithm. This is required to function. JDK版本:1.8.0-231 工具:Eclipse 原因:JDK路径配置错误 解决方案:重新配置JDK路径,如下图: 原文地址:https://blog.51cto.com/51coding/2466491

zookeeper无法启动&quot;Unable to load database on disk&quot;

自己的虚拟机集群,一次强制关机后,发现slave2的zookeeper起不来了 http://blog.csdn.net/ashic/article/details/47088299 下午5点29:53.411 INFO org.apache.zookeeper.server.quorum.QuorumPeerConfig Reading configuration from: /var/run/cloudera-scm-agent/process/517-zookeeper-server/zo

spark 启动时候报 Unable to load native-hadoop library for your platform 警告

hadoop2.6.4 jdk1.8 spark2.0.1 方案1: 在spark的conf目录下,修改spark-env.sh文件加入LD_LIBRARY_PATH环境变量,值为hadoop的native库的路径 方案2: 在 /etc/profile 设置一下 export LD_LIBRARY_PATH=/usr/local/hadoop/lib/native

Apache2.4为什么启动报错Cannot load php5apache2_4.dll into server

最近学习php,按照书上的描述,下载好apache和php后,按照其中配置进行,结果遇到了上述问题.花费了近一个半小时的时间解决了上述问题.现把解决问题过程中看到的方法总结如下.  最先肯定是一定要注意版本问题,apache和php要保证都是64位或者x86版本的,这个有时候容易忽略. 一.首先,当前在apache和php上下载的最新版本的软件多数已经是绿色版的.因此在安装的时候,不能按照一般的下一步方法.而需要如下的方法 步骤一 Cmd打开命令行窗口,切换到apache安装目录下 cd  C:

solr 启动报错Cannot load analyzer: org.wltea.analyzer.lucene.IKAnalyzer

schema.xml 配置文件信息: <field name="title" type="text_ik" indexed="true" stored="true" multiValued="true"/> <field name="describe" type="text_ik" indexed="true" stored=&q

mycat启动报Unable to start JVM: No such file or directory (2)【转】

mycat启动失败,查看日志 /mycat/logs/wrapper.log发现如下信息 1  STATUS | wrapper  | 2017/11/22 16:15:17 | --> Wrapper Started as Daemon      2  STATUS | wrapper  | 2017/11/22 16:15:17 | Launching a JVM...      3  ERROR  | wrapper  | 2017/11/22 16:15:17 | Unable to s