2016-10-20 40 views
0

最終目標是從數據庫中完成一個完整的備份,所以我嘗試通過shell連接到數據庫並執行查詢返回一切。這裏是問題:如果主機上有3個節點和3個邊緣,如何通過本地主機上的neo4j-shell連接到noe4j數據庫?

/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 

我試圖連接到服務器的特定端口上:

[[email protected] core01]# /opt/data/core01/bin/neo4j-shell -v localhost -port 7474 -config /opt/data/core01/conf/neo4j.conf 
non-JRMP server at remote endpoint 

我很新的這一點,所以我很感謝任何形式的幫助。

感謝

回答

0

添加這些行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 
相關問題