Mike Barnes
Mike Barnes

Reputation: 4305

Connecting to to neo4j on a different computer on the same network?

We have a local network here and on on one of the computers we have neo4j server installed. Now for testing I would like to access it from my computer on the same network. I am struggling to do so?

Do I do anything here in the neo4j-server.properties file?

# 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

What would I out in my code to access it from that machine?

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

Could I just do this?

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

Upvotes: 3

Views: 2382

Answers (2)

killswtch
killswtch

Reputation: 76

In principal, what you are trying to do is correct. However, by default Neo4j will only listen on the localhost (127.0.0.1) address.

To change this, close the running instance and edit the file conf/neo4j-server.properties in a text editor.

If you want the server to listen on all IPs assigned to the host machine (normally fine for internal use), uncomment this line by removing the hash:

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

If you want to listen on a specific IP, uncomment that line and replace 0.0.0.0 with the IP you want to use.

After saving the file, start your neo4j instance up again. You should now be able to access it from both the web UI and your API wrapper of choice.

Upvotes: 6

Tatham Oddie
Tatham Oddie

Reputation: 4290

  1. Work out how to access it just from a web browser
  2. Use that URL in the constructor for GraphClient

Upvotes: 0

Related Questions