我正在使用docker版本的neo4j(v3.1.0),并且在使用neo4j-shell连接到neo4j服务器时遇到困难。neo4j-shell无法连接到neo4j服务器
运行 docker一个实例后,我跑在容器内一个bash:
$ docker exec -it neo4j /bin/bash
从那里我尝试运行neo4j-shell
这样的:
/var/lib/neo4j/bin/neo4j-shell
但它的错误:
$ /var/lib/neo4j/bin/neo4j-shell
ERROR (-v for expanded information):
Connection refused
-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, or '-' to read from stdin. After executing it the shell exits
-readonly Connect in readonly mode (only for connecting with -path)
-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
我也试过其他主机如:localhost
,127.0.0.1
和172.17.0.6
(容器IP)。由于没有工作,我想列出我的容器上的开放端口:
$ netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 :::7687 :::* LISTEN
tcp 0 0 :::7473 :::* LISTEN
tcp 0 0 :::7474 :::* LISTEN
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node Path
正如你可以看到有没有1337
开放!我查看了配置文件,指定端口的行被注释掉了,这意味着它应该被设置为默认值(1337)。
任何人都可以帮助我连接到neo4j使用neo4j壳?
顺便说一句,neo4j服务器已启动并运行,我可以通过端口7474使用其Web访问。
谢谢,但主要是我感兴趣的'noe4j-shell',因为它支持'BEGIN','COMMIT '和交易。看起来cypher-shell不是。您能否告诉我配置控件neo4j-shell中的哪个条目? – Mehran
不够公平,我修改了我的答案 –
请注意,cypher-shell支持开始和提交,添加了一个示例 –