输入命令:
sudo service zookeeper start
没有产生错误。
sudo service zookeeper status
产生以下结果:
● zookeeper.service - Coordination service for distributed applications Loaded: loaded (/lib/systemd/system/zookeeper.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Tue
2018-07-24 05:56:22 UTC; 11min ago Process: 14003 ExecStart=/usr/bin/java -cp ${CLASSPATH} $JAVA_OPTS
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=${JMXLOCALONLY} -Dzookeeper.log.dir=${ZOO_LOG_DIR} -Dzookeeper Main PID: 14003 (code=exited, status=1/FAILURE)
Jul 24 05:56:22 woodward-testing systemd[1]: zookeeper.service: Unit entered failed state.
Jul 24 05:56:22 woodward-testing systemd[1]: zookeeper.service: Failed with result 'exit-code'.
Jul 24 05:56:22 woodward-testing systemd[1]: zookeeper.service: Service hold-off time over, scheduling restart.
Jul 24 05:56:22 woodward-testing systemd[1]: Stopped Coordination service for distributed applications.
Jul 24 05:56:22 woodward-testing systemd[1]: zookeeper.service: Start request repeated too quickly.
Jul 24 05:56:22 woodward-testing systemd[1]: Failed to start Coordination service for distributed applications.
Jul 24 05:56:22 woodward-testing systemd[1]: zookeeper.service: Unit entered failed state.
Jul 24 05:56:22 woodward-testing systemd[1]: zookeeper.service: Failed with result 'exit-code'.
要成功启动Zookeeper,我应该怎么做?阅读日志或其他内容?
从Zookeeper日志中读取,我在启动时发现了这一点:
2018-07-24 06:15:59,733 - ERROR [main:ZooKeeperServerMain@64] - Unexpected exception, exiting abnormally
java.io.EOFException
at java.io.DataInputStream.readInt(DataInputStream.java:392)
at org.apache.jute.BinaryInputArchive.readInt(BinaryInputArchive.java:63)
at org.apache.zookeeper.server.persistence.FileHeader.deserialize(FileHeader.java:64)
at org.apache.zookeeper.server.persistence.FileTxnLog$FileTxnIterator.inStreamCreated(FileTxnLog.java:585)
at org.apache.zookeeper.server.persistence.FileTxnLog$FileTxnIterator.createInputArchive(FileTxnLog.java:604)
at org.apache.zookeeper.server.persistence.FileTxnLog$FileTxnIterator.goToNextLog(FileTxnLog.java:570)
at org.apache.zookeeper.server.persistence.FileTxnLog$FileTxnIterator.next(FileTxnLog.java:652)
at org.apache.zookeeper.server.persistence.FileTxnSnapLog.restore(FileTxnSnapLog.java:158)
at org.apache.zookeeper.server.ZKDatabase.loadDataBase(ZKDatabase.java:223)
at org.apache.zookeeper.server.ZooKeeperServer.loadData(ZooKeeperServer.java:283)
at org.apache.zookeeper.server.ZooKeeperServer.startdata(ZooKeeperServer.java:410)
at org.apache.zookeeper.server.NIOServerCnxnFactory.startup(NIOServerCnxnFactory.java:118)
at org.apache.zookeeper.server.ZooKeeperServerMain.runFromConfig(ZooKeeperServerMain.java:119)
at org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:87)
at org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:53)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:116)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:78)