0

我正在尝试JanusGraph使用以下配置实例化,使用Cassandra作为存储后端,使用ElasticSearch作为索引后端:

JanusGraph graph = JanusGraphFactory.build()
    .set("storage.backend", "cassandra")
    .set("storage.hostname", "localhost")

    .set("cache.db-cache", true)
    .set("schema.default", "none")

    .set("index.search.backend", "elasticsearch")
    .set("index.search.elasticsearch.client-only", "false")
    .set("index.search.elasticsearch.local-mode", "true")
    .open();

如果 cassandra 的 cluser 命名为 ,则上述代码有效Test Cluster。如果我将其重命名为其他名称,则会引发异常:

java.lang.IllegalArgumentException: Could not instantiate implementation: org.janusgraph.diskstorage.es.ElasticSearchIndex
    at org.janusgraph.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:69)
    at org.janusgraph.diskstorage.Backend.getImplementationClass(Backend.java:477)
    at org.janusgraph.diskstorage.Backend.getIndexes(Backend.java:464)
    at org.janusgraph.diskstorage.Backend.<init>(Backend.java:149)
    at org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration.getBackend(GraphDatabaseConfiguration.java:1850)
    at org.janusgraph.graphdb.database.StandardJanusGraph.<init>(StandardJanusGraph.java:134)
    at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:107)
    at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:97)
    at org.janusgraph.core.JanusGraphFactory$Builder.open(JanusGraphFactory.java:152)
    at engineering.divine.core.GraphFactory.cassandraGraph(GraphFactory.java:403)
    at engineering.divine.core.GraphFactory.graph(GraphFactory.java:298)
    at engineering.divine.core.GraphFactory.getDefault(GraphFactory.java:99)
    at engineering.divine.repository.Repository.listRepositoriesToUpdate(Repository.java:130)
    at engineering.divine.daemon.RepositoryAnalysisDaemon.run(RepositoryAnalysisDaemon.java:24)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at org.janusgraph.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:58)
    ... 20 more
Caused by: org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: []
    at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:279)
    at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:198)
    at org.elasticsearch.client.transport.support.InternalTransportClusterAdminClient.execute(InternalTransportClusterAdminClient.java:86)
    at org.elasticsearch.client.support.AbstractClusterAdminClient.health(AbstractClusterAdminClient.java:127)
    at org.elasticsearch.action.admin.cluster.health.ClusterHealthRequestBuilder.doExecute(ClusterHealthRequestBuilder.java:92)
    at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:91)
    at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:65)
    at org.janusgraph.diskstorage.es.ElasticSearchIndex.<init>(ElasticSearchIndex.java:215)
    ... 25 more

如何elasticsearch使用我的新集群名称?使用 Max OS X 10.11.6,任何指针都受到高度赞赏。

4

1 回答 1

0

重置您的数据,如果它是用于测试目的

  1. 从存储后端(Cassandra)清除所有数据
  2. 重启所有janusgraph节点

在 JanusGraph 中

每个配置选项都有一定的可变性级别,用于控制在首次打开数据库后是否可以修改以及如何修改。以下清单描述了可变性级别。

  • 固定的

    一旦打开数据库,这些配置选项在数据库的整个生命周期内都无法更改

  • GLOBAL_OFFLINE

    这些选项只能在所有实例都关闭时一次为整个数据库集群更改

  • 全球的

    这些选项只能在整个数据库集群中全局更改 MASKABLE 这些选项是全局的,但可以被本地配置文件覆盖

  • 当地的

    这些选项只能通过本地配置文件提供

您可以从以下链接获取任何配置的可变性级别

来源:http ://docs.janusgraph.org/latest/config-ref.html

于 2017-11-20T13:02:29.007 回答