簡體   English   中英

Cassandra和Titan Graph連接失敗

[英]Cassandra and Titan Graph connection failed

我使用的是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)

為什么?

這個錯誤讓我覺得你沒有下載Titan的正確包裝。 如果你沒有下載這個titan-all-0.4.2.zip,也許你應該嘗試一下。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM