windows下vm14安装centos7,新建了neo4j用户,在该用户下下载了neo4j,然后进入{neo4j_home},执行bin/neo4j console,以控制台方式启动,然后linux访问http://localhost:7474/browser/,一切正常,然后在idea中执行代码,以http方式和blot方式访问都不行。

以为是linux防火墙的原因,一顿查,返现不是防火墙的原因,查询文档,进入neo安装目录下conf,修改neo4j.conf配置文件,将#dbms.connector.http.listen_address=:7474 修改为dbms.connector.http.listen_address={linux ip}:7474,还有一说是修改为dbms.connector.http.listen_address=0.0.0.0:7474,但是我用前一种方法可以在windows中访问到neo4j的browser。

 

 

window浏览器中访问browser,输入正确的账号密码,无果,报错如下:

WebSocket connection failure. Due to security constraints in your web browser, the reason for the failure is not available to this Neo4j Driver. Please use your browsers development console to determine the root cause of the failure
然后从查询neo4j官网,https://neo4j.com/developer/kb/explanation-of-error-websocket-connection-failure/,这里记录了修改的方法:

# To have Bolt accept non-local connections, uncomment this line:
dbms.connector.bolt.address=0.0.0.0:7687

 

但是我的可能是版本的原因吧,有点不一样:我的是:

dbms.connector.bolt.listen_address=0.0.0.0:7687

至此,windows中可以正常访问,代码中也可以正常执行

Logo

更多推荐