Skip to content

Commit 4fcac23

Browse files
Edit databases.adoc
1 parent bec0d66 commit 4fcac23

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

modules/ROOT/pages/clustering/databases.adoc

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@
44
[[database-management]]
55
= Managing databases in a cluster
66

7-
The number of both primary and secondary servers to host a database can be set when the database is created and altered after creation.
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.
7+
When creating a database or altering it, you can set the number of both primary and secondary servers to host your database.
8+
To specify the initial topology, use the command `CREATE DATABASE`.
9+
To change the topology once the database is created, run the `ALTER DATABASE` command.
910
If a database is no longer needed, the command `DROP DATABASE` deletes the database from the cluster.
1011

1112
[[create-database]]
1213
== `CREATE DATABASE`
1314

1415
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).
1516
The difference in a clustered environment is that the topology can be specified, i.e. how many primaries and secondaries are desired for the database.
16-
To create a database `foo` with 3 servers hosting the database in primary mode and 2 servers in secondary mode, the command looks like this:
17+
To create a database `foo` with 3 servers hosting the database in primary mode and 2 servers in secondary mode, run the following command:
1718

1819
[source, cypher]
1920
----
@@ -45,7 +46,7 @@ For example, if the cluster's servers are set up with mode constraints to contai
4546
[NOTE]
4647
====
4748
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_.
48-
After cluster startup, these values can be overwritten using the `dbms.setDefaultAllocationNumbers` procedure.
49+
After cluster startup, you can overwrite these values using the `dbms.setDefaultAllocationNumbers` procedure.
4950
====
5051

5152
[NOTE]
@@ -64,7 +65,7 @@ To alter the topology of or read/write access to a database after it has been cr
6465
[[alter-topology]]
6566
=== Alter database topology
6667

67-
To change the topology of the database `foo` from the previous example, the command can look like this:
68+
To change the topology of the database `foo` from the previous example, run the following command:
6869

6970
[source, cypher]
7071
----
@@ -98,19 +99,19 @@ Note, like `CREATE DATABASE`, the `ALTER DATABASE` command allocates the databas
9899

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

101-
It is not possible to automatically transition to a topology with a single primary host. Attempting to do so results in an error.
102+
It is not possible to automatically transition to a topology with a single primary host.
103+
Attempting to do so results in an error.
102104

103-
However, it is possible to _manually_ do this transition.
104-
The first step is to back up the database, see xref:backup-restore/index.adoc[Backup and restore] for more information.
105-
Once the database is backed up, the next step is to drop the database, see xref:database-administration/standard-databases/delete-databases.adoc[Delete databases] for more information.
106-
The last step is to either seed a cluster from the backup with the new topology, or to restore the backup on a single server.
105+
However, it is possible to _manually_ do this transition:
106+
107+
. The first step is to back up the database, see xref:backup-restore/index.adoc[Backup and restore] for more information.
108+
. Once the database is backed up, the next step is to drop the database.
109+
See xref:database-administration/standard-databases/delete-databases.adoc[Delete databases] for more details.
110+
. The last step is to either seed a cluster from the backup with the new topology, or to restore the backup on a single server.
107111
See xref:clustering/databases.adoc#cluster-seed[Seed a cluster] further on for information on seeding.
108112

109113
Also, it is possible to automatically transition _from_ a topology with a single primary host to multiple primary hosts.
110-
Keep in mind that during such a transition, the database will be unavailable for a short period of time.
111-
112-
`ALTER DATABASE` commands are optionally idempotent, with the default behavior to fail with an error if the database does not exist.
113-
Appending `IF EXISTS` to the command ensures that no error is returned and nothing happens should the database not exist.
114+
Keep in mind that during such a transition, the database is unavailable for a short period of time.
114115

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

0 commit comments

Comments
 (0)