Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 28 additions & 4 deletions modules/ROOT/pages/clustering/servers.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ Likewise, if `ALTER SERVER '25a7efc7-d063-44b8-bdee-f23357f89f01' SET OPTIONS {a

The possible options when altering a server are:

[options="header", width="100%", cols="2a,2,^.^"]
[options="header", width="100%", cols="1a,2,2"]
|===
| Option
| Allowed values
Expand All @@ -435,7 +435,7 @@ The possible options when altering a server are:
| modeConstraint
| `PRIMARY`, `SECONDARY`, `NONE`
| Databases may only be hosted on the server in the mode specified by the constraint.
`None` means there is no constraint and any mode is allowed.
`NONE` means there is no constraint and any mode is allowed.

| allowedDatabases
| list of database names, e.g. `["db1", "db2"]`
Expand All @@ -459,10 +459,34 @@ This may not be specified in combination with `allowedDatabases`.

As with the `DEALLOCATE DATABASES FROM SERVER ...` command, if the alteration of a server's options renders it impossible for the cluster to satisfy one or more of the databases' topologies, then the command fails and no changes are made.

[NOTE]
[IMPORTANT]
====
Input provided to `SET OPTIONS {...}` replaces **all** existing options, rather than being combined with them.
For instance if `SET OPTIONS {modeConstraint:'SECONDARY'}` is executed followed by `SET OPTIONS {allowedDatabases:['foo']}`, the execution of the second `ALTER` removes the mode constraint.

Any previously set values must be specified every time you run the `ALTER SERVER` command; otherwise they will be overwritten to defaults.

For instance, first you run the statement:

[source,cypher]
----
ALTER SERVER '25a7efc7-d063-44b8-bdee-f23357f89f01' SET OPTIONS {modeConstraint:'SECONDARY'};
----

Later you run:

[source,cypher]
----
ALTER SERVER '25a7efc7-d063-44b8-bdee-f23357f89f01' SET OPTIONS {allowedDatabases:['foo']};
----

The execution of the second `ALTER SERVER` removes the mode constraint `SECONDARY`.

If you want to keep both values `modeConstraint:'SECONDARY'` and `allowedDatabases:['foo']`, you have to explicitly set them in the options for the `ALTER SERVER` command:

[source,cypher]
----
ALTER SERVER '25a7efc7-d063-44b8-bdee-f23357f89f01' SET OPTIONS {modeConstraint:'SECONDARY', allowedDatabases:['foo']};
----
====

=== Renaming a server
Expand Down