独立启动cassandra因FSWriteError而失败

时间:2014-11-11 01:53:49

标签: java cassandra cassandra-2.0

我正在关注独立服务器v2.1.1的Cassandra网站上的教程。我试图让它在一个流浪的实例上运行。 JDK版本为java version "1.7.0_72"。即使我用sudo bin/cassandra -f启动Cassandra,我也会收到此错误:

DEBUG 22:14:34 Creating new commit log segment /vagrant/apache-cassandra-2.1.1/out/commitlog/CommitLog-4-1415657674222.log
ERROR 22:14:34 Failed managing commit log segments. Commit disk failure policy is stop; terminating thread
org.apache.cassandra.io.FSWriteError: java.io.IOException: Invalid argument
at org.apache.cassandra.db.commitlog.CommitLogSegment.<init>(CommitLogSegment.java:177) ~[apache-cassandra-2.1.1.jar:2.1.1]
at org.apache.cassandra.db.commitlog.CommitLogSegment.freshSegment(CommitLogSegment.java:119) ~[apache-cassandra-2.1.1.jar:2.1.1]
at org.apache.cassandra.db.commitlog.CommitLogSegmentManager$1.runMayThrow(CommitLogSegmentManager.java:119) ~[apache-cassandra-2.1.1.jar:2.1.1]
at org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28) [apache-cassandra-2.1.1.jar:2.1.1]
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_72]
Caused by: java.io.IOException: Invalid argument
at sun.nio.ch.FileChannelImpl.map0(Native Method) ~[na:1.7.0_72]
at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:874) ~[na:1.7.0_72]
at org.apache.cassandra.db.commitlog.CommitLogSegment.<init>(CommitLogSegment.java:166) ~[apache-cassandra-2.1.1.jar:2.1.1]

创建了CommitLog文件,但服务器仍然停止。

我可以做些什么来让cassandra运行?

2 个答案:

答案 0 :(得分:5)

/vagrant目录是与主机(Mac OSX 10.10)的共享文件系统。提交日志被写入此文件系统的目录中。

当我将commitlog_directory中的变量conf/cassandra.yaml设置为不在/ vagrant共享驱动器上的目录时,我能够启动Cassandra。

答案 1 :(得分:2)

这是Virtualbox上的一个长期存在的错误。这是内存映射文件的问题;共享文件系统不支持它们。

https://www.virtualbox.org/ticket/819