Apache Cassandra Failure on startup: FSWriteError (...)不允许该操作
我设置了一个具有两个节点的小型Cassandra集群,用于测试目的。在第二个节点上启动Cassandra时,我得到这个异常:
INFO [main] 2014-11-05 11:49:10,253 AutoSavingCache.java:123 - reading saved cache /var/lib/cassandra/saved_caches/system-local-7ad54392bcdd35a684174e047860b377-KeyCache-b.db
ERROR [main] 2014-11-05 11:49:10,855 CassandraDaemon.java:460 - Exception encountered during startup
org.apache.cassandra.io.FSWriteError: java.nio.file.FileSystemException: /var/lib/cassandra/data/system/compactions_in_progress-55080ab05d9c388690a4acb25fe1f77b/snapshots/1415184550829-compactions_in_progress/system-compactions_in_progress-ka-2-Summary.db -> /var/lib/cassandra/data/system/compactions_in_progress-55080ab05d9c388690a4acb25fe1f77b/system-compactions_in_progress-ka-2-Summary.db: Die Operation ist nicht erlaubt
at org.apache.cassandra.io.util.FileUtils.createHardLink(FileUtils.java:98) ~[apache-cassandra-2.1.1.jar:2.1.1]
at org.apache.cassandra.io.sstable.SSTableReader.createLinks(SSTableReader.java:1728) ~[apache-cassandra-2.1.1.jar:2.1.1]
at org.apache.cassandra.db.ColumnFamilyStore.snapshotWithoutFlush(ColumnFamilyStore.java:2158) ~[apache-cassandra-2.1.1.jar:2.1.1]
at org.apache.cassandra.db.ColumnFamilyStore.snapshot(ColumnFamilyStore.java:2215) ~[apache-cassandra-2.1.1.jar:2.1.1]
at org.apache.cassandra.db.ColumnFamilyStore.snapshot(ColumnFamilyStore.java:2209) ~[apache-cassandra-2.1.1.jar:2.1.1]
at org.apache.cassandra.db.ColumnFamilyStore$10.run(ColumnFamilyStore.java:2449) ~[apache-cassandra-2.1.1.jar:2.1.1]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) ~[na:1.7.0_65]
at org.apache.cassandra.db.ColumnFamilyStore.runWithCompactionsDisabled(ColumnFamilyStore.java:2515) ~[apache-cassandra-2.1.1.jar:2.1.1]
at org.apache.cassandra.db.ColumnFamilyStore.truncateBlocking(ColumnFamilyStore.java:2462) ~[apache-cassandra-2.1.1.jar:2.1.1]
at org.apache.cassandra.db.SystemKeyspace.discardCompactionsInProgress(SystemKeyspace.java:267) ~[apache-cassandra-2.1.1.jar:2.1.1]
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:234) [apache-cassandra-2.1.1.jar:2.1.1]
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:443) [apache-cassandra-2.1.1.jar:2.1.1]
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:532) [apache-cassandra-2.1.1.jar:2.1.1]
Caused by: java.nio.file.FileSystemException: /var/lib/cassandra/data/system/compactions_in_progress-55080ab05d9c388690a4acb25fe1f77b/snapshots/1415184550829-compactions_in_progress/system-compactions_in_progress-ka-2-Summary.db -> /var/lib/cassandra/data/system/compactions_in_progress-55080ab05d9c388690a4acb25fe1f77b/system-compactions_in_progress-ka-2-Summary.db: Die Operation ist nicht erlaubt
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91) ~[na:1.7.0_65]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[na:1.7.0_65]
at sun.nio.fs.UnixFileSystemProvider.createLink(UnixFileSystemProvider.java:475) ~[na:1.7.0_65]
at java.nio.file.Files.createLink(Files.java:1039) ~[na:1.7.0_65]
at org.apache.cassandra.io.util.FileUtils.createHardLink(FileUtils.java:94) ~[apache-cassandra-2.1.1.jar:2.1.1]
... 12 common frames omitted
我知道通过删除/var/lib/cassandra/data/中的键空间,异常不再被抛出,Cassandra启动。但必须有一个更清洁的解决方案。