1

最终目的是从其中一个数据库进行完整备份,因此我尝试通过 shell 连接到数据库并执行查询返回所有内容。这是问题:

/opt/data/core01/bin/neo4j-shell -path /opt/data/core01/data/databases -config /opt/data/core01/conf/neo4j.conf

NOTE: Local Neo4j graph database service at '/opt/data/core01/data/databases'
Welcome to the Neo4j Shell! Enter 'help' for a list of commands. Please note that neo4j-shell is deprecated and to be replaced by cypher-shell.
neo4j-sh (?)$ MATCH (n) RETURN n;
0 row
291 ms
neo4j-sh (?)$
ls -l /opt/data/core01/data/databases
total 144
drwx------. 2 root root   39 Oct 19 09:36 certificates
drwx------. 7 root root 4096 Oct 19 09:36 graph.db

我试图将 graph.db 添加到路径中,但没有用。

/opt/data/core01/bin/neo4j-shell -path /opt/data/core01/data/databases/graph.db  -config /opt/data/core01/conf/neo4j.conf
Error starting org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory, /opt/data/core01/data/databases/graph.db

我试图连接到特定端口上的服务器:

[root@tnv-it-lora0002 core01]# /opt/data/core01/bin/neo4j-shell -v localhost  -port 7474  -config /opt/data/core01/conf/neo4j.conf
non-JRMP server at remote endpoint

我对此很陌生,所以我很感激任何帮助。

谢谢

4

1 回答 1

1

将这些行添加到 conf 文件中:

# 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
dbms.shell.host=127.0.0.1
# The port the shell will listen on, default is 1337.
dbms.shell.port=1337

/opt/data/core01/bin/neo4j-shell -v localhost -port 1337 -config /opt/data/core01/conf/neo4j.conf

从外壳导出:

cat /opt/data/core01/bin/export_statment.cql | ./opt/data/core01/bin/neo4j-shell -v localhost -port 1337 -config /opt/data/core01/conf/neo4j.conf

或者

/opt/data/core01/bin/neo4j-shell -v localhost -port 1337 -config /opt/data/core01/conf/neo4j.conf -file /opt/data/core01/bin/export.par
于 2016-10-20T14:50:35.437 回答