请帮助解决我的问题。我使用 Ubuntu 14.04、Java 8、Cassandra 2.1.3。抱歉我是初学者。如何从目录/var/lib/cassandra/commitlog 中提取并反序列化 commitLog? 据我了解,我们可以使用 Maven cassandra-all 的 lib,CommitLogReplayer.recover 方法在哪里?如果我开始恢复commitLog,例如:
CommitLogReplayer.recover(new File("/var/lib/cassandra/commitlog/CommitLog-4-1453270991708.log"));
我遇到异常:
Expecting URI in variable: [cassandra.config]. Please prefix the file with file:/// for local files or file://<server>/ for remote files. Aborting. If you are executing this from an external tool, it needs to set Config.setClientMode(true) to avoid loading configuration.
Fatal configuration error; unable to start. See log for stacktrace.
Config.setClientMode(true);
- 没有帮助我。
我错了什么?
最佳答案
使用 setClientMode(true),除非您自己执行某些操作来创建 cfmetadata,否则将没有上下文来反序列化数据。即使如此,这也是一个相当重要的项目,因为突变的应用与 C* 紧密耦合。也就是说,这并非不可能,但您将无法使用 CommitLogReplayer,因为它会尝试应用突变。不过,这是一个开始编写自己的好地方(直到 CommitLogReplayer.replayMutation 为止,您可以重复使用很多)。
关于java - Cassandra 2.1.3。如何提取CommitLog,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34904660/