问题
I am new to titan. I want to use titan with cassandra database. But when I start the gremlin server and try to load a graph using command -
graph = TitanFactory.open("conf/titan-cassandra.properties")
it gives me the following error -
Could not instantiate implementation: com.thinkaurelius.titan.diskstorage.es.ElasticSearchIndex
I dont want to use elastic search. Can anyone help.
回答1:
You are probably trying to connect to an existing graph that was previously configured to use Elasticsearch. By default, the keyspace is named titan
.
1) You could connect to a different keyspace by updating conf/titan-cassandra.properties
gremlin.graph=com.thinkaurelius.titan.core.TitanFactory
storage.backend=cassandrathrift
storage.hostname=127.0.0.1
storage.cassandra.keyspace=mygraph
2) You could drop the existing keyspace. If you used bin/titan.sh start
from the quick start directions (which starts a single node Cassandra and a single node Elasticsearch),
cd $TITAN_HOME
bin/titan.sh stop
rm -rf db/* logs/*
bin/titan.sh start
Or if you have a standalone Cassandra installation:
cd $CASSANDRA_HOME
bin/cqlsh -e 'drop keyspace if exists titan'
Then you would be able to connect with the default conf/titan-cassandra.properties
.
来源:https://stackoverflow.com/questions/45187554/connecting-to-cassandra-with-titan