title: Connection refused when trying to create graph in JanusGraph-Docker
body: <p>I'm using the JanusGraph-Docker images (<a href="https://github.com/JanusGraph/janusgraph-docker" rel="nofollow noreferrer">https://github.com/JanusGraph/janusgraph-docker</a>) 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:</p>
  
  <p>I've used the following command to set up janusgraph with Cassandra+Elasticsearch:</p>
  
  <pre><code>docker-compose -f docker-compose-cql-es.yml up
  </code></pre>
  
  <p>This starts all the required containers, which I double checked with: </p>
  
  <pre><code>docker ps
  </code></pre>
  
  <p>Now I want to connect to Janusgraph via Gremlin console using:</p>
  
  <pre><code>docker-compose -f docker-compose-cql-es.yml run --rm -e GREMLIN_REMOTE_HOSTS=janusgraph janusgraph ./bin/gremlin.sh
  </code></pre>
  
  <p>This starts the gremlin console and I configure the remote with: </p>
  
  <pre><code>:remote connect tinkerpop.server conf/remote.yaml
  :remote console
  </code></pre>
  
  <p>Which works fine aswell. After that I try to create a new graph, which fails with:</p>
  
  <pre><code>graph = JanusGraphFactory.open('conf/janusgraph-cassandra-es.properties')
  </code></pre>
  
  <p>This gives me the following message:</p>
  
  <blockquote>
    <p>Connection refused (Connection refused)</p>
  </blockquote>
  
  <p>Full Stack Trace:</p>
  
  <blockquote>
    <p>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)</p>
  </blockquote>
  
  <p>I can run queries such as the following since janusgraph server seems to pre-deploy a graph with a traversal object:</p>
  
  <pre><code>g.addV('user').property('username','exampleUserName')
  </code></pre>
  
  <p>But when I'm trying to connect from python gremlin with:</p>
  
  <pre><code>graph = Graph()
  g = graph.traversal().withRemote(DriverRemoteConnection('ws://0.0.0.0:8182/gremlin','g'))
  </code></pre>
  
  <p>I get the same error, any help?</p>