我已按照单节点入门说明进行操作,它在 cassandra-0.7beta2 中运行良好。但是当尝试对 cassandra-0.7rc1 执行相同操作时,它会输出以下堆栈跟踪:
INFO 20:21:37,771 Starting up server gossip INFO 20:21:37,786 switching in a fresh Memtable for LocationInfo at CommitLogContext(file='/var/lib /cassandra/commitlog\CommitLog-1290885697489.log', position=700) INFO 20:21:37,786 Enqueuing flush of Memtable-LocationInfo@29247351(227 bytes, 4 operations) INFO 20:21:37,786 Writing Memtable-LocationInfo@29247351(227 bytes, 4 operations) ERROR 20:21:38,161 Fatal exception in thread Thread[FlushWriter:1,5,main] java.io.IOError: java.io.IOException: rename failed of D:\var\lib\cassandra\data\system\LocationInfo-e-1-Data.db at org.apache.cassandra.io.sstable.SSTableWriter.rename(SSTableWriter.java:214) at org.apache.cassandra.io.sstable.SSTableWriter.closeAndOpenReader(SSTableWriter.java:184) at org.apache.cassandra.io.sstable.SSTableWriter.closeAndOpenReader(SSTableWriter.java:167) at org.apache.cassandra.db.Memtable.writeSortedContents(Memtable.java:161) at org.apache.cassandra.db.Memtable.access$000(Memtable.java:49) at org.apache.cassandra.db.Memtable$1.runMayThrow(Memtable.java:174) at org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:30) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.io.IOException: rename failed of D:\var\lib\cassandra\data\system\LocationInfo-e-1-Data.db at org.apache.cassandra.utils.FBUtilities.renameWithConfirm(FBUtilities.java:359) at org.apache.cassandra.io.sstable.SSTableWriter.rename(SSTableWriter.java:210) ... 12 more
Someone posted this problem on cassandra's mailing list. It seems there's a problem, when trying to rename the tmp files (e.g. LocationInfo-tmp-e-1-Data.db). It happens in FBUtilities.java:
public static void renameWithConfirm(String tmpFilename, String filename) throws IOException
{
if (!new File(tmpFilename).renameTo(new File(filename)))
{
throw new IOException("rename failed of " + filename);
}
}
我应该注意到 File.renameTo() 在 Windows 上工作起来很有趣。
无论如何...帮忙?
最佳答案
关于java - cassandra.bat 在 0.7rc1 中抛出 java.io.IOException : rename failed of LocationInfo-e -1-Data. db,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4293610/