0

I'm trying to instantiate JanusGraph with the following configuration, using Cassandra as storage backend and ElasticSearch as indexing backend:

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();

The above code works if cassandra's cluser is named Test Cluster. If I rename it to something else, an exception is thrown:

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

How can I make elasticsearch work with my new cluster name? Using Max OS X 10.11.6, any pointers are highly appreciated.

Double M
  • 1,449
  • 1
  • 12
  • 29

1 Answers1

0

Reset your data, if it is for testing purpose

  1. Clear all your data from the storage backend (Cassandra)
  2. Restart all the janusgraph nodes

In JanusGraph

Each configuration option has a certain mutability level that governs whether and how it can be modified after the database is opened for the first time. The following listing describes the mutability levels.

  • FIXED

    Once the database has been opened, these configuration options cannot be changed for the entire life of the database

  • GLOBAL_OFFLINE

    These options can only be changed for the entire database cluster at once when all instances are shut down

  • GLOBAL

    These options can only be changed globally across the entire database cluster MASKABLE These options are global but can be overwritten by a local configuration file

  • LOCAL

    These options can only be provided through a local configuration file

You can get the Mutability Level of any configuration from the below link

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

Ashraful Islam
  • 12,470
  • 3
  • 32
  • 53