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
In this PR, we want to add documentation for the following cluster
procedures:
```
dbms.cluster.deallocateDatabaseFromServer(server, database, dryrun)
dbms.cluster.deallocateNumberOfDatabases(server, number, dryrun)
dbms.cluster.deallocateDatabaseFromServers(servers, database, dryrun)
dbms.cluster.reallocateDatabase(database, dryrun)
dbms.cluster.reallocateNumberOfDatabases(number, dryrun)
```
We also add some scenarios in which a user might use these new
procedures for
---------
Co-authored-by: sumyiren <[email protected]>
Co-authored-by: Reneta Popova <[email protected]>
Co-authored-by: NataliaIvakina <[email protected]>
Copy file name to clipboardExpand all lines: modules/ROOT/pages/clustering/databases.adoc
+101-6Lines changed: 101 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@ The number of both primary and secondary servers to host a database can be set w
8
8
The command `CREATE DATABASE` can be used to specify the initial topology and `ALTER DATABASE` can be used to change the topology once the database is created.
9
9
If a database is no longer needed, the command `DROP DATABASE` deletes the database from the cluster.
10
10
11
+
[[create-database]]
11
12
== `CREATE DATABASE`
12
13
13
14
The command to create a database in a cluster is not significantly different from the command to create a database in a non-clustered environment (see xref:database-administration/standard-databases/create-databases.adoc[Create, start, and stop databases] for more information on database management on single servers).
@@ -35,12 +36,13 @@ However, over time, or after several `CREATE DATABASE` commands have been issued
35
36
At this point you can run `REALLOCATE DATABASES` to make the cluster re-balance databases across all servers that are part of the cluster.
36
37
====
37
38
38
-
[[alter-topology]]
39
+
[[alter-database]]
39
40
== `ALTER DATABASE`
40
41
41
42
To alter the topology of or read/write access to a database after it has been created, use the command `ALTER DATABASE`.
42
43
43
-
=== Alter topology
44
+
[[alter-topology]]
45
+
=== Alter database topology
44
46
45
47
To change the topology of the database `foo` from the previous example, the command can look like this:
46
48
@@ -91,7 +93,8 @@ ALTER DATABASE nonExisting IF EXISTS SET TOPOLOGY 1 PRIMARY 0 SECONDARY
91
93
// * `OPTIMAL_DISC_USAGE`
92
94
// * `ALL`
93
95
94
-
=== Alter access
96
+
[[alter-access]]
97
+
=== Alter database access
95
98
96
99
To alter the access to the database `foo`, the syntax looks like this:
97
100
@@ -102,14 +105,106 @@ ALTER DATABASE foo SET ACCESS {READ ONLY | READ WRITE}
102
105
103
106
By default, a newly created database has both read and write access.
104
107
108
+
[role=label--new-5.23]
109
+
[[deallocate-databases]]
110
+
== Deallocate databases
111
+
112
+
To relieve the load of a specific server(s), you can use one of the following procedures to deallocate databases causing the pressure from the server(s):
You must have the `SERVER MANAGEMENT` privilege to execute these procedures.
121
+
====
122
+
123
+
For example, `server01` hosts two small databases, `foo` and `bar`, and one very large database `baz`, while other servers contain fewer or smaller databases, and `server01` is under pressure.
124
+
125
+
You can use one of the following approaches to deallocate `baz` from `server01` or to deallocate a number of databases from `server01`:
If there is a need to rebalance database allocation across the cluster, for example if new servers have been added, use the `REALLOCATE DATABASE[S]`.
108
-
This command can be used with `DRYRUN` to preview the new allocation of databases.
163
+
To rebalance all database allocations across the cluster, for example, because you added new servers, use either procedures or Cypher commands to reallocate databases onto the new servers.
164
+
165
+
[role=label--new-5.23]
166
+
[[reallocate-databases-procedure]]
167
+
=== Reallocate databases using a procedure
168
+
169
+
You can use the procedure xref:reference/procedures.adoc#procedure_dbms_cluster_reallocateDatabase[`dbms.cluster.reallocateDatabase()`] to offload a specific database from all servers containing it onto new servers or xref:reference/procedures.adoc#procedure_dbms_cluster_reallocateNumberOfDatabases[dbms.cluster.reallocateNumberOfDatabases] to rebalance all database allocations across the cluster and relieve overloaded servers.
170
+
These procedures do not require a server name and can be executed with or without a dry run.
171
+
172
+
[NOTE]
173
+
====
174
+
You must have the `SERVER MANAGEMENT` privilege to execute these procedures.
175
+
====
176
+
177
+
For example, you add three new servers and want to move a very large database, `baz`, from all the servers containing it to the new servers.
0 commit comments