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