gpt4 book ai didi

neo4j - 连接到同一网络上不同计算机上的 neo4j?

转载 作者:行者123 更新时间:2023-12-01 11:42:57 26 4
gpt4 key购买 nike

我们在这里和其中一台安装了 neo4j 服务器的计算机上有一个本地网络。现在为了测试,我想从同一网络上的计算机访问它。我很难做到这一点?

我需要在 neo4j-server.properties 文件中做些什么吗?

# Let the webserver only listen on the specified IP. Default is localhost (only
# accept local connections). Uncomment to allow any connection. Please see the
# security section in the neo4j manual before modifying this.
org.neo4j.server.webserver.address=0.0.0.0

要从那台机器访问它,我会在我的代码中输出什么?

clientConnection = new GraphClient(new Uri("http://localhost:7474/db/data"));

我可以这样做吗?

clientConnection = new GraphClient(new Uri("http://DevPC1:7474/db/data"));

最佳答案

原则上,您尝试做的是正确的。然而,默认情况下,Neo4j 只会监听本地主机 (127.0.0.1) 地址。

要更改此设置,请关闭正在运行的实例并在文本编辑器中编辑文件 conf/neo4j-server.properties。

如果您希望服务器监听分配给主机的所有 IP(通常适合内部使用),请通过删除散列取消注释此行:

#org.neo4j.server.webserver.address=0.0.0.0

如果您想监听特定 IP,请取消注释该行并将 0.0.0.0 替换为您要使用的 IP。

保存文件后,再次启动您的 neo4j 实例。您现在应该能够从 Web UI 和您选择的 API 包装器访问它。

关于neo4j - 连接到同一网络上不同计算机上的 neo4j?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17716797/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com