卡桑德拉 2.1.3。如何提取 CommitLog
Cassandra 2.1.3. How to extract CommitLog
请帮助解决我的问题。我使用 Ubuntu 14.04,Java 8,Cassandra 2.1.3。对不起,我是初学者。我如何从目录中提取和反序列化 commitLog:/var/lib/cassandra/commitlog?
据我了解,我们可以将 lib 用于 Maven cassandra-all,方法 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 你可以重复使用很多)。
请帮助解决我的问题。我使用 Ubuntu 14.04,Java 8,Cassandra 2.1.3。对不起,我是初学者。我如何从目录中提取和反序列化 commitLog:/var/lib/cassandra/commitlog? 据我了解,我们可以将 lib 用于 Maven cassandra-all,方法 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 你可以重复使用很多)。