Skip to content

Commit db0679d

Browse files
Document how to move from single to cluster (#891) (#902)
This PR adds documentation on how a user can move from a deployment with a single system primary server to a cluster deployment. --------- Co-authored-by: Jack Waudby <[email protected]>
1 parent 14285c6 commit db0679d

File tree

3 files changed

+79
-0
lines changed

3 files changed

+79
-0
lines changed

modules/ROOT/content-nav.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
** Set up a cluster
120120
*** xref:clustering/setup/deploy.adoc[]
121121
*** xref:clustering/setup/analytics-cluster.adoc[]
122+
*** xref:clustering/setup/single-to-cluster.adoc[]
122123
*** xref:clustering/setup/discovery.adoc[]
123124
*** xref:clustering/setup/routing.adoc[]
124125
*** xref:clustering/setup/encryption.adoc[]

modules/ROOT/pages/clustering/index.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This chapter describes the following:
99
* Set up a cluster -- The basics of configuring and deploying a new cluster.
1010
** xref:clustering/setup/deploy.adoc[Deploy a basic cluster] -- How to set up a basic cluster.
1111
** xref:clustering/setup/analytics-cluster.adoc[Deploy an analytics cluster] -- How to deploy a special case Neo4j cluster for analytic queries.
12+
** xref:clustering/setup/single-to-cluster.adoc[Move from single server to cluster] -- This section describes how to move from a single Neo4j server to Neo4j cluster.
1213
** xref:clustering/setup/discovery.adoc[Cluster server discovery] -- How servers in a cluster discover each other.
1314
** xref:clustering/setup/routing.adoc[Leadership, routing and load balancing] -- Election of leaders, routing and load balancing.
1415
** xref:clustering/setup/encryption.adoc[Intra-cluster encryption] -- How to secure the cluster communication.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
:description: This section describes how to move from a standalone deployment to a cluster.
2+
[role=enterprise-edition]
3+
[[single-to-cluster]]
4+
= Move from a standalone deployment to a cluster
5+
6+
It is possible to move from a standalone deployment with a single `system` database to a cluster with multiple `system` primaries.
7+
In essence, this is done by dumping the `system` database from the standalone server and loading it into the other servers that are to form the cluster.
8+
The following example shows how to move from a standalone server with a single `system` primary to a cluster with three `system` primaries.
9+
10+
[NOTE]
11+
====
12+
Another deployment with a single `system` database is an **analytics cluster** with a single `system` primary.
13+
If desired to move to a cluster with multiple `system` primaries, the following example is applicable with the addition that the secondaries are discarded (this is done in the first step when the `neo4j.conf` file is modified).
14+
See xref:clustering/setup/analytics-cluster.adoc[] for more information on analytics clusters.
15+
====
16+
17+
.Move from a single `system` database to a cluster with three `system` primaries
18+
====
19+
In this example, a standalone server named `server01` is running and two additional servers, `server02` and `server03`, are to be added to form a cluster.
20+
The two additional servers are configured according to xref:clustering/setup/deploy.adoc#cluster-example-configure-a-three-primary-cluster[Configure a cluster with three servers] and are _not_ running.
21+
Neo4j Enterprise Edition is installed on all three servers.
22+
23+
Start by stopping the standalone server and once it is stopped, edit the xref:configuration/file-locations.adoc[_neo4j.conf_] file to include the discovery endpoints of itself and the servers that will form the cluster.
24+
25+
._neo4j.conf_ on server01.example.com:
26+
[source, properties]
27+
----
28+
server.default_listen_address=0.0.0.0
29+
server.default_advertised_address=server01.example.com
30+
dbms.cluster.discovery.endpoints=server01.example.com:5000,server02.example.com:5000,server03.example.com:5000
31+
initial.dbms.default_primaries_count=3
32+
----
33+
(The xref:configuration/file-locations.adoc[_neo4j.conf_] file looks identical except for the `server.default_advertised_address` on all three servers. Please refer to xref:clustering/setup/deploy.adoc#cluster-example-configure-a-three-primary-cluster[Configure a cluster with three servers] for more information.)
34+
35+
On `server01` (the standalone server) dump the `system` database using the `neo4j-admin database dump` command.
36+
37+
[source, shell, role="nocopy"]
38+
----
39+
bin/neo4j-admin database dump system --to-path=/full/path/to/dumps/
40+
----
41+
See xref:backup-restore/offline-backup.adoc[] for more information on the dump command.
42+
43+
Use the `neo4j-admin database load` command to load the `system` database dump from `server01` to `server02` and `server03`.
44+
45+
[source,shell, role="nocopy"]
46+
----
47+
./neo4j-admin database load --from-path=/full-path/data/dumps system
48+
----
49+
See xref:backup-restore/restore-dump.adoc[] for more information on the load command.
50+
51+
Once the `system` database has been loaded on `server02` and `server03`, start all servers.
52+
The newly added servers should be in the `Free` state (`server02` and `server03`) and this can be verified using `SHOW SERVERS`.
53+
54+
[source, cypher, role=noplay]
55+
----
56+
SHOW SERVERS;
57+
----
58+
59+
[queryresult]
60+
----
61+
+-----------------------------------------------------------------------------------------------------------+
62+
| name | address | state | health | hosting |
63+
+-----------------------------------------------------------------------------------------------------------+
64+
| "d6fbe54b-0c6a-4959-9bcb-dcbbe80262a4" | "server01:7687" | "Enabled" | "Available" | ["system", "neo4j"] |
65+
| "e56b49ea-243f-11ed-861d-0242ac120002" | "server02:7687" | "Free" | "Available" | ["system"] |
66+
| "73e9a990-0a97-4a09-91e9-622bf0b239a4" | "server03:7687" | "Free" | "Available" | ["system"] |
67+
+-----------------------------------------------------------------------------------------------------------+
68+
----
69+
70+
On `server01` (the previously standalone server) verify that all user databases are still running using `SHOW DATABASES`.
71+
72+
The last step is to enable the `Free` servers using `ENABLE SERVER` (see xref:clustering/servers.adoc[] for more information on server states).
73+
74+
Once all servers are enabled, you can scale up user databases using xref:clustering/databases.adoc#alter-topology[`ALTER DATABASE`], if desired.
75+
76+
====
77+

0 commit comments

Comments
 (0)