2013-07-18 125 views
3

我们有一个本地网络,并在其中一台安装了neo4j服务器的计算机上运行。现在进行测试,我想从同一网络上的计算机访问它。我正在努力这样做?在同一网络上的另一台计算机上连接到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")); 

回答

1
  1. 工作如何刚刚从Web浏览器访问它
  2. 使用URL在构造函数GraphClient
5

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

相关问题