Foo L
Foo L

Reputation: 11137

Startup cassandra in standalone failed with FSWriteError

I'm following the tutorial on Cassandra's site for the standalone server v2.1.1. I'm trying to get it running on a vagrant instance. JDK version is java version "1.7.0_72". Even when I start up Cassandra with sudo bin/cassandra -f, I get this error:

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]

The CommitLog file is created, but the server is still stopped.

What can I do to get cassandra running?

Upvotes: 2

Views: 2256

Answers (2)

Valdis R
Valdis R

Reputation: 2115

This is a long standing bug on Virtualbox. It's an issue with memory mapped files; they aren't supported on the shared filesystem.

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

Upvotes: 2

Foo L
Foo L

Reputation: 11137

The /vagrant directory is a shared filesystem with the host (Mac OSX 10.10). The commit logs were written into a directory in this filesystem.

When I set the variable commitlog_directory in conf/cassandra.yaml to a directory that wasn't on the /vagrant shared drive, I was able to boot Cassandra.

Upvotes: 5

Related Questions