7

我在 Mac (ML) 上运行 2.0.0 M06

Neo4j 正在运行,Web 控制台工作正常。但是当我尝试通过 Neo4j-shell 连接时它失败了。周三一切都很好,但是在尝试安装 Postgres(MusicBrainz Neo4j 项目的一部分)之后,出现了这个问题:

sneedham-pd:neo4j-community-2.0.0-M06 username$ **bin/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 [694]... waiting for server to be ready..... OK.
http://localhost:7474/ is ready.

sneedham-pd:neo4j-community-2.0.0-M06 username$ **bin/neo4j-shell -v**
ERROR (-v for expanded information):
    Connection refused
java.rmi.ConnectException: Connection refused to host: 172.16.31.31; 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:128)
    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:206)
    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:289)
    at org.neo4j.shell.StartClient.start(StartClient.java:167)
    at org.neo4j.shell.StartClient.main(StartClient.java:119)
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:391)
    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:146)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
    ... 14 more

 -host      Domain name or IP of host to connect to (default: localhost)
 -port      Port of host to connect to (default: 1337)
 -name      RMI name, i.e. rmi://<host>:<port>/<name> (default: shell)
 -pid       Process ID to connect to
 -c         Command line to execute. After executing it the shell exits
 -file      File containing commands to execute. After executing it the shell exits
 -readonly  Connect in readonly mode
 -path      Points to a neo4j db path so that a local server can be started there
 -config    Points to a config file when starting a local server

Example arguments for remote:
    -port 1337
    -host 192.168.1.234 -port 1337 -name shell
    -host localhost -readonly
    ...or no arguments for default values
Example arguments for local:
    -path /path/to/db
    -path /path/to/db -config /path/to/neo4j.config
    -path /path/to/db -readonly
4

5 回答 5

5

在您的 neo4j.conf 中,您必须取消注释与使用 neo4j-shell 相关的行

# Enable a remote shell server which Neo4j Shell clients can log in to.
dbms.shell.enabled=true
# The network interface IP the shell will listen on (use 0.0.0.0 for all interfaces).
dbms.shell.host=127.0.0.1
# The port the shell will listen on, default is 1337.
dbms.shell.port=1337

这为我解决了这个问题

于 2018-11-12T21:29:21.403 回答
1

关键是服务器绑定到localhost(127.0.0.1) 并且 shell 尝试连接到172.16.31.31,这是另一个网络接口,而不是环回。这就是你来这里的原因connection refused

于 2013-11-08T21:47:46.593 回答
1

打开命令提示符:在此处输入图像描述

C:\Users\nsh004\Documents\Neo4j>Neo4jShell -path C:\Users\nshinde004\Documen ts\Neo4j\Demo1 -file load.cql

这对我有用。我们必须提供数据库的路径。一旦我提供它工作!:-)

于 2015-09-29T05:38:26.297 回答
0

我面临同样的问题。

我的配置是:

  • windows-7-x32
  • Neo4j-2.1.4
  • neo4j 作为服务启动

Neo4jShell.bat 工作文件 util 我关闭了我的笔记本(睡眠模式)。恢复后,看起来 Neo4j 进程以某种方式“松散”了监听端口。取决于情况 1337 端口可以被不同的进程使用

[nvstreamsvc.exe] TCP 127.0.0.1:1337 notebook:0 LISTENING

[Dropbox.exe] TCP 127.0.0.1:1337 笔记本:0 监听

在我的情况下,解决方案是通过 Windows 任务管理器重新启动 Neo4j-Server 服务。

我希望这将有所帮助。

于 2014-10-04T16:38:30.380 回答
0

如果您有使用以下命令的数据库文件夹,则可以在没有主机的情况下导出 neo4j 数据库:

neo4j-shell -path /var/lib/neo4j/data/databases/graph.db -c dump > export_data.cypher -v

它将在您的当前目录中创建名为“export_data.cypher”的文件。

希望能帮助到你。

于 2017-03-15T06:36:39.263 回答