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/databases.adoc
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,15 +27,13 @@ For example, if the cluster's servers are set up with mode constraints to contai
27
27
If `TOPOLOGY` is not specified, the database is created according to `initial.dbms.default_primaries_count` and `initial.dbms.default_secondaries_count` specified in _neo4j.conf_.
28
28
After cluster startup, these values can be overwritten using the `dbms.setDefaultAllocationNumbers` procedure.
29
29
====
30
-
31
30
[NOTE]
32
31
====
33
32
A `CREATE DATABASE` command allocates the database, therefore there is no requirement to execute `REALLOCATE DATABASES` (described in xref:clustering/servers.adoc#_hosting_databases_on_added_servers[Hosting databases on added servers]).
34
33
However, over time, or after several `CREATE DATABASE` commands have been issued, the distribution of databases can become unbalanced.
35
34
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
35
====
37
36
38
-
39
37
[[alter-topology]]
40
38
== `ALTER DATABASE`
41
39
@@ -52,11 +50,12 @@ ALTER DATABASE foo SET TOPOLOGY 2 PRIMARIES 1 SECONDARY
52
50
53
51
Like the `CREATE DATABASE` command, this command results in an error if the cluster does not contain sufficient servers to satisfy the requested topology.
54
52
55
-
When there is more than one possible permutation of the specified topology, Neo4j uses an allocator to decide how to spread the database across the cluster.
56
-
Note, like `CREATE DATABASE`, the `ALTER DATABASE` command allocates the database and there is no requirement to execute `REALLOCATE DATABASES` unless there is a desire to re-balance databases across all servers that are part of the cluster.
53
+
Additionally, `ALTER DATABASE` is optionally idempotent and also results in an error if the database does not exist.
54
+
It is possible to append the command with `IF EXISTS` to make sure that no error is returned if the database does not exist.
57
55
58
56
When there is more than one possible permutation of the specified topology, Neo4j uses an allocator to decide how to spread the database across the cluster.
59
57
Note, like `CREATE DATABASE`, the `ALTER DATABASE` command allocates the database and there is no requirement to execute `REALLOCATE DATABASES` unless there is a desire to re-balance databases across all servers that are part of the cluster.
58
+
60
59
This normally happens when the cluster is configured with more servers than the sum of the number of primaries and secondaries for any one database.
61
60
62
61
It is not possible to automatically transition to a topology with a single primary host. Attempting to do so results in an error.
@@ -73,6 +72,8 @@ Keep in mind that during such a transition, the database will be unavailable for
73
72
`ALTER DATABASE` commands are optionally idempotent, with the default behavior to fail with an error if the database does not exist.
74
73
Appending `IF EXISTS` to the command ensures that no error is returned and nothing happens should the database not exist.
75
74
75
+
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.
76
+
76
77
.Query
77
78
[source, cypher]
78
79
----
@@ -278,7 +279,7 @@ For this to work, Neo4j on each server in the cluster must be configured with id
278
279
This is identical to the configuration required by remote aliases, see xref:database-administration/aliases/remote-database-alias-configuration.adoc#remote-alias-config-DBMS_admin-A[Configuration of DBMS with remote database alias].
279
280
If this configuration is not performed, the `seedCredential` option fails.
280
281
281
-
For example, in the case of `S3SeedProvider`(the default provider): `seedCredentials: [accessKey];[secretKey]` where `accessKey` and `secretKey` are provided by AWS.
282
+
For example, in the case of `S3SeedProvider`(the default provider), `seedCredentials: [accessKey];[secretKey]` where `accessKey` and `secretKey` are provided by AWS.
0 commit comments