使用JanusGraph和Solr

3

在设置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

一旦设置了GLOBAL_OFFLINE属性并初始化了janusgraph集群,即使该集群重新启动,那些属性的任何更改也将永远不会在该集群中生效。因此,即使您将索引后端更改为solr,它也不会生效,因此您必须清除现有数据并重新启动janusgraph。 - Ashraful Islam
目前没有数据。我在我的Solr中什么都没看到.... :( 我应该删除哪些数据? - BigBug
1
JanusGraph将配置存储在您的存储后端中,例如Cassandra。您需要清除Cassandra数据。 - Ashraful Islam
1个回答

4
这基本上与Titan的这个问题的答案相同。JanusGraph是从Titan分叉出来的。
您可能正在尝试连接到先前配置为使用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) 你可以删除现有的keyspace。如果你按照快速入门指南使用bin/janusgraph.sh start(启动单节点Cassandra和单节点Elasticsearch),

bin/janusgraph.sh clean

如果您有独立的Cassandra安装:

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

那么您就可以连接默认的 conf/janusgraph-cassandra.properties

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接