将 JanusGraph 与 Solr 结合使用
Using JanusGraph with Solr
设置 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
这个问题的答案与 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) 您可以删除现有的键空间。如果您使用快速启动说明中的 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
。
设置 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
这个问题的答案与
您可能正在尝试连接到之前配置为使用 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) 您可以删除现有的键空间。如果您使用快速启动说明中的 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
。