更新:wrt。 Neo4j 2.1.6 cf. http://goo.gl/LI18ao
作为Can't connect to neo4j shell to local server的后续行动。
安装neo4j-community-2.1.5并启动服务器:
$ neo4j start
Using additional JVM arguments: -server -XX:+DisableExplicitGC -Dorg.neo4j.server.properties=conf/neo4j-server.properties -Djava.util.logging.config.file=conf/logging.properties -Dlog4j.configuration=file:conf/log4j.properties -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled
Starting Neo4j Server...WARNING: not changing user
process [13088]... waiting for server to be ready.............................................................................. OK.
http://localhost:7474/ is ready.
然后尝试通过shell连接:
$ neo4j-shell
ERROR (-v for expanded information):
Connection refused
进行以下扩展:
$ neo4j-shell -v
ERROR (-v for expanded information):
Connection refused
java.rmi.ConnectException: Connection refused to host: 172.24.46.19; nested exception is:
java.net.ConnectException: Operation timed out
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: Operation timed out
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
然后我将我的笔记本电脑从局域网断开连接并再次尝试成功:
$ neo4j stop
Stopping Neo4j Server [13088].... done
$ neo4j start
Using additional JVM arguments: -server -XX:+DisableExplicitGC -Dorg.neo4j.server.properties=conf/neo4j-server.properties -Djava.util.logging.config.file=conf/logging.properties -Dlog4j.configuration=file:conf/log4j.properties -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled
Starting Neo4j Server...WARNING: not changing user
process [13818]... waiting for server to be ready........................ OK.
http://localhost:7474/ is ready.
$ neo4j-shell
Welcome to the Neo4j Shell! Enter 'help' for a list of commands
NOTE: Remote Neo4j graph database service 'shell' at port 1337
neo4j-sh (?)$
为什么?
答案 0 :(得分:0)
shell似乎没有尝试连接localhost而是你的外部IP地址? IP分辨率可能有问题吗? (/ etc / hosts或DNS)。
您可以为shell提供-host 127.0.0.1
参数,这可能有帮助吗?
答案 1 :(得分:0)