我正在Docker上的AWS上运行neo4j服务器
运行neo4j的docker容器与主机共享网络接口,例如我用“--net = host”启动它
在neo4j.properties我有
..
remote_shell_host=0.0.0.0
remote_shell_enabled=true
remote_shell_port=1337
在neo4j-wrapper中我有以下参数
..
wrapper.java.additional=-Dneo4j.ext.udc.source=debian
wrapper.java.additional=-Dcom.sun.management.jmxremote.rmi.port=1099
wrapper.java.additional=-Dcom.sun.management.jmxremote.port=1099
wrapper.java.additional=-Dcom.sun.management.jmxremote.authenticate=false
wrapper.java.additional=-Dcom.sun.management.jmxremote.ssl=false
wrapper.java.additional=-Djava.rmi.server.hostname=xx.xx.xxx.xx
当从另一台机器连接到shell时,我得到了
root@5a9ad402ae02:/var/lib/neo4j/bin# ./neo4j-shell -host xx.xx.xxx.xx
Welcome to the Neo4j Shell! Enter 'help' for a list of commands
NOTE: Remote Neo4j graph database service 'shell' at port 1337
neo4j-sh (?)$ pwd
Exception creating connection to: 172.17.0.5; nested exception is:
java.net.NoRouteToHostException: No route to host
neo4j-sh (?)$ help
Exception creating connection to: 172.17.0.5; nested exception is:
java.net.NoRouteToHostException: No route to host
奇怪的是shell尝试连接到172.17.0.5。这个ip是我用来连接到远程shell的本地主机的地址。为什么shell试图回到我当地的主机?