简体   繁体   中英

Cassandra and Titan Graph connection failed

I am using datastax community server 1.2.13 and Titan 0.4.2 . If I use following command

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

Its not showing any error but when I use following in my java code:

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);

It show following exception:

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)

If i use conf.setProperty("storage.backend","cassandrathrift");

It show :

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)

Why?

The error makes me think you haven't downloaded the correct packaging of Titan. If you didn't download this one titan-all-0.4.2.zip perhaps you should try that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM