欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

JanusGraph

程序员文章站 2024-01-19 13:05:40
...

Setting up JanusGraph i noticed the following in the console:

09:04:12,175  INFO ReflectiveConfigOptionLoader:173 - Loaded and initialized config classes: 10 OK out of 12 attempts in PT0.023S
09:04:12,230  INFO Reflections:224 - Reflections took 28 ms to scan 1 urls, producing 2 keys and 2 values 
09:04:12,291  WARN GraphDatabaseConfiguration:1445 - Local setting index.search.index-name=entity (Type: GLOBAL_OFFLINE) is overridden by globally managed value (janusgraph).  Use the ManagementSystem interface instead of the local configuration to control this setting.
09:04:12,294  WARN GraphDatabaseConfiguration:1445 - Local setting index.search.backend=solr (Type: GLOBAL_OFFLINE) is overridden by globally managed value (elasticsearch).  Use the ManagementSystem interface instead of the local configuration to control this setting.
09:04:12,300  INFO CassandraThriftStoreManager:628 - Closed Thrift connection pooler.

and then i see the following:

Exception in thread "main" java.lang.IllegalArgumentException: Could not instantiate implementation: org.janusgraph.diskstorage.es.ElasticSearchIndex

How do i stop using elasticsearch and switch to Solr?

My properties file is as follows:

index.search.backend=solr
index.search.directory=/path/to/directory/for/solr/index/something
index.search.index-name=something
index.search.solr.mode=http
index.search.solr.http-urls=http://127.0.0.1:8983/solr
storage.backend=cassandrathrift

storage.hostname=127.0.0.1
cache.db-cache = true

cache.db-cache-clean-wait = 20

cache.db-cache-time = 180000

cache.db-cache-size = 0.25

solr janusgraph

shareimprove this question

asked Oct 3 '17 at 13:20

JanusGraph

BigBug

3,2151717 gold badges7171 silver badges120120 bronze badges

  • Once a GLOBAL_OFFLINE property is set and the janusgraph cluster is initialized, any changes to those properties will never take effect in that cluster, even if the cluster were to be restarted. So even if you change index backend to solr, it will not take effect, so you have to clear the existing data and restart the janusgraph – Ashraful Islam Oct 3 '17 at 18:48 

  • currently there is no data. i see nothing in my solr.... :( which data am i supposed to delete? – BigBug Oct 3 '17 at 21:31

  • 1

    JanusGraph store config in your storage backend in your case cassandra. you need to clear cassandra data – Ashraful Islam Oct 4 '17 at 4:03

add a comment

1 Answer

activeoldestvotes

3

 

The answer to this basically the same as this one for Titan. JanusGraph was forked from Titan.

You are probably trying to connect to an existing graph that was previously configured to use Elasticsearch. By default, the keyspace is named janusgraph.

1) You could connect to a different keyspace by updating conf/janusgraph-cassandra.properties

gremlin.graph=org.janusgraph.core.JanusGraphFactory
storage.backend=cassandrathrift
storage.hostname=127.0.0.1
storage.cassandra.keyspace=mygraph

2) You could drop the existing keyspace. If you used bin/janusgraph.sh start from the quick start directions (which starts a single node Cassandra and a single node Elasticsearch),

bin/janusgraph.sh clean

Or if you have a standalone Cassandra installation:

$CASSANDRA_HOME/bin/cqlsh -e 'drop keyspace if exists janusgraph'

Then you would be able to connect with the default conf/janusgraph-cassandra.properties.