我们还有一个问题。我们在docker中设置了一个neo4j因果集群,其组成部分如下:
core1:
networks:
- lan
hostname: core1
image: neo4j:4.0-enterprise
ports:
- 7687:7687
- 6464:6464
- 7474:7474
volumes:
- ./neo4j-core1/conf:/conf
- ./neo4j-core1/data:/data
- ./neo4j-core1/logs:/logs
- ./neo4j-core1/metrics:/metrics
- ./cluster-simple/plugins:/plugins
environment:
- NEO4J_AUTH=neo4j/changeme
- NEO4J_dbms_mode=CORE
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
- NEO4J_causal__clustering_minimum__core__cluster__size__at__formation=2
- NEO4J_causal__clustering_minimum__core__cluster__size__at__runtime=2
- NEO4J_causal__clustering_initial__discovery__members=core1:5000,core2:5000,core3:5000
- NEO4J_dbms_connector_http_listen__address=:7474
- NEO4J_dbms_connector_https_listen__address=:6464
- NEO4J_dbms_connector_bolt_listen__address=:7687
- NEO4J_dbms_allow__upgrade=true
- NEO4JLABS_PLUGINS=["apoc"]
core2:
networks:
- lan
hostname: core2
image: neo4j:4.0-enterprise
ports:
- 7688:7688
- 6465:6465
- 7475:7475
volumes:
- ./neo4j-core2/conf:/conf
- ./neo4j-core2/data:/data
- ./neo4j-core2/logs:/logs
- ./neo4j-core2/metrics:/metrics
- ./cluster-simple/plugins:/plugins
environment:
- NEO4J_AUTH=neo4j/changeme
- NEO4J_dbms_mode=CORE
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
- NEO4J_causal__clustering_minimum__core__cluster__size__at__formation=2
- NEO4J_causal__clustering_minimum__core__cluster__size__at__runtime=2
- NEO4J_causal__clustering_initial__discovery__members=core1:5000,core2:5000,core3:5000
- NEO4J_dbms_connector_http_listen__address=:7475
- NEO4J_dbms_connector_https_listen__address=:6465
- NEO4J_dbms_connector_bolt_listen__address=:7688
- NEO4J_dbms_allow__upgrade=true
- NEO4JLABS_PLUGINS=["apoc"]
core3:
networks:
- lan
hostname: core3
image: neo4j:4.0-enterprise
ports:
- 7689:7689
- 6466:6466
- 7476:7476
volumes:
- ./neo4j-core3/conf:/conf
- ./neo4j-core3/data:/data
- ./neo4j-core3/logs:/logs
- ./neo4j-core3/metrics:/metrics
- ./cluster-simple/plugins:/plugins
environment:
- NEO4J_AUTH=neo4j/changeme
- NEO4J_dbms_mode=CORE
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
- NEO4J_causal__clustering_minimum__core__cluster__size__at__formation=2
- NEO4J_causal__clustering_minimum__core__cluster__size__at__runtime=2
- NEO4J_causal__clustering_initial__discovery__members=core1:5000,core2:5000,core3:5000
- NEO4J_dbms_connector_http_listen__address=:7476
- NEO4J_dbms_connector_https_listen__address=:6466
- NEO4J_dbms_connector_bolt_listen__address=:7689
- NEO4J_dbms_allow__upgrade=true
- NEO4JLABS_PLUGINS=["apoc"]
read1:
networks:
- lan
hostname: read1
image: neo4j:4.0-enterprise
ports:
- 7690:7690
- 6480:6480
- 7477:7477
volumes:
- ./neo4j-read1/conf:/conf
- ./neo4j-read1/data:/data
- ./neo4j-read1/logs:/logs
- ./neo4j-read1/metrics:/metrics
- ./cluster-simple/plugins:/plugins
environment:
- NEO4J_AUTH=neo4j/changeme
- NEO4J_dbms_mode=READ_REPLICA
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
- NEO4J_causalClustering_initialDiscoveryMembers=core1:5000,core2:5000,core3:5000
- NEO4J_dbms_connector_http_listen__address=:7477
- NEO4J_dbms_connector_https_listen__address=:6480
- NEO4J_dbms_connector_bolt_listen__address=:7690
- NEO4J_dbms_allow__upgrade=true
- NEO4JLABS_PLUGINS=["apoc"]
一切开始完全正常,没有明显的错误,我可以访问neo4j用户界面localhost:7474.
你能给我一个如何从jupyternotebook连接到这个neo4j数据库的主意吗?当我´m listqueries in neo4j with:call dbms.listqueries它向我显示一个请求uri:i.e:“172.21.0.4:7689”这不会在jupyter中引发错误,代码如下:
from neo4j import GraphDatabase
graphdb = GraphDatabase.driver(uri="bolt://172.21.0.4:7689", auth=("neo4j", "changeme"))
但在那之后,当我试图读取数据时,它就不起作用了。
暂无答案!
目前还没有任何答案,快来回答吧!