简体   繁体   English

cycli无法连接docker neo4j数据库

[英]cycli fails to connect a docker neo4j database

I have set up a docker neo4j image: 我已经设置了一个docker neo4j镜像:

2017-11-02 03:29:49.000+0000 INFO  ======== Neo4j 3.2.5 ========
2017-11-02 03:29:49.037+0000 INFO  Starting...
2017-11-02 03:29:50.527+0000 INFO  Bolt enabled on 0.0.0.0:7687.
2017-11-02 03:29:54.338+0000 INFO  Started.
2017-11-02 03:29:55.744+0000 INFO  Remote interface available at http://localhost:7474/

The port mapping is: 端口映射为:

7473/tcp    localhost:32770
7474/tcp    localhost:32769
7687/tcp    localhost:32768

I am able to connect the browser via http://localhost:32769/browser/ 我可以通过http://localhost:32769/browser/连接浏览http://localhost:32769/browser/

Now I want to access it by cycli , but failed: 现在我想通过cycli访问它,但是失败了:

Jimmys-MBP:scripts jimmy$ cycli -u neo4j -p xxxxx -h localhost -P 32769
 ______     __  __     ______     __         __
/\  ___\   /\ \_\ \   /\  ___\   /\ \       /\ \
\ \ \____  \ \____ \  \ \ \____  \ \ \____  \ \ \
 \ \_____\  \/\_____\  \ \_____\  \ \_____\  \ \_\
  \/_____/   \/_____/   \/_____/   \/_____/   \/_/
Cycli version: 0.7.6
Neo4j version: 3.2.5
Bug reports: https://github.com/nicolewhite/cycli/issues

> match(n) return n;
Unable to connect to localhost on port 7687 - is the server running?

Why is it still looking for docker port 7687? 为什么仍在寻找docker端口7687?

It is most likely that source of the problem is following configuration parameter in neo4j.conf 问题的根源很可能是跟随neo4j.conf中的配置参数

dbms.connector.bolt.listen_address=0.0.0.0:7687

Due to the fact you redirect port 7687 using docker port mapping 由于您使用docker端口映射重定向了端口7687

7687/tcp    localhost:32768

you should also modify bove config to make sure neo4j advertise port 32768 instead default port 7687. 您还应该修改bove配置,以确保neo4j通告端口32768而不是默认端口7687。

Accorng to the documentation that could be achieved environment variable when staring docker conatiner with following command 根据使用以下命令启动docker conatiner时可以实现的环境变量文档

sudo docker run -d --publish=32769:7474 --publish=32768:32768 --env=NEO4J_AUTH=neo4j/neo4jadmin  --env=NEO4J_dbms_connector_bolt_listen__address=0.0.0.0:32768 --name cycli_test_neo4j neo4j 

However, there is this bug in cycli which needs to be resolved for all this to work. 但是,cycli中存在此错误 ,需要解决才能使所有这些正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM