Unbind a Neo4j cluster server
Command
The cluster state of a Causal Cluster member can be removed by using the following command:
Syntax
neo4j-admin unbind [--verbose] [--expand-commands] [--archive-cluster-state=<true/false>] [--archive-path=<path>]
Examples of usage
You can use the neo4j-admin unbind
command to:
-
Turn a cluster member into a standalone server:
To start the Neo4j server in single (standalone) mode after unbinding it from the cluster, first set
dbms.mode=SINGLE
in neo4j.conf. -
Seed a Causal Cluster with existing store files:
To seed a new cluster using the store files of another cluster, you must first run
neo4j-admin unbind
on each server. For more information about seeding Causal Clusters, see Seed a cluster.If a cluster holds a previous version of any of the databases being seeded, you must
DROP
those databases before seeding. Alternatively, you can stop every instance, unbind them from the cluster using neo4j-admin unbind and then forcefully restore the correct seeds (backups) for the databases in question. If you do notDROP
orunbind
before seeding, either withneo4j-admin restore
orneo4j-admin load
, the database’s store files and cluster state will be out of sync, potentially leading to logical corruptions. -
Recover a Causal Cluster:
In the event of serious failures you may need to recover an entire Causal Cluster from backups. Before restoring those backups, you must first run
neo4j-admin unbind
on each server. For more information about recovering databases from online backups, see Restore a database backup.From Neo4j version 4.0.0 onwards, you must run the
neo4j-admin unbind
command on both Read Replicas and Core members.
Archive cluster state
If something goes wrong and debugging is needed, you can archive the cluster state, from the <neo4j-home> folder, run the neo4j-admin server unbind
command with the arguments --archive-cluster-state=true
and --archive-path=<destination-folder>
:
bin/neo4j-admin unbind --archive-path=/path/to/archive-folder --archive-cluster-state=true
The default resultant file is named:
unbound_cluster_state.<YYYYMMDDHH24MM>.zip