Skip to content

Commit c5dc708

Browse files
renetapopovaAlexicaWrightJPryce-Aklundh
authored
porting content (#1079) (#1142)
Co-authored-by: Jessica Wright <[email protected]> Co-authored-by: Jens Pryce-Åklundh <[email protected]>
1 parent 10c2ccb commit c5dc708

File tree

4 files changed

+388
-28
lines changed

4 files changed

+388
-28
lines changed

modules/ROOT/content-nav.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@
144144
** xref:clustering/disaster-recovery.adoc[]
145145
//** xref:clustering/internals.adoc[]
146146
** xref:clustering/settings.adoc[]
147+
** xref:clustering/server-syntax.adoc[]
147148
** xref:clustering/clustering-advanced/index.adoc[]
148149
*** xref:clustering/clustering-advanced/default-database.adoc[]
149150
*** xref:clustering/clustering-advanced/multi-data-center-routing.adoc[]

modules/ROOT/pages/clustering/databases.adoc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ ALTER DATABASE foo SET TOPOLOGY 2 PRIMARIES 1 SECONDARY
5252

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

55+
Additionally, `ALTER DATABASE` is optionally idempotent and also results in an error if the database does not exist.
56+
It is possible to append the command with `IF EXISTS` to make sure that no error is returned if the database does not exist.
57+
5558
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.
5659
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.
5760
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.
@@ -99,6 +102,27 @@ ALTER DATABASE foo SET ACCESS {READ ONLY | READ WRITE}
99102

100103
By default, a newly created database has both read and write access.
101104

105+
== Reallocate databases
106+
107+
If there is a need to rebalance database allocation across the cluster, for example if new servers have been added, use the `REALLOCATE DATABASE[S]`.
108+
This command can be used with `DRYRUN` to preview the new allocation of databases.
109+
110+
[NOTE]
111+
====
112+
`DRYRUN` is introduced in Neo4j 5.2 and thus does not work in previous versions.
113+
====
114+
115+
[source,cypher]
116+
----
117+
neo4j@neo4j> DRYRUN REALLOCATE DATABASES;
118+
+----------------------------------------------------------------------------------------------------------------------------------------+
119+
| database | fromServerName | fromServerId | toServerName | toServerId | mode |
120+
+----------------------------------------------------------------------------------------------------------------------------------------+
121+
| "bar" | "server-1" | "00000000-27e1-402b-be79-d28047a9418a" | "server-5" | "00000003-b76c-483f-b2ca-935a1a28f3db" | "primary" |
122+
| "bar" | "server-3" | "00000001-7a21-4780-bb83-cee4726cb318" | "server-4" | "00000002-14b5-4d4c-ae62-56845797661a" | "primary" |
123+
+----------------------------------------------------------------------------------------------------------------------------------------+
124+
----
125+
102126
[[cluster-seed]]
103127
== Seed a cluster
104128

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
:description: This section provides a summary of server management Cypher syntax.
2+
[role=enterprise-edition]
3+
[[server-commands-reference]]
4+
= Server commands reference
5+
6+
Servers can be added and managed using a set of Cypher administration commands executed against the `system` database.
7+
8+
When connected to the DBMS over `bolt`, administration commands are automatically routed to the `system` database.
9+
10+
11+
[[server-management-syntax]]
12+
== Server management command syntax
13+
14+
[NOTE]
15+
====
16+
More details about the syntax descriptions can be found xref:database-administration/syntax.adoc[here].
17+
====
18+
19+
[cols="<15s,<85"]
20+
|===
21+
| Command
22+
m| ENABLE SERVER
23+
24+
| Syntax
25+
a|
26+
[source, syntax, role=noheader]
27+
----
28+
ENABLE SERVER 'serverId' [OPTIONS "{" option: value[,...] "}"]
29+
----
30+
31+
| Description
32+
a| Adds a server that has been discovered to the cluster.
33+
For more information see xref:clustering/servers.adoc#server-enabled-state[Enabled state].
34+
35+
| Required privilege
36+
a| `GRANT SERVER MANAGEMENT`
37+
38+
(see xref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-privilege-management[SERVER MANAGEMENT privileges])
39+
|===
40+
41+
[cols="<15s,<85"]
42+
|===
43+
| Command
44+
m| ALTER SERVER
45+
46+
| Syntax
47+
a|
48+
[source, syntax, role=noheader]
49+
----
50+
ALTER SERVER 'name' SET OPTIONS "{" option: value[,...] "}"
51+
----
52+
53+
| Description
54+
a| Changes the constraints for a server.
55+
For more information see xref:clustering/servers.adoc#alter-server-options[Altering server options].
56+
57+
| Required privilege
58+
a| `GRANT SERVER MANAGEMENT`
59+
60+
(see xref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-privilege-management[SERVER MANAGEMENT privileges])
61+
|===
62+
63+
[cols="<15s,<85"]
64+
|===
65+
| Command
66+
m| RENAME SERVER
67+
68+
| Syntax
69+
a|
70+
[source, syntax, role=noheader]
71+
----
72+
RENAME SERVER 'name' TO 'newName'
73+
----
74+
75+
| Description
76+
a| Changes the name of a server.
77+
For more information see xref:clustering/servers.adoc#_renaming_a_server[Renaming a server].
78+
79+
| Required privilege
80+
a| `GRANT SERVER MANAGEMENT`
81+
82+
(see xref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-privilege-management[SERVER MANAGEMENT privileges])
83+
|===
84+
85+
86+
[cols="<15s,<85"]
87+
|===
88+
| Command
89+
m| DEALLOCATE DATABASES
90+
91+
| Syntax
92+
a|
93+
[source, syntax, role=noheader]
94+
----
95+
[DRYRUN] DEALLOCATE DATABASE[S] FROM SERVER[S] 'name'[, ...]
96+
----
97+
98+
| Description
99+
a| Removes all databases from the given servers.
100+
For more information see xref:clustering/servers.adoc#_deallocating_databases_from_a_server[Deallocating databases from server].
101+
102+
| Required privilege
103+
a| `GRANT SERVER MANAGEMENT`
104+
105+
(see xref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-privilege-management[SERVER MANAGEMENT privileges])
106+
|===
107+
108+
[cols="<15s,<85"]
109+
|===
110+
| Command
111+
m| DROP SERVER
112+
113+
| Syntax
114+
a|
115+
[source, syntax, role=noheader]
116+
----
117+
DROP SERVER 'name'
118+
----
119+
120+
| Description
121+
a| Removes a server not hosting any databases from the cluster.
122+
For more information see xref:clustering/servers.adoc#_dropping_a_server[Dropping a server].
123+
124+
| Required privilege
125+
a| `GRANT SERVER MANAGEMENT`
126+
127+
(see xref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-privilege-management[SERVER MANAGEMENT privileges])
128+
|===
129+
130+
[cols="<15s,<85"]
131+
|===
132+
| Command
133+
m| SHOW SERVERS
134+
135+
| Syntax
136+
a|
137+
[source, syntax, role=noheader]
138+
----
139+
SHOW SERVER[S]
140+
[YIELD { * \| field[, ...] } [ORDER BY field[, ...]] [SKIP n] [LIMIT n]]
141+
[WHERE expression]
142+
[RETURN field[, ...] [ORDER BY field[, ...]] [SKIP n] [LIMIT n]]
143+
----
144+
145+
| Description
146+
a| Lists all servers visible to the cluster.
147+
For more information see xref:clustering/servers.adoc#_listing_servers[Listing servers].
148+
149+
| Required privilege
150+
a| `GRANT SHOW SERVERS`
151+
152+
(see xref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-privilege-management[SERVER MANAGEMENT privileges])
153+
|===
154+
155+
[cols="<15s,<85"]
156+
|===
157+
| Command
158+
m| REALLOCATE DATABASES
159+
160+
| Syntax
161+
a|
162+
[source, syntax, role=noheader]
163+
----
164+
[DRYRUN] REALLOCATE DATABASE[S]
165+
----
166+
167+
| Description
168+
a| Re-balances databases among the servers in the cluster.
169+
For more information see xref:clustering/servers.adoc#_hosting_databases_on_added_servers[Hosting databases on added servers].
170+
171+
Note that is a cluster-level command, not a server-level command.
172+
173+
| Required privilege
174+
a| `GRANT SERVER MANAGEMENT`
175+
176+
(see xref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-privilege-management[SERVER MANAGEMENT privileges])
177+
|===

0 commit comments

Comments
 (0)