结合Solr使用JanusGraph
设置JanusGraph时,我注意到控制台中有以下内容:结合Solr使用JanusGraph,solr,janusgraph,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 key
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
这个问题的答案与泰坦的答案基本相同。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) 可以删除现有的键空间。如果从快速启动方向(启动单节点Cassandra和单节点Elasticsearch)使用了bin/janusgraph.sh start
或者,如果您有独立的Cassandra安装:
$CASSANDRA_HOME/bin/cqlsh -e 'drop keyspace if exists janusgraph'
然后,您将能够连接默认的
conf/janusgraph cassandra.properties
一旦设置了全局脱机属性并初始化了janusgraph集群,对这些属性的任何更改将永远不会在该集群中生效,即使集群将重新启动。因此,即使将index backend更改为solr,它也不会生效,因此必须清除现有数据并重新启动JanusGraph当前没有数据。我在我的解决方案中看不到任何东西(我应该删除哪些数据?在您的案例cassandra中,存储后端的JanusGraph存储配置。您需要清除cassandra数据。)
$CASSANDRA_HOME/bin/cqlsh -e 'drop keyspace if exists janusgraph'