【问题标题】:Cassandra and Titan Graph connection failedCassandra 和 Titan Graph 连接失败
【发布时间】:2014-02-25 04:07:30
【问题描述】:

我正在使用 datastax 社区服务器 1.2.13Titan 0.4.2。如果我使用以下命令

gremlin> g = TitanFactory.open('conf/titan-cassandra-es.properties')
==>titangraph[cassandrathrift:127.0.0.1]

它没有显示任何错误,但是当我在我的 java 代码中使用以下内容时:

Configuration conf = new BaseConfiguration();
conf.setProperty("storage.backend","cassandra");
conf.setProperty("storage.hostname","127.0.0.1");
conf.setProperty("storage.port","9160");
TitanGraph g = TitanFactory.open(conf);

它显示以下异常:

Exception in thread "main" java.lang.IllegalArgumentException: Could not find implementation class: com.thinkaurelius.titan.diskstorage.cassandra.astyanax.AstyanaxStoreManager
    at com.thinkaurelius.titan.diskstorage.Backend.instantiate(Backend.java:347)
    at com.thinkaurelius.titan.diskstorage.Backend.getImplementationClass(Backend.java:367)
    at com.thinkaurelius.titan.diskstorage.Backend.getStorageManager(Backend.java:311)
    at com.thinkaurelius.titan.diskstorage.Backend.<init>(Backend.java:121)
    at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.getBackend(GraphDatabaseConfiguration.java:1163)
    at com.thinkaurelius.titan.graphdb.database.StandardTitanGraph.<init>(StandardTitanGraph.java:75)
    at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:40)
    at newpackage.TitanTest.main(TitanTest.java:24)

如果我使用conf.setProperty("storage.backend","cassandrathrift");

它显示:

Exception in thread "main" java.lang.IllegalArgumentException: Could not find implementation class: com.thinkaurelius.titan.diskstorage.cassandra.thrift.CassandraThriftStoreManager
    at com.thinkaurelius.titan.diskstorage.Backend.instantiate(Backend.java:347)
    at com.thinkaurelius.titan.diskstorage.Backend.getImplementationClass(Backend.java:367)
    at com.thinkaurelius.titan.diskstorage.Backend.getStorageManager(Backend.java:311)
    at com.thinkaurelius.titan.diskstorage.Backend.<init>(Backend.java:121)
    at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.getBackend(GraphDatabaseConfiguration.java:1163)
    at com.thinkaurelius.titan.graphdb.database.StandardTitanGraph.<init>(StandardTitanGraph.java:75)
    at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:40)
    at newpackage.TitanTest.main(TitanTest.java:24)

为什么?

【问题讨论】:

    标签: cassandra gremlin titan


    【解决方案1】:

    这个错误让我觉得你没有下载正确的 Titan 包装。如果你没有下载这个titan-all-0.4.2.zip也许你应该试试。

    【讨论】:

    • 我下载了titan-server-0.4.2并在ubantu编译
    • Titan Server 是一个预打包的系统,在两个不同的 JVM 中运行 Rexster 和 Cassandra。也就是说,我希望所有 Cassandra 库都存在,以便您可以按照尝试引用它的方式使用它。这让我想知道是否有些东西没有正确“编译”,尽管我不确定为什么你需要编译任何东西,因为下载 zip 已经构建好了所有东西并准备好了。我建议下载我引用的预编译版本(或预打包的 Titan Server zip)并尝试一下。
    • 如果我使用titan-all,它说我使用datastax社区服务器1.2.13,1.2.8尝试过的cassandra版本不兼容。
    • 听起来您的项目对 java 代码有依赖性问题?我看到你也在邮件列表中发布了你的问题。我认为丹尼尔是正确的。您需要仔细检查您的项目的依赖项...缺少什么?你的项目是基于 maven 的吗?
    • 完成...我的应用程序中缺少 titan-cassandratitan-all jars
    猜你喜欢
    • 2017-06-06
    • 1970-01-01
    • 1970-01-01
    • 2015-01-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-13
    相关资源
    最近更新 更多