Problem Description:
Deployment Zookeeper server disk is full, causing the service exception, after the zookeeper process is killed, restart the zookeeper when the boot is displayed successfully:
[[email protected] bin]# ./zkServer.sh startZooKeeper JMX enabled by defaultUsing config: /usr/local/zookeeper-3.4.10/bin/../conf/zoo.cfgStarting zookeeper ... STARTED
But the zookeeper process and port are not up.
View Zookeeper.out, found the error message is as follows:
2018-05-07 10:33:58,556 [Myid:3]-INFO [main:[email protected]]-Reading snapshot/opt/data/zookeeper/version-2/ Snapshot.1900356f192018-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 Diskjava.io.IOExcepti On:the accepted epoch, than the current epoch, 3a at Org.apache.zookeeper.server.quorum.QuorumPeer.loadData Base (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 Abnormallyjava.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, than the current epoch, 3a at Org.apache.zookeeper.server.quorum.QuorumPeer.loadDataBase (Quo rumpeer.java:645) ... 4 More[[email protected] bin]#
After online query, get the solution:
Back up a copy of the Zookeeper Version-2 directory, recreate a new version-2 directory, and then restart zookeeper.
The operation is as follows:
[[email protected] zookeeper]# lltotal 28-rw-r--r-- 1 root root 2 Aug 30 2017 myiddrwxr-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]# lltotal 28-rw-r--r-- 1 root root 2 Aug 30 2017 myiddrwxr-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]# lltotal 28-rw-r--r-- 1 root root 2 Aug 30 2017 myiddrwxr-xr-x 2 root root 6 May 7 10:44 version-2drwxr-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
Then restart Zookeeper:
[[email protected] bin]# ./zkServer.sh startZooKeeper JMX enabled by defaultUsing config: /usr/local/zookeeper-3.4.10/bin/../conf/zoo.cfgStarting zookeeper ... STARTED[[email protected] bin]# netstat -tlunp|grep 2181tcp6 0 0 :::2181 :::* LISTEN 32695/java
Zk-zookeeper Unable to start, reported "Unable to load database on dis"