Set up an HA clusterDeprecated
Download and configure
-
Download Neo4j Enterprise Edition from the Neo4j download site, and unpack on three separate machines.
-
Configure the HA related settings for each installation as outlined below. Note that all three installations have the same configuration except for the
ha.server_id
property.
Neo4j instance #1 on the server named neo4j-01.local
# Unique server id for this Neo4j instance
# can not be negative id and must be unique
ha.server_id=1
# List of other known instances in this cluster
ha.initial_hosts=neo4j-01.local:5001,neo4j-02.local:5001,neo4j-03.local:5001
# Alternatively, use IP addresses:
#ha.initial_hosts=192.168.0.20:5001,192.168.0.21:5001,192.168.0.22:5001
# HA - High Availability
# SINGLE - Single mode, default.
dbms.mode=HA
# HTTP Connector
dbms.connector.http.enabled=true
dbms.connector.http.listen_address=:7474
Neo4j instance #2 on the server named neo4j-02.local
# Unique server id for this Neo4j instance
# can not be negative id and must be unique
ha.server_id=2
# List of other known instances in this cluster
ha.initial_hosts=neo4j-01.local:5001,neo4j-02.local:5001,neo4j-03.local:5001
# Alternatively, use IP addresses:
#ha.initial_hosts=192.168.0.20:5001,192.168.0.21:5001,192.168.0.22:5001
# HA - High Availability
# SINGLE - Single mode, default.
dbms.mode=HA
# HTTP Connector
dbms.connector.http.enabled=true
dbms.connector.http.listen_address=:7474
Neo4j instance #3 on the server named neo4j-03.local
# Unique server id for this Neo4j instance
# can not be negative id and must be unique
ha.server_id=3
# List of other known instances in this cluster
ha.initial_hosts=neo4j-01.local:5001,neo4j-02.local:5001,neo4j-03.local:5001
# Alternatively, use IP addresses:
#ha.initial_hosts=192.168.0.20:5001,192.168.0.21:5001,192.168.0.22:5001
# HA - High Availability
# SINGLE - Single mode, default.
dbms.mode=HA
# HTTP Connector
dbms.connector.http.enabled=true
dbms.connector.http.listen_address=:7474
Start the Neo4j Servers
Start the Neo4j servers as usual. Note that the startup order does not matter.
neo4j-01$ ./bin/neo4j start
neo4j-02$ ./bin/neo4j start
neo4j-03$ ./bin/neo4j start
Startup Time
When running in HA mode, the startup script returns immediately instead of waiting for the server to become available.
The database will be unavailable until all members listed in |
Now, you should be able to access the three servers and check their HA status.
Open the locations below in a web browser and issue the following command in the editor after having set a password for the database:
:play sysinfo
-
http://neo4j-01.local:7474/
-
http://neo4j-02.local:7474/
-
http://neo4j-03.local:7474/
You can replace database #3 with an 'arbiter' instance, see Arbiter instances. |
That is it! You now have a Neo4j HA cluster of three instances running. You can start by making a change on any instance and those changes will be propagated between them. For more cluster related configuration options take a look at Setup and configuration.