I'm using the JanusGraph-Docker images (https://github.com/JanusGraph/janusgraph-docker) to set up JanusGraph in Docker. When I used JanusGraph without docker everything worked fine for me, but now I've ran into some issues:
I've used the following command to set up janusgraph with Cassandra+Elasticsearch:
docker-compose -f docker-compose-cql-es.yml up
This starts all the required containers, which I double checked with:
docker ps
Now I want to connect to Janusgraph via Gremlin console using:
docker-compose -f docker-compose-cql-es.yml run --rm -e GREMLIN_REMOTE_HOSTS=janusgraph janusgraph ./bin/gremlin.sh
This starts the gremlin console and I configure the remote with:
:remote connect tinkerpop.server conf/remote.yaml
:remote console
Which works fine aswell. After that I try to create a new graph, which fails with:
graph = JanusGraphFactory.open('conf/janusgraph-cassandra-es.properties')
This gives me the following message:
Connection refused (Connection refused)
Full Stack Trace:
java.net.ConnectException: Connection refused (Connection refused) at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at org.apache.thrift.transport.TSocket.open(TSocket.java:182) at org.apache.thrift.transport.TFramedTransport.open(TFramedTransport.java:81) at org.janusgraph.diskstorage.cassandra.thrift.thriftpool.CTConnectionFactory.makeRawConnection(CTConnectionFactory.java:110) at org.janusgraph.diskstorage.cassandra.thrift.thriftpool.CTConnectionFactory.makeObject(CTConnectionFactory.java:74) at org.janusgraph.diskstorage.cassandra.thrift.thriftpool.CTConnectionFactory.makeObject(CTConnectionFactory.java:43) at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:1220) at org.janusgraph.diskstorage.cassandra.thrift.CassandraThriftStoreManager.getCassandraPartitioner(CassandraThriftStoreManager.java:215) at org.janusgraph.diskstorage.cassandra.thrift.CassandraThriftStoreManager.(CassandraThriftStoreManager.java:197) 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) at org.janusgraph.diskstorage.Backend.getImplementationClass(Backend.java:440) at org.janusgraph.diskstorage.Backend.getStorageManager(Backend.java:411) at org.janusgraph.graphdb.configuration.builder.GraphDatabaseConfigurationBuilder.build(GraphDatabaseConfigurationBuilder.java:50) at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:161) at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:132) at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:79) at org.janusgraph.core.JanusGraphFactory$open.call(Unknown Source) at Script4.run(Script4.groovy:1) at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.eval(GremlinGroovyScriptEngine.java:674) at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.eval(GremlinGroovyScriptEngine.java:376) at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:233) at org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.lambda$eval$0(GremlinExecutor.java:266) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)
I can run queries such as the following since janusgraph server seems to pre-deploy a graph with a traversal object:
g.addV('user').property('username','exampleUserName')
But when I'm trying to connect from python gremlin with:
graph = Graph()
g = graph.traversal().withRemote(DriverRemoteConnection('ws://0.0.0.0:8182/gremlin','g'))
I get the same error, any help?
0.0.0.0as the IP of the host in gremlin-python? It should of course be the IP address under which the JanusGraph container can be reached. - Florian Hockmann0.0.0.0:8182->8182/tcpin gremlin-python specifying the ip likews://0.0.0.0:8182/gremlinin theDriverRemoteConnectionshould be enough, right? - Robin Schmidt