Cassandra和Titan图连接失败

3

我正在使用 DataStax Community Server 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)

为什么?

1个回答

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

我下载了titan-server-0.4.2并在Ubuntu上编译。 - Manish Kumar
2
Titan Server是一个预打包的系统,它在两个不同的JVM中运行Rexster和Cassandra。也就是说,我希望所有的Cassandra库都存在,这样你就可以像你试图引用它一样使用它。这让我想知道是否有什么东西没有正确地“编译”,尽管我不确定为什么你需要编译任何东西,因为下载zip已经构建好并准备好了一切。我建议下载我提到的预编译版本(或预打包的Titan Server zip)并尝试使用它。 - stephen mallette
如果我使用titan-all,它会显示与Cassandra不兼容的版本。我已经尝试过DataStax Community Server 1.2.13和1.2.8。 - Manish Kumar
2
听起来你的Java代码项目可能存在依赖问题?我看到你也在邮件列表中发布了你的问题。我认为Daniel是正确的。你需要仔细检查你的项目依赖...是否有缺失?你的项目是基于Maven的吗? - stephen mallette
1
完成了...我的应用程序缺少titan-cassandratitan-all的JAR包。 - Manish Kumar
显示剩余4条评论

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接