You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/ROOT/pages/clustering/servers.adoc
+28-4Lines changed: 28 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -426,7 +426,7 @@ Likewise, if `ALTER SERVER '25a7efc7-d063-44b8-bdee-f23357f89f01' SET OPTIONS {a
426
426
427
427
The possible options when altering a server are:
428
428
429
-
[options="header", width="100%", cols="2a,2,^.^"]
429
+
[options="header", width="100%", cols="1a,2,2"]
430
430
|===
431
431
| Option
432
432
| Allowed values
@@ -435,7 +435,7 @@ The possible options when altering a server are:
435
435
| modeConstraint
436
436
| `PRIMARY`, `SECONDARY`, `NONE`
437
437
| Databases may only be hosted on the server in the mode specified by the constraint.
438
-
`None` means there is no constraint and any mode is allowed.
438
+
`NONE` means there is no constraint and any mode is allowed.
439
439
440
440
| allowedDatabases
441
441
| list of database names, e.g. `["db1", "db2"]`
@@ -460,10 +460,34 @@ label:new[Introduced in 5.6]
460
460
461
461
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.
462
462
463
-
[NOTE]
463
+
[IMPORTANT]
464
464
====
465
465
Input provided to `SET OPTIONS {...}` replaces **all** existing options, rather than being combined with them.
466
-
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.
466
+
467
+
Any previously set values must be specified every time you run the `ALTER SERVER` command; otherwise they will be overwritten to the unset values.
468
+
469
+
For instance, you run two statements one after the other:
470
+
471
+
[source,cypher]
472
+
----
473
+
ALTER SERVER '25a7efc7-d063-44b8-bdee-f23357f89f01' SET OPTIONS {modeConstraint:'SECONDARY'};
474
+
----
475
+
476
+
[source,cypher]
477
+
----
478
+
ALTER SERVER '25a7efc7-d063-44b8-bdee-f23357f89f01' SET OPTIONS {allowedDatabases:['foo']};
479
+
----
480
+
481
+
The execution of the second `ALTER SERVER` removes the mode constraint `SECONDARY`, replacing it with `NONE`.
482
+
483
+
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:
484
+
485
+
[source,cypher]
486
+
----
487
+
ALTER SERVER '25a7efc7-d063-44b8-bdee-f23357f89f01' SET OPTIONS {modeConstraint:'SECONDARY', allowedDatabases:['foo']};
488
+
----
489
+
490
+
Always check the current configuration with `SHOW SERVERS YIELD *` and reapply unchanged options when using `ALTER SERVER`.
0 commit comments