Running multiple instances of Neo4j over a single machine
Many times, there will be a need to run multiple instances of Neo4j over a single machine.
In this recipe, you will learn about how to run multiple instances of Neo4j.
Getting ready
To get started with this recipe, install Neo4j by using the steps from the earlier recipes of this chapter.
How to do it...
Neo4j can handle only a single graph instance. To run multiple graph instances, you have to run multiple Neo4j servers over the same machine, as follows:
- Replicate the configuration file for each instance and change the following parameters:
org.neo4j.server.database.location=data/graph.db
Change this path for each instance by setting different database paths for different instances. Also, for each instance, set different ports for the web console, which is shown in the following parameter:
org.neo4j.server.webserver.port=5678
- Now, restart the Neo4j server by using the following command:
./neo4j restart
How it works...
Neo4j can handle only one instance at a time. In order to run multiple instances of Neo4j, we have to replicate the files and change the graph database directory of each instance.
See also
To know more about the configuration options, check out http://neo4j.com/docs/stable/server-configuration.html.