If the opportunity arises such that you are in need of replicating your existing Causal Cluster cluster to a new hardware setup, the following can be used to allow for minimal downtime.
Let us first start with an existing 3 instance cluster with the following characteristics
and all other ports referenced are using the default values.
To add 3 new instances, for example at IP address 10.2.2.1, 10.2.2.2 and 10.2.2.3 perform the following steps
- install and create the new 3 instance cluster at IP addresses 10.2.2.1, 10.2.2.2 and 10.2.2.3.
in each of these 3 new instances conf/neo4j.conf define their ha.initial_hosts to be defined as
Start up each instance at 10.2.2.1, 10.2.2.2, and 10.2.2.3. These 3 new instances will then join the initial cluster at 10.1.1.1,
10.1.1.2 and 10.1.1.3 and copy down the
dbms.cluster.overview();will return output similar to
Once the 3 new instances have completed the copy of graph.db from master, one can then cleanly stop the 3 initial instances at
10.1.1.1, 10.1.1.2, and 10.1.1.3 via a
bin/neo4j stop. The 3 remaining instances will continue to run.
- If a Load Balancer was in front of the 3 instance cluster at 10.1.1.1, 10.1.1.2, and 10.1.1.3 it should be updated to now point to 10.2.2.1, 10.2.2.2, and 10.2.2.3.
Since the intial 3 intances have been shut down and so as to provide ability for the 3 new instances to successfully restart at
some later time, update the causal_clustering.initial_discovery_members of the new 3 instances and change
- If you are currently using the Bolt driver to connect to the cluster you would then need to update the connection string to reference a new url, for example changing bolt+routing://10.1.1.1:7678 to bolt+routing://10.2.2.1:7678