2013-07-18 79 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包裝器中訪問它。

相關問題