Neo4j下執行cypher-shell時,Connection refused問題解決?


 

 

 

  不多說,直接上干貨!

 

 

 問題現象

root@zhouls-virtual-machine:/usr/local/app/neo4j-community-3.2.0/bin# ls
cypher-shell  neo4j  neo4j-admin  neo4j-import  neo4j-shell  tools
root@zhouls-virtual-machine:/usr/local/app/neo4j-community-3.2.0/bin# ./neo4j start
Active database: graph.db
Directories in use:
  home:         /usr/local/app/neo4j
  config:       /usr/local/app/neo4j/conf
  logs:         /usr/local/app/neo4j/logs
  plugins:      /usr/local/app/neo4j/plugins
  import:       /usr/local/app/neo4j/import
  data:         /usr/local/app/neo4j/data
  certificates: /usr/local/app/neo4j/certificates
  run:          /usr/local/app/neo4j/run
Starting Neo4j.
WARNING: Max 1024 open files allowed, minimum of 40000 recommended. See the Neo4j manual.
Started neo4j (pid 58377). It is available at http://0.0.0.0:7474/
There may be a short delay until the server is ready.
See /usr/local/app/neo4j/logs/neo4j.log for current status.
root@zhouls-virtual-machine:/usr/local/app/neo4j-community-3.2.0/bin# ./cypher-shell 
Connection refused
root@zhouls-virtual-machine:/usr/local/app/neo4j-community-3.2.0/bin# 

 

 

 

 

 

 

 

 

問題分析

  (1)配置文件里的關於shell的配置打開了嗎

    (2)為了更好的遠程訪問

 

 

解決辦法一

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

 

   必須啟動neo4j,其實是可以不需執行bin/neo4j start的。

 

root@zhouls-virtual-machine:/usr/local/app/neo4j-community-3.2.0/bin# ls
cypher-shell  neo4j  neo4j-admin  neo4j-import  neo4j-shell  tools
root@zhouls-virtual-machine:/usr/local/app/neo4j-community-3.2.0/bin# ./cypher-shell
username: neo4j
password: ******
Connected to Neo4j 3.2.0 at bolt://localhost:7687 as user neo4j.
Type :help for a list of available commands or :exit to exit the shell.
Note that Cypher queries must end with a semicolon.
neo4j>

 

 

 

 

 

解決辦法二(推薦)

 

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

 

 

 

root@zhouls-virtual-machine:/usr/local/app/neo4j-community-3.2.0/bin# ls
cypher-shell  neo4j  neo4j-admin  neo4j-import  neo4j-shell tools root@zhouls-virtual-machine:/usr/local/app/neo4j-community-3.2.0/bin# ./cypher-shell username: neo4j password: ****** Connected to Neo4j 3.2.0 at bolt://localhost:7687 as user neo4j. Type :help for a list of available commands or :exit to exit the shell. Note that Cypher queries must end with a semicolon. neo4j>

   成功!

 

 

 

   退出,是如下的操作

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM