使用JanusGraph和Solr

时间:2017-10-03 13:20:13

标签: solr janusgraph

设置JanusGraph我在控制台中注意到以下内容:

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.

然后我看到以下内容:

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

如何停止使用elasticsearch并切换到Solr?

我的属性文件如下:

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

1 个答案:

答案 0 :(得分:3)

这个答案基本上与泰坦的this one相同。 JanusGraph是从泰坦分手的。

您可能正在尝试连接到先前已配置为使用Elasticsearch的现有图表。默认情况下,键空间名为janusgraph

1)您可以通过更新conf/janusgraph-cassandra.properties

连接到不同的密钥空间
gremlin.graph=org.janusgraph.core.JanusGraphFactory
storage.backend=cassandrathrift
storage.hostname=127.0.0.1
storage.cassandra.keyspace=mygraph

2)您可以删除现有的密钥空间。如果您从快速入门指示(启动单个节点Cassandra和单个节点Elasticsearch)使用bin/janusgraph.sh start

bin/janusgraph.sh clean

或者如果你有一个独立的Cassandra安装:

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

然后您就可以使用默认的conf/janusgraph-cassandra.properties连接。