有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java Cassandra 2.1.3。如何提取CommitLog

请帮我解决问题。我使用Ubuntu 14.04、Java 8、Cassandra 2.1.3。对不起,我是初学者。如何从dir:/var/lib/cassandra/commitLog中提取并反序列化commitLog? 据我所知,我们可能会对Maven cassandra all使用lib,其中是method 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.

别帮我

我怎么了


共 (1) 个答案

  1. # 1 楼答案

    使用setClientMode(true),除非您自己创建cfmetadata,否则不会有反序列化数据的上下文。即便如此,这也是一个非常重要的项目,因为突变的应用与C*紧密耦合。也就是说,这并非不可能,但您将无法使用CommitLogReplayer,因为它试图应用突变。这是一个很好的开始编写自己的代码的地方(直到CommitteLogReplayer.replayMutation,你可以重用很多)