我已经在链接中查看了有关同一问题的另一个问题
neo4j-shell -主机 127.0.0.1 -端口 1337
我得到了错误
root@ip-10-142-85-146:~# neo4j-shell -v -host 127.0.0.1 -port 1337
ERROR (-v for expanded information):
Connection refused
java.rmi.ConnectException: Connection refused to host: 10.142.85.146; 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.invoke(UnicastRef.java:129)
at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:194)
at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:148)
at com.sun.proxy.$Proxy1.welcome(Unknown Source)
at org.neo4j.shell.impl.AbstractClient.sayHi(AbstractClient.java:215)
at org.neo4j.shell.impl.RemoteClient.findRemoteServer(RemoteClient.java:63)
at org.neo4j.shell.impl.RemoteClient.<init>(RemoteClient.java:55)
at org.neo4j.shell.impl.RemoteClient.<init>(RemoteClient.java:43)
at org.neo4j.shell.ShellLobby.newClient(ShellLobby.java:165)
at org.neo4j.shell.StartClient.startRemote(StartClient.java:297)
at org.neo4j.shell.StartClient.start(StartClient.java:175)
at org.neo4j.shell.StartClient.main(StartClient.java:120)
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)
... 14 more
telnet 127.0.0.1 1337 工作正常 telnet 10.142.85.146 1337 失败
root@ip-10-142-85-146:~# telnet 10.142.85.146 1337
Trying 10.142.85.146...
telnet: Unable to connect to remote host: Connection refused
root@ip-10-142-85-146:~#
ping 10.142.85.146 也失败
root@ip-10-142-85-146:~# ping 10.142.85.146
PING 10.142.85.146 (10.142.85.146) 56(84) bytes of data.
^C
--- 10.142.85.146 ping statistics ---
11 packets transmitted, 0 received, 100% packet loss, time 10018ms
我发现这里有一些相似之处;neo4j-shell 正在寻找 10.142.85.146,但找不到它
我能够正常使用公共 IP 地址;但本地地址存在问题
任何帮助都将不胜感激。我不想再提出另一个问题,因此在同一个帖子中写道
附加信息最奇怪的是,我的 AWS 控制台显示私有地址是 10.142.65.14,如何将其转换为 10.142.85.146,我不知道
答案1
我根据 AWS 命名约定用当前 IP 和主机名更新了 /etc/hosts,一切开始正常工作。
我正在查看这篇文章以便在每次启动时自动更新它们 http://www.onepwr.org/2012/04/26/chef-recipe-to-setup-up-a-new-nodes-fqdn-hostname-etc-properly/