Unbind a Neo4j cluster server

You can use the neo4j-admin server unbind command to remove and archive the cluster state of a cluster server so that it can rebind to a cluster.

Syntax

The neo4j-admin server unbind command has the following syntax:

neo4j-admin server unbind [-h]
                          [--expand-commands]
                          [--verbose]
                          [--archive-cluster-state[=true|false]]
                          [--additional-config=<file>]
                          [--archive-path=<path>]

Options

The neo4j-admin server unbind command has the following options:

Option Default Description

-h, --help

Show this help message and exit.

--expand-commands

Allow command expansion in config value evaluation.

--verbose

Enable verbose output.

--archive-cluster-state

true or false (Default: false)

Enable or disable the cluster state archiving.

--additional-config

<file>

Configuration file with additional configuration.

--archive-path

<path

Destination (file or folder) of the cluster state archive.

Limitations

The Neo4j server must be shut down before running the neo4j-admin server unbind command.

Examples

You can use the neo4j-admin server 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, verify that initial.server.mode_constraint is set to NONE in neo4j.conf.

  • Seed a Neo4j cluster with existing store files:

    To seed a new cluster using the store files of another cluster, you must first run neo4j-admin server unbind on each server. For more information about seeding a Neo4j cluster, 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 server, unbind it from the cluster using neo4j-admin server unbind, and then forcefully restore the correct seeds (backups) for the databases in question. If you do not DROP or unbind before seeding, either with neo4j-admin database restore or neo4j-admin database load, the database’s store files and cluster state will be out of sync, potentially leading to logical corruptions.

  • Recover a Neo4j Cluster:

    In the event of serious failures, you may need to recover an entire cluster from backups. Before restoring those backups, you must first run neo4j-admin server unbind on each server. For more information about recovering databases from online backups, see Restore a database backup.

    You must run the neo4j-admin server unbind command on both primary and secondary servers.

Archive cluster state

To 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 server unbind --archive-path=/path/to/archive-folder --archive-cluster-state=true

The default resultant file is named:

unbound_cluster_state.<YYYYMMDDHH24MM>.zip