Cassandra 3.11抛出错误"在初始化期间处理提交日志时因错误而退出"

时间:2017-09-20 20:04:19

标签: cassandra cassandra-3.0

我在Mac上使用brew安装了Cassandra,它工作正常几天。但现在它开始抛出错误而不改变yaml文件中的任何内容。

Connection error: ('Unable to connect to any servers', {'127.0.0.1': error(61, "Tried connecting to [('127.0.0.1', 9042)]. Last error: Connection refused")})

所以我尝试使用brew更新Cassandra到3.11。现在,在启动Cassandra时,我收到了这个错误。

ERROR [main] 2017-09-20 12:52:02,732 JVMStabilityInspector.java:82 - Exiting due to error while processing commit log during initialization.
org.apache.cassandra.db.commitlog.CommitLogReadHandler$CommitLogReadException: Encountered bad header at position 157007 of commit log /usr/local/var/lib/cassandra/commitlog/CommitLog-6-1505888222471.log, with bad position but valid CRC
    at org.apache.cassandra.db.commitlog.CommitLogSegmentReader$SegmentIterator.computeNext(CommitLogSegmentReader.java:113) [apache-cassandra-3.11.0.jar:3.11.0]
    at org.apache.cassandra.db.commitlog.CommitLogSegmentReader$SegmentIterator.computeNext(CommitLogSegmentReader.java:84) [apache-cassandra-3.11.0.jar:3.11.0]
    at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143) [guava-18.0.jar:na]
    at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138) [guava-18.0.jar:na]
    at org.apache.cassandra.db.commitlog.CommitLogReader.readCommitLogSegment(CommitLogReader.java:190) [apache-cassandra-3.11.0.jar:3.11.0]
    at org.apache.cassandra.db.commitlog.CommitLogReader.readAllFiles(CommitLogReader.java:84) [apache-cassandra-3.11.0.jar:3.11.0]
    at org.apache.cassandra.db.commitlog.CommitLogReplayer.replayFiles(CommitLogReplayer.java:140) [apache-cassandra-3.11.0.jar:3.11.0]
    at org.apache.cassandra.db.commitlog.CommitLog.recoverFiles(CommitLog.java:177) [apache-cassandra-3.11.0.jar:3.11.0]
    at org.apache.cassandra.db.commitlog.CommitLog.recoverSegmentsOnDisk(CommitLog.java:158) [apache-cassandra-3.11.0.jar:3.11.0]
    at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:325) [apache-cassandra-3.11.0.jar:3.11.0]
    at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:600) [apache-cassandra-3.11.0.jar:3.11.0]
    at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:689) [apache-cassandra-3.11.0.jar:3.11.0]

从此链接Cassandra: Exiting due to error while processing commit log during initialization 我得到了一些关于节点工具修复的信息。但即使节点工具修复也无法正常工作。

objc[15089]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/bin/java (0x10934b4c0) and /Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x10abba4e0). One of the two will be used. Which one is undefined.
nodetool: Failed to connect to '127.0.0.1:7199' - ConnectException: 'Connection refused (Connection refused)'.

1 个答案:

答案 0 :(得分:5)

commit log /usr/local/var/lib/cassandra/commitlog/CommitLog-6-1505888222471.log

听起来你的一个提交日志文件已损坏。删除该文件,然后重新启动。

"但即使节点工具修复也无效。"

我不担心。如果您使用单个节点群集(例如:您自己的Mac),则修复没有任何其他节点来传输数据,因此无论如何都无法工作。