是否在同一网络上的另一台计算机上连接到neo4j?

是否在同一网络上的另一台计算机上连接到neo4j?,neo4j,neo4jclient,Neo4j,Neo4jclient,我们在安装了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. Ple

我们在安装了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"));
  • 了解如何仅从web浏览器访问它
  • GraphClient的构造函数中使用该URL

  • 原则上,你想做的是正确的。但是,默认情况下,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包装器访问它。

    您还需要将
    dbms.default\u advised\u address
    更新为服务器的本地名称。UI代码似乎默认为
    localhost
    ,并且由于您的客户端(浏览器的本地主机)未侦听7474,因此无法获取websocket。