简体   繁体   English

neo4j 螺栓连接卡住

[英]neo4j bolt connect stuck

I connect neo4j-community-3.1.1 via neo4j-java-driver to a non-local server like this:我通过 neo4j-java-driver 将 neo4j-community-3.1.1 连接到这样的非本地服务器:

Driver driver = GraphDatabase.driver("bolt://10.209.20.211:7687",
                AuthTokens.basic("username", "xxxx"));
System.out.println("neo4j driver created..");
Session session = driver.session();
System.out.println("session opened..");

but it never reaches "System.out.println("session opened..");"但它永远不会到达 "System.out.println("session opens..");" obviously, it is stuck on "driver.session();"显然,它停留在“driver.session();”上

I'm sure that the network is working, having tested it via telnet 10.209.20.211 7687 .我确定网络正常工作,已经通过telnet 10.209.20.211 7687对其进行了测试。

And the neo4j.conf file like this:和 neo4j.conf 文件是这样的:

# Network connector configuration
#*****************************************************************

# With default configuration Neo4j only accepts local connections.
# To accept non-local connections, uncomment this line:
dbms.connectors.default_listen_address=0.0.0.0

# You can also choose a specific network interface, and configure a non-default
# port for each connector, by setting their individual listen_address.

# The address at which this server can be reached by its clients. This may be the server's IP address or DNS name, or
# it may be the address of a reverse proxy which sits in front of the server. This setting may be overridden for
# individual connectors below.
#dbms.connectors.default_advertised_address=localhost

# You can also choose a specific advertised hostname or IP address, and
# configure an advertised port for each connector, by setting their
# individual advertised_address.

# Bolt connector
dbms.connector.bolt.enabled=true
#dbms.connector.bolt.tls_level=OPTIONAL
#dbms.connector.bolt.listen_address=:7687

# HTTP Connector. There must be exactly one HTTP connector.
dbms.connector.http.enabled=true
#dbms.connector.http.listen_address=:7474

Now, what's the problem?现在,有什么问题?

I've resolved the problem this way:我已经解决了这个问题:

Config cfg = Config.build().withEncryptionLevel(Config.EncryptionLevel.NONE).toConfig();
Driver driver = GraphDatabase.driver("bolt://10.209.20.211:7687",
        AuthTokens.basic("username", "xxxx"), cfg);
System.out.println("neo4j driver created..");
Session session = driver.session();
System.out.println("session opened..");

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

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