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
Alternatively, starting from 5.26, you can use link:{neo4j-docs-base-uri}/cypher-manual/{page-version}/syntax/parameters[parameters] to provide the number of primaries and secondaries:
The command can only be executed successfully if the cluster's servers are able to satisfy the specified topology.
24
41
If they are not, the command results in an error.
@@ -50,6 +67,23 @@ To change the topology of the database `foo` from the previous example, the comm
50
67
----
51
68
ALTER DATABASE foo SET TOPOLOGY 2 PRIMARIES 1 SECONDARY
52
69
----
70
+
Alternatively, starting from 5.26, you can use link:{neo4j-docs-base-uri}/cypher-manual/{page-version}/syntax/parameters[parameters] to provide the number of primaries and secondaries:
71
+
72
+
.Parameters
73
+
[source,javascript, indent=0]
74
+
----
75
+
{
76
+
"dbname": "foo",
77
+
"primary": 2,
78
+
"secondary": 1
79
+
}
80
+
----
81
+
82
+
.Query
83
+
[source, cypher, indent=0]
84
+
----
85
+
ALTER DATABASE $dbname SET TOPOLOGY $primary PRIMARIES $secondary SECONDARIES
86
+
----
53
87
54
88
Like the `CREATE DATABASE` command, this command results in an error if the cluster does not contain sufficient servers to satisfy the requested topology.
55
89
@@ -75,7 +109,7 @@ Keep in mind that during such a transition, the database will be unavailable for
75
109
`ALTER DATABASE` commands are optionally idempotent, with the default behavior to fail with an error if the database does not exist.
76
110
Appending `IF EXISTS` to the command ensures that no error is returned and nothing happens should the database not exist.
77
111
78
-
If the `ALTER DATABASE` command decreases the number of allocations of a database, allocations on xref:clustering/servers.adoc#_cordoned_servers[cordoned servers] are removed first.
112
+
If the `ALTER DATABASE` command decreases the number of allocations of a database, allocations on xref:clustering/servers.adoc#cordoned-state[cordoned servers] are removed first.
79
113
80
114
.Query
81
115
[source, cypher]
@@ -401,7 +435,7 @@ In this case, the address for `server01` is `localhost:7687` and thus, the serve
401
435
The topology of `foo` is stored in the `system` database and when you create it, it is allocated according to the default topology (which can be shown with `CALL dbms.showTopologyGraphConfig`).
402
436
This may be different from the topology of `foo` when it was backed up.
403
437
If you want to ensure a certain allocation across the cluster, you can specify the desired topology with the `TOPOLOGY` clause in the `CREATE DATABASE` command.
404
-
See <<#_create_database, `CREATE DATABASE`>> for more information.
438
+
See <<create-database, `CREATE DATABASE`>> for more information.
Copy file name to clipboardExpand all lines: modules/ROOT/pages/clustering/servers.adoc
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,11 +92,12 @@ When a server is in the deallocated state, it no longer hosts any databases besi
92
92
Additionally, deallocated servers cannot have any further databases allocated to them.
93
93
Note that there is a known situation in which a previously deallocated offline server can transiently show as deallocating when restarting, it will, however, eventually return to the deallocated state without intervention.
94
94
95
+
[cordoned-state]
95
96
=== Cordoned state
96
97
97
98
The _Cordoned_ state is similar to _Deallocating_ in that servers in this state will not be allocated to host additional databases.
98
99
Unlike _Deallocating_ however, cordoned servers do not lose the databases they already host.
99
-
It is worth noting that when decreasing the number of allocations of a database, allocations on cordoned servers are removed first.
100
+
It is worth noting that when decreasing the number of allocations of a database, allocations on cordoned servers are removed first.
100
101
101
102
A server is transitioned from the _Enabled_ state to the _Cordoned_ state by executing the procedure `dbms.cluster.cordonServer`.
102
103
A server in the _Cordoned_ state may be transitioned to _Deallocating_, or back to _Enabled_.
0 commit comments