1

My Neo4j database server is hosted in AWS.

I am using from my Mac this command:

$ ./bin/neo4j-shell -host xx.xxx.xxx.xxx -port 1337 -name shell

The port 1337 is enabled in the AWS Neo4j database server.

I have these lines uncommented in the file neo4j.properties:

remote_shell_enabled=true
remote_shell_host=127.0.0.1
remote_shell_port=1337

I am getting the error: Connection refused

Having the details:

java.rmi.ConnectException: Connection refused to host: xx.xxx.xxx.xxx; nested exception is: 
    java.net.ConnectException: Connection refused
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
    at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:341)
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at java.rmi.Naming.lookup(Naming.java:101)
    at org.neo4j.shell.impl.RmiLocation.getBoundObject(RmiLocation.java:261)
    at org.neo4j.shell.impl.RemoteClient.findRemoteServer(RemoteClient.java:69)
    at org.neo4j.shell.impl.RemoteClient.<init>(RemoteClient.java:62)
    at org.neo4j.shell.impl.RemoteClient.<init>(RemoteClient.java:45)
    at org.neo4j.shell.ShellLobby.newClient(ShellLobby.java:178)
    at org.neo4j.shell.StartClient.startRemote(StartClient.java:302)
    at org.neo4j.shell.StartClient.start(StartClient.java:179)
    at org.neo4j.shell.StartClient.main(StartClient.java:124)
Caused by: java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:579)
    at java.net.Socket.connect(Socket.java:528)
    at java.net.Socket.<init>(Socket.java:425)
    at java.net.Socket.<init>(Socket.java:208)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:147)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
    ... 13 more

Don't know how to fix it.

LDB
  • 692
  • 6
  • 18

2 Answers2

1

I think you have to open quite a few ports on your server, besides 1337 and 1099 also a port range for RMI ports.

e.g. What port is used by Java RMI connection?

you can also use neo4j over http (e.g. in the browser with /webadmin) or via this script: https://gist.github.com/jexp/a9bf4cd3a16eb6c5997b

Community
  • 1
  • 1
Michael Hunger
  • 41,339
  • 3
  • 57
  • 80
0

This key remote_shell_host=127.0.0.1 that enables you to just connect via loopback. You have to specify by which network adapter you will receive the connection. You can also specify 0.0.0.0 for any your network interfaces.

Gonzalo
  • 20,805
  • 3
  • 75
  • 78
  • 0.0.0.0 does not work for me. When I am using 0.0.0.0 instead of 127.0.0.1 the server is not starting. – LDB Sep 24 '15 at 17:19
  • I was able to make 0.0.0.0 working, I was able to restart the server. However when trying this command: ./bin/neo4j-shell -host xx.xxx.xxx.xxx -port 1337 -name shell I am still getting the error message "Connection refused". I can ping successfully this IP address. – LDB Sep 25 '15 at 15:38