0

我在防火墙打开端口 1337、7474、7473 的服务器上安装了 Neo4j 2.3.2(使用验证ncat)。我可以远程访问基于 Web 的控制台,并且可以在本地访问 shell,但是我无法远程访问 shell。即,运行时path/to/neo4j-shell -v -host destination.example.org我得到

ERROR (-v for expanded information):
        Connection refused
java.rmi.ConnectException: Connection refused to host: <server ip addres>; nested exception is: 
        java.net.ConnectException: Verbinding is geweigerd
        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.invoke(UnicastRef.java:129)
        at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:227)
        at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:179)
        at com.sun.proxy.$Proxy1.welcome(Unknown Source)
        at org.neo4j.shell.impl.AbstractClient.sayHi(AbstractClient.java:257)
        at org.neo4j.shell.impl.RemoteClient.findRemoteServer(RemoteClient.java:70)
        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:204)
        at org.neo4j.shell.StartClient.startRemote(StartClient.java:355)
        at org.neo4j.shell.StartClient.start(StartClient.java:226)
        at org.neo4j.shell.StartClient.main(StartClient.java:145)
Caused by: java.net.ConnectException: Verbinding is geweigerd
        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)
        ... 14 more

/var/lib/neo4j/conf/neo4j.properties,我有

# Enable shell server so that remote clients can connect via Neo4j shell.
remote_shell_enabled=true
# The network interface IP the shell will listen on (use 0.0.0.0 for all interfaces).
remote_shell_host=0.0.0.0
# The port the shell will listen on, default is 1337.
remote_shell_port=1337

除了上面提到的三个端口,我还需要打开其他端口吗?是否有任何与我错过的 shell 相关的进一步配置?

4

1 回答 1

2

neo4j-shell基于Java RMI。有几个资源描述了如何为 RMI 做防火墙。事实上,它非常复杂,因为 RMI 正在进行动态端口分配。

通常我neo4j-shell通过 ssh 连接在本地运行,这也为您提供身份验证和加密 - 您只需要打开 SSH 端口。

于 2016-02-10T14:41:26.410 回答