JanusGraph janusgraph-0.2.0 can not connect to ElasticSearch

1,149 views
Skip to first unread message

Jacinto

unread,
Jan 17, 2018, 9:53:54 AM1/17/18
to JanusGraph users

I'm trying to instantiate JanusGraph with the following configuration, using Cassandra as storage backend and ElasticSearch as indexing backend. I was working with Janus without Elastichsearch, just with Cassandra and Gremlin.

But now I need ES to create indexes.


My conf:

janusgraph-cassandra.properties:

storage.backend=cql
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.5
storage.cql.batch-statement-size=5000
index.search.backend=elasticsearch
index.search.hostname=127.0.0.1
index.search.elasticsearch.interface=REST_CLIENT
 

An exception is thrown:


7183 [main] WARN  org.janusgraph.diskstorage.es.rest.RestElasticSearchClient  - Unable to determine Elasticsearch server version. Default to FIVE.
java.net.ConnectException: Conexión rehusada
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
        at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvent(DefaultConnectingIOReactor.java:171)
        at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:145)
        at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:348)
        at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:192)
        at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:64)
        at java.lang.Thread.run(Thread.java:745)
7210 [main] WARN  org.apache.tinkerpop.gremlin.server.GremlinServer  - Graph [graph] configured at [conf/janusgraph-cassandra.properties] could not be instantiated and will not be available in Gremlin Server.  GraphFactory message: GraphFactory could not instantiate this Graph implementation [class org.janusgraph.core.JanusGraphFactory]
java.lang.RuntimeException: GraphFactory could not instantiate this Graph implementation [class org.janusgraph.core.JanusGraphFactory]
        at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:82)
        at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:70)
        at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:104)
        at org.apache.tinkerpop.gremlin.server.util.DefaultGraphManager.lambda$new$0(DefaultGraphManager.java:57)
        at java.util.LinkedHashMap$LinkedEntrySet.forEach(LinkedHashMap.java:663)
        at org.apache.tinkerpop.gremlin.server.util.DefaultGraphManager.<init>(DefaultGraphManager.java:55)
        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:423)
        at org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor.<init>(ServerGremlinExecutor.java:110)
        at org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor.<init>(ServerGremlinExecutor.java:89)
        at org.apache.tinkerpop.gremlin.server.GremlinServer.<init>(GremlinServer.java:110)
        at org.apache.tinkerpop.gremlin.server.GremlinServer.main(GremlinServer.java:354)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:78)
        ... 13 more
Caused by: 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:1897)
        at org.janusgraph.graphdb.database.StandardJanusGraph.<init>(StandardJanusGraph.java:136)
        at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:164)
        at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:133)
        at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:113)
        ... 18 more
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:423)
        at org.janusgraph.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:58)
        ... 26 more
Caused by: org.janusgraph.diskstorage.PermanentBackendException: Conexión rehusada
        at org.janusgraph.diskstorage.es.ElasticSearchIndex.<init>(ElasticSearchIndex.java:231)
        ... 31 more
Caused by: java.net.ConnectException: Conexión rehusada
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
        at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvent(DefaultConnectingIOReactor.java:171)
        at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:145)
        at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:348)
        at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:192)
        at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:64)
        at java.lang.Thread.run(Thread.java:745)

JanusGraph 0.2.0 added support for Elasticsearch REST_CLIENT and removed support for the previous options (TRANSPORT_CLIENT, NODE). I verify various parts of the documentation: http://docs.janusgraph.org/latest/upgrade.html#_transport_client

gremlin> gremlin> mgmt = graph.openManagement() mgmt = graph.openManagement() ==>org.janusgraph.graphdb.database.management.ManagementSystem@57545c3f gremlin> mgmt.set("index.search.elasticsearch.interface", "REST_CLIENT") mgmt.set("index.search.elasticsearch.interface", "REST_CLIENT") ==>org.janusgraph.diskstorage.configuration.UserModifiableConfiguration@65bb6275 gremlin> mgmt.commit() mgmt.commit() ==>null gremlin> gremlin> mgmt = graph.openManagement() mgmt = graph.openManagement() ==>org.janusgraph.graphdb.database.management.ManagementSystem@186d8a71 gremlin> mgmt.get('index.search.elasticsearch.interface') mgmt.get('index.search.elasticsearch.interface') ==>REST_CLIENT gremlin> :q

Antriksh Shah

unread,
Jan 22, 2018, 2:11:15 AM1/22/18
to JanusGraph users
Which version of ES are you using? You can try running the ES present in the JanusGraph0.2.0 package.  

cd janusgraph-0.2.0-hadoop2$ 
nohup elasticsearch/bin/elasticsearch &
 
Try the following configuration.  
localhost.properties 
 
storage.backend=inmemory
index.search.backend=elasticsearch
index.search.hostname=localhost
index.search.elasticsearch.interface=REST_CLIENT 

graph = JanusGraphFactory.open("conf/localhost.properties")
standardjanusgraph[inmemory:[127.0.0.1]]

Check if you are still facing an issue with this minimalistic property config. Also do one more thing, try clearing the existing elasticsearch db and run a fresh process instance of elastic search and check for error.
Reply all
Reply to author
Forward
0 new messages