Server management command syntax

Servers can be added and managed using a set of Cypher administrative commands executed against the system database.

When connected to the DBMS over bolt, administrative commands are automatically routed to the system database.

Server management command reference

More details about the syntax descriptions can be found on the page Database management command syntax → Reading the administrative commands syntax.

Enable a server

The ENABLE SERVER command adds a server that has been discovered to the cluster. For more information, see Enabled state.

To run the command, the SERVER MANAGEMENT privilege is required. For details, see SERVER MANAGEMENT privileges.

Command Syntax

ENABLE SERVER

ENABLE SERVER 'serverId' [OPTIONS "{" option: value[,...] "}"]

Show servers

The SHOW SERVERS command shows all servers visible to the cluster. For more information, see Showing servers.

To run the command, the SHOW SERVERS or SERVER MANAGEMENT privilege is required. For details, see SERVER MANAGEMENT privileges.

Command Syntax

SHOW SERVERS

SHOW SERVER[S]
  [YIELD { * | field[, ...] } [ORDER BY field[, ...]] [SKIP n] [LIMIT n]]
  [WHERE expression]
  [RETURN field[, ...] [ORDER BY field[, ...]] [SKIP n] [LIMIT n]]

Alter server’s options

The ALTER SERVER command changes the constraints for a server. For more information, see Altering server options.

To run the command, the SERVER MANAGEMENT privilege is required. For details, see SERVER MANAGEMENT privileges.

Command Syntax

ALTER SERVER

ALTER SERVER 'name' SET OPTIONS "{" option: value[,...] "}"

Rename a server

RENAME SERVER changes the name of a server. For more information, see Renaming a server.

To run the command, the SERVER MANAGEMENT privilege is required. For details, see SERVER MANAGEMENT privileges.

Command Syntax

RENAME SERVER

RENAME SERVER 'name' TO 'newName'

Reallocate databases in a cluster

REALLOCATE DATABASES re-balances databases among the servers in the cluster. For more information, see Hosting databases on added servers and Reallocate databases using Cypher command.

The REALLOCATE DATABASES command is a cluster-level operation rather than a local server command. It serves as a database allocation tool under server management operations, responsible for re-balancing database placements across servers in a Neo4j cluster.

To run the REALLOCATE DATABASES command, the SERVER MANAGEMENT privilege is required. For details, see SERVER MANAGEMENT privileges.

Command Syntax

REALLOCATE DATABASES

[DRYRUN] REALLOCATE DATABASE[S]

Deallocate databases from a server

Before removing a server from a cluster, you have to move away all databases from this server. The DEALLOCATE DATABASES FROM SERVERS removes all standard databases from the given servers. For more information, see Deallocating databases from a server.

To run the command, the SERVER MANAGEMENT privilege is required. For details, see SERVER MANAGEMENT privileges.

Command Syntax

DEALLOCATE DATABASES FROM SERVERS

[DRYRUN] DEALLOCATE DATABASE[S] FROM SERVER[S] 'name'[, ...]

Remove a server

DROP SERVER removes a server from the cluster. The server must be in a deallocated state and must not host any databases. For more information, see Dropping a server.

To run the command, the SERVER MANAGEMENT privilege is required. For details, see SERVER MANAGEMENT privileges.

Command Syntax

DROP SERVER

DROP SERVER 'name'