简体   繁体   English

如何配置neo4j服务器使用bolt

[英]How to configure neo4j server to use bolt

I am currently running awebapp with an embedded neo4j.我目前正在运行带有嵌入式 neo4j 的 webapp。 Now I want to change to a standalone neo4j server using bolt.现在我想使用bolt更改为独立的neo4j服务器。 Neo4j has been loaded onto a standalone and port 7474 work as expected. Neo4j 已经被加载到一个独立的和端口 7474 工作正常。

Using the following code works as expected:使用以下代码按预期工作:

var authority = neo4j.v1.auth.basic("neo4j", "XXXXXXXX");
_driver = neo4j.v1.driver("bolt://localhost ", authority, {encrypted:false});

However然而

        var authority = neo4j.v1.auth.basic("neo4j", "XXXXXXXX");
        _driver = neo4j.v1.driver("bolt://somesite.com/ ", authority, {encrypted:false});

Fails with:失败:

neo4j-web.js:27568 WebSocket connection to 'ws://somesite.com:7687/' failed: Error during WebSocket handshake: net::ERR_CONNECTION_RESET

The port 7687 has been enabled.端口 7687 已启用。 The neo4j version 3.0.4 and the server operating system is Centos 7. neo4j 3.0.4版本,服务器操作系统为Centos 7。

What am I missing?我错过了什么?

Thanks for the help谢谢您的帮助

您需要通过conf/neo4j.conf添加到conf/neo4j.conf来启用远程连接:

dbms.connector.bolt.address=0.0.0.0:7687

Stefan's answer works for Neo4j 3.0 (see this KB article ). Stefan 的回答适用于 Neo4j 3.0(请参阅此知识库文章)。

For those that are having an issue like Maulik, you are probably using a more recent version of Neo4j (3.5, 4.x), in which case you need to use the following instead:对于像 Maulik 这样有问题的人,您可能使用的是较新版本的 Neo4j(3.5、4.x),在这种情况下,您需要使用以下内容:

dbms.connector.bolt.advertised_address=localhost:7687
dbms.connector.bolt.listen_address=0.0.0.0:7687

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM