Skip to content

Commit f7032a7

Browse files
Rewrite the introduction to the Clustering section
1 parent bc3c52b commit f7032a7

File tree

11 files changed

+453
-84
lines changed

11 files changed

+453
-84
lines changed

modules/ROOT/content-nav.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@
151151
*** xref:clustering/monitoring/show-databases-monitoring.adoc[]
152152
*** xref:clustering/monitoring/endpoints.adoc[]
153153
*** xref:clustering/monitoring/status-check.adoc[]
154-
** Resilient cluster deployment
154+
** Resilient multi-region cluster deployment
155155
*** xref:clustering/multi-region-deployment/geo-redundant-deployment.adoc[]
156156
*** xref:clustering/multi-region-deployment/multi-data-center-routing.adoc[]
157157
*** xref:clustering/multi-region-deployment/disaster-recovery.adoc[]

modules/ROOT/images/follower-writer.svg

Lines changed: 38 additions & 0 deletions
Loading
File renamed without changes.

modules/ROOT/images/operational-view_new.svg

Lines changed: 82 additions & 0 deletions
Loading

modules/ROOT/images/operational_view_new1.svg

Lines changed: 106 additions & 0 deletions
Loading

modules/ROOT/pages/backup-restore/online-backup.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,10 @@ In production environments, external access to the backup port should be blocked
374374
In a cluster topology, it is possible to take a backup from any server hosting the database to backup, and each server has two configurable ports capable of serving a backup.
375375
These ports are configured by `server.backup.listen_address` and `server.cluster.listen_address` respectively.
376376
Functionally, they are equivalent for backups, but separating them can allow some operational flexibility, while using just a single port can simplify the configuration.
377-
It is generally recommended to select secondary servers to act as backup servers since they are more numerous than primary servers in typical cluster deployments.
378-
Furthermore, the possibility of performance issues on a secondary server, caused by a large backup, does not affect the performance or redundancy of the primary servers.
379-
If a secondary server is not available, then a primary can be selected based on factors, such as its physical proximity, bandwidth, performance, and liveness.
377+
378+
It is generally recommended to select secondary database copies to act as backup resources since they are more numerous than primary copies in typical cluster deployments.
379+
Furthermore, the possibility of performance issues on a secondary database allocation, caused by a large backup, does not affect the performance or redundancy of the primaries.
380+
If a secondary is not available, then a primary can be selected based on factors, such as its physical proximity, bandwidth, performance, and liveness.
380381

381382
[NOTE]
382383
====

modules/ROOT/pages/clustering/databases.adoc

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
[[database-management]]
55
= Managing databases in a cluster
66

7-
When creating a database or altering it after creation, 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`.
7+
When creating a database or altering it after creation, you can specify its role: `primary` or `secondary`.
8+
To specify the initial database topology, use the Cypher command `CREATE DATABASE`.
99
To change the topology once the database is created, run the `ALTER DATABASE` command.
10+
Note that the database role must be aligned with the server’s `modeConstraint`, which value can be `PRIMARY`, or `SECONDARY`, or `NONE`.
11+
1012
If a database is no longer needed, the command `DROP DATABASE` deletes the database from the cluster.
1113

1214
[[cluster-system-db]]
@@ -18,6 +20,7 @@ When connected to this database you can only perform a specific set of administr
1820
In the clustered environment, the `system` database can be in a primary or secondary mode.
1921
To configure its mode, use the xref:configuration/configuration-settings.adoc#config_server.cluster.system_database_mode[`server.cluster.system_database_mode`] setting in the _neo4j.conf_ file.
2022
This has to be done before starting the Neo4j process.
23+
For guidelines on how to choose the mode for the `system` database, see xref:clustering/introduction.adoc#primaries-secondaries-for-system-db[Introduction -> Primaries and secondaries for the `system` database].
2124

2225
Deploying a cluster for the first time, consider configuring the xref:configuration/configuration-settings.adoc#config_dbms.cluster.minimum_initial_system_primaries_count[`dbms.cluster.minimum_initial_system_primaries_count`].
2326
This setting defaults to `3`.
@@ -26,13 +29,16 @@ See xref:clustering/setup/deploy.adoc[] for details.
2629
For information on how to recover the `system` database, refer to the xref:clustering/multi-region-deployment/disaster-recovery.adoc[Disaster recovery guide].
2730

2831

29-
3032
[[create-database]]
31-
== `CREATE DATABASE`
33+
== Create databases
34+
35+
The command to create a standard database in a cluster is not significantly different from the command to create a database in a non-clustered environment.
36+
See xref:database-administration/standard-databases/create-databases.adoc[] for more information on database management on single servers.
37+
38+
The difference in a clustered environment is that the database topology can be specified, i.e. how many primaries and secondaries are desired for the database.
39+
For more details on how many primaries and secondaries it is recommended to have, see xref:clustering/introduction.adoc[].
3240

33-
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).
34-
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.
35-
To create a database `foo` with 3 servers hosting the database in primary mode and 2 servers in secondary mode, run the following command:
41+
To create a database `foo` with three primaries and two secondaries, run the following Cypher command:
3642

3743
[source, cypher]
3844
----
@@ -59,26 +65,24 @@ CREATE DATABASE $dbname TOPOLOGY $primary PRIMARIES $secondary SECONDARIES
5965

6066
The command can only be executed successfully if the cluster's servers are able to satisfy the specified topology.
6167
If they are not, the command results in an error.
62-
For example, if the cluster's servers are set up with mode constraints to contain two primaries and three secondaries, or if only four servers exist, the command fails with an error.
68+
For example, if only four servers exist, the command fails with an error.
69+
Also, it fails if two servers are set up with a mode constraint of primary, and three servers are set up with a mode constraint of secondary.
6370

64-
[NOTE]
65-
====
66-
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_.
67-
After cluster startup, you can overwrite these values using the `dbms.setDefaultAllocationNumbers` procedure.
68-
====
71+
If `TOPOLOGY` is not specified, the database is created according to xref:configuration/configuration-settings.adoc#config_initial.dbms.default_primaries_count[`initial.dbms.default_primaries_count`] and xref:configuration/configuration-settings.adoc#config_initial.dbms.default_secondaries_count[`initial.dbms.default_secondaries_count`] specified in _neo4j.conf_.
72+
After cluster startup, you can overwrite these values using the xref:procedures.adoc#procedure_dbms_setDefaultAllocationNumbers[`dbms.setDefaultAllocationNumbers()`] procedure.
6973

70-
[NOTE]
71-
====
72-
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]).
74+
A `CREATE DATABASE` command allocates the database, therefore there is no requirement to run `REALLOCATE DATABASES` (described in xref:clustering/servers.adoc#_hosting_databases_on_added_servers[Hosting databases on added servers]).
7375

7476
However, over time, or after several `CREATE DATABASE` commands have been issued, the distribution of databases can become unbalanced.
7577
At this point you can run `REALLOCATE DATABASES` to make the cluster re-balance databases across all servers that are part of the cluster.
76-
====
78+
7779

7880
[[alter-database]]
79-
== `ALTER DATABASE`
81+
== Modify database topology and read/write access
82+
83+
To alter the topology of or read/write access to a database after its creation, use the command `ALTER DATABASE`.
8084

81-
To alter the topology of or read/write access to a database after it has been created, use the command `ALTER DATABASE`.
85+
For information about the command syntax, see xref:database-administration/standard-databases/alter-databases.adoc[].
8286

8387
[[alter-topology]]
8488
=== Alter database topology
@@ -89,6 +93,7 @@ To change the topology of the database `foo` from the previous example, run the
8993
----
9094
ALTER DATABASE foo SET TOPOLOGY 2 PRIMARIES 1 SECONDARY
9195
----
96+
9297
Alternatively, you can use link:{neo4j-docs-base-uri}/cypher-manual/current/syntax/parameters[parameters] to provide the number of primaries and secondaries:
9398

9499
.Parameters
@@ -107,7 +112,7 @@ Alternatively, you can use link:{neo4j-docs-base-uri}/cypher-manual/current/synt
107112
ALTER DATABASE $dbname SET TOPOLOGY $primary PRIMARIES $secondary SECONDARIES
108113
----
109114

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

112117
Additionally, `ALTER DATABASE` is optionally idempotent and also results in an error if the database does not exist.
113118
It is possible to append the command with `IF EXISTS` to make sure that no error is returned if the database does not exist.

modules/ROOT/pages/clustering/index.adoc

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,33 @@
55

66
This chapter describes the following:
77

8-
* xref:clustering/introduction.adoc[Introduction] -- An overview of the clustering architecture.
9-
* Setting up a cluster -- The basics of configuring and deploying a new cluster.
8+
* xref:clustering/introduction.adoc[Introduction: Neo4j clustering architecture] -- An overview of Neo4j clustering basics.
9+
10+
* **Setting up a cluster** -- The basics of configuring and deploying a new cluster.
1011
** xref:clustering/setup/deploy.adoc[Deploy a basic cluster] -- How to set up a basic cluster.
1112
** xref:clustering/setup/analytics-cluster.adoc[Deploy an analytics cluster] -- How to deploy a special case Neo4j cluster for analytic queries.
1213
** xref:clustering/setup/single-to-cluster.adoc[Move from a standalone deployment to a cluster] -- This section describes how to move from a single Neo4j server to Neo4j cluster.
1314
** xref:clustering/setup/reconciler.adoc[Reconciler] -- An internal component that observes the requested state of a server and makes changes to the server to match that state.
1415
** xref:clustering/setup/discovery.adoc[Cluster server discovery] -- How servers in a cluster discover each other and form a cluster.
1516
** xref:clustering/setup/routing.adoc[Leadership, routing and load balancing] -- Election of leaders, routing and load balancing.
1617
** xref:clustering/setup/encryption.adoc[Intra-cluster encryption] -- How to secure the cluster communication.
18+
1719
* xref:clustering/servers.adoc[Managing servers in a cluster] -- How to manage the servers in a cluster.
1820
* xref:clustering/unbind.adoc[Unbind a server] -- How to remove and archive the cluster state of a cluster server so that it can rebind to a cluster.
1921
* xref:clustering/databases.adoc[Managing databases in a cluster] -- How to manage the databases in a cluster.
2022
* xref:clustering/unbind-system-database.adoc[Unbind the `system` database] -- How to remove and archive the cluster state for the `system` database.
21-
* Monitoring -- Monitoring of a cluster.
23+
24+
* **Monitoring** -- Monitoring of a cluster.
2225
** xref:clustering/monitoring/show-servers-monitoring.adoc[Monitor servers] -- The tools available for monitoring the servers in a cluster.
2326
** xref:clustering/monitoring/show-databases-monitoring.adoc[Monitor databases] -- The tools available for monitoring the databases in a cluster.
2427
** xref:clustering/monitoring/endpoints.adoc[Monitor cluster endpoints for status information] -- The endpoints and semantics of endpoints used to monitor the health of the cluster.
2528
** xref:clustering/monitoring/status-check.adoc[Monitor replication status] -- The procedure to monitor which members of a clustered database are up-to-date and can participate in a successful replication.
26-
* Resilient cluster deployment -- Recommendations and guidance on how to set up a resilient cluster which ensures your database stays available, fast, and recoverable even under failures.
29+
30+
* **Resilient multi-region cluster deployment** -- Recommendations and guidance on how to set up a resilient cluster which ensures your database stays available, fast, and recoverable even under failures.
2731
** xref:clustering/multi-region-deployment/geo-redundant-deployment.adoc[] -- Recommended patterns of cluster deployment across multiple cloud regions / data centers.
2832
** xref:clustering/multi-region-deployment/multi-data-center-routing.adoc[Multi-data center routing] -- Clusters on multi-data centers.
2933
** xref:clustering/multi-region-deployment/disaster-recovery.adoc[Disaster recovery] -- How to recover a cluster in the event of a disaster.
34+
3035
* xref:clustering/settings.adoc[Settings reference] -- A summary of the most important cluster settings.
3136
* xref:clustering/server-syntax.adoc[Server commands reference] -- Reference of Cypher administrative commands to add and manage servers.
3237
* xref:clustering/glossary.adoc[Clustering glossary] -- A glossary of terms related to the Neo4j clustering.

0 commit comments

Comments
 (0)