AWS数据库服务器上的Neo4j远程shell连接被拒绝

时间:2015-06-23 17:04:08

标签: neo4j

我的Neo4j数据库服务器托管在AWS。

我在Mac上使用此命令:

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

在AWS Neo4j数据库服务器中启用了端口1337。

我在neo4j.properties文件中取消注释这些行:

remote_shell_enabled=true
remote_shell_host=127.0.0.1
remote_shell_port=1337

我收到错误:拒绝连接

有详细信息:

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

不知道如何修复它。

2 个答案:

答案 0 :(得分:1)

我认为您必须在服务器上打开相当多的端口,除了1337和1099之外还有RMI端口的端口范围。

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

您也可以通过http使用neo4j(例如在浏览器中使用/ webadmin)或通过此脚本:https://gist.github.com/jexp/a9bf4cd3a16eb6c5997b

答案 1 :(得分:0)

此键remote_shell_host=127.0.0.1使您可以通过环回连接。您必须指定您将通过哪个网络适配器接收连接。您还可以为任何网络接口指定0.0.0.0