Skip to content
Merged
Changes from all commits
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
11 changes: 6 additions & 5 deletions modules/ROOT/pages/clustering/databases.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,13 @@ For example, if the cluster's servers are set up with mode constraints to contai
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_.
After cluster startup, these values can be overwritten using the `dbms.setDefaultAllocationNumbers` procedure.
====

[NOTE]
====
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]).
However, over time, or after several `CREATE DATABASE` commands have been issued, the distribution of databases can become unbalanced.
At this point you can run `REALLOCATE DATABASES` to make the cluster re-balance databases across all servers that are part of the cluster.
====


[[alter-topology]]
== `ALTER DATABASE`

Expand All @@ -52,11 +50,12 @@ ALTER DATABASE foo SET TOPOLOGY 2 PRIMARIES 1 SECONDARY

Like the `CREATE DATABASE` command, this command results in an error if the cluster does not contain sufficient servers to satisfy the requested topology.

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.
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.
Additionally, `ALTER DATABASE` is optionally idempotent and also results in an error if the database does not exist.
It is possible to append the command with `IF EXISTS` to make sure that no error is returned if the database does not exist.

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.
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.

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.

It is not possible to automatically transition to a topology with a single primary host. Attempting to do so results in an error.
Expand All @@ -73,6 +72,8 @@ Keep in mind that during such a transition, the database will be unavailable for
`ALTER DATABASE` commands are optionally idempotent, with the default behavior to fail with an error if the database does not exist.
Appending `IF EXISTS` to the command ensures that no error is returned and nothing happens should the database not exist.

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.

.Query
[source, cypher]
----
Expand Down Expand Up @@ -278,7 +279,7 @@ For this to work, Neo4j on each server in the cluster must be configured with id
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].
If this configuration is not performed, the `seedCredential` option fails.

For example, in the case of `S3SeedProvider`(the default provider): `seedCredentials: [accessKey];[secretKey]` where `accessKey` and `secretKey` are provided by AWS.
For example, in the case of `S3SeedProvider`(the default provider), `seedCredentials: [accessKey];[secretKey]` where `accessKey` and `secretKey` are provided by AWS.

==== Seed provider reference

Expand Down