From 8be75081fd2ce4bbcfd11a3517b7feaacedcaa65 Mon Sep 17 00:00:00 2001 From: Lidia Zuin <102308961+lidiazuin@users.noreply.github.com> Date: Fri, 16 Dec 2022 15:00:02 +0100 Subject: [PATCH 1/2] Adding notes about syntax to explain the use of quotation marks (#252) --- .../database-administration.adoc | 4 + .../access-control/dbms-administration.adoc | 40 ++ .../access-control/manage-privileges.adoc | 5 + .../pages/access-control/manage-roles.adoc | 5 + .../pages/access-control/manage-servers.adoc | 392 ++++++++++++++++++ .../pages/access-control/manage-users.adoc | 5 + .../access-control/privileges-reads.adoc | 4 + .../access-control/privileges-writes.adoc | 4 + modules/ROOT/pages/aliases.adoc | 6 +- .../ROOT/pages/clauses/listing-functions.adoc | 5 + .../pages/clauses/listing-procedures.adoc | 5 + .../pages/clauses/transaction-clauses.adoc | 10 + modules/ROOT/pages/constraints/syntax.adoc | 5 +- modules/ROOT/pages/databases.adoc | 6 +- .../pages/indexes-for-full-text-search.adoc | 5 + .../pages/indexes-for-search-performance.adoc | 5 + 16 files changed, 503 insertions(+), 3 deletions(-) create mode 100644 modules/ROOT/pages/access-control/manage-servers.adoc diff --git a/modules/ROOT/pages/access-control/database-administration.adoc b/modules/ROOT/pages/access-control/database-administration.adoc index 4c11dd512..7e085d436 100644 --- a/modules/ROOT/pages/access-control/database-administration.adoc +++ b/modules/ROOT/pages/access-control/database-administration.adoc @@ -57,6 +57,10 @@ This can be quite powerful as it allows permissions to be switched from one data * _role[, ...]_ ** The role or roles to associate the privilege with, comma-separated. +[NOTE] +==== +The syntax descriptions use xref:access-control/index.adoc#access-control-syntax[the style] from access control. +==== .General grant +ON DATABASE+ privilege syntax [cols="<15s,<85"] diff --git a/modules/ROOT/pages/access-control/dbms-administration.adoc b/modules/ROOT/pages/access-control/dbms-administration.adoc index 9cdeac9f1..37a3c39c0 100644 --- a/modules/ROOT/pages/access-control/dbms-administration.adoc +++ b/modules/ROOT/pages/access-control/dbms-administration.adoc @@ -141,6 +141,11 @@ a|Rows: 3 The DBMS privileges for role management are assignable using Cypher administrative commands. They can be granted, denied and revoked like other privileges. +[NOTE] +==== +The syntax descriptions use xref:access-control/index.adoc#access-control-syntax[the style] from access control. +==== + .Role management privileges command syntax [options="header", width="100%", cols="3a,2"] |=== @@ -370,6 +375,11 @@ a|Rows: 1 The DBMS privileges for user management can be assigned using Cypher administrative commands. They can be granted, denied and revoked like other privileges. +[NOTE] +==== +The syntax descriptions use xref:access-control/index.adoc#access-control-syntax[the style] from access control. +==== + .User management privileges command syntax [options="header", width="100%", cols="3a,2"] |=== @@ -697,6 +707,11 @@ Impersonation is the ability of a user to assume another user's roles (and there The ability to impersonate users can be granted via the `IMPERSONATE` privilege. +[NOTE] +==== +The syntax descriptions use xref:access-control/index.adoc#access-control-syntax[the style] from access control. +==== + .Impersonation privileges command syntax [options="header", width="100%", cols="3a,2"] |=== @@ -765,6 +780,11 @@ GRANT IMPERSONATE (alice, bob) ON DBMS TO userImpersonator The DBMS privileges for database management can be assigned by using Cypher administrative commands. They can be granted, denied and revoked like other privileges. +[NOTE] +==== +The syntax descriptions use xref:access-control/index.adoc#access-control-syntax[the style] from access control. +==== + .Database management privileges command syntax [options="header", width="100%", cols="3a,2"] |=== @@ -930,6 +950,11 @@ The DBMS privileges for alias management can be assigned by using Cypher adminis They can be granted, denied and revoked like other privileges. It is also possible to manage aliases with xref::access-control/dbms-administration.adoc#access-control-dbms-administration-database-management[database management commands]. +[NOTE] +==== +The syntax descriptions use xref:access-control/index.adoc#access-control-syntax[the style] from access control. +==== + .Alias management privileges command syntax [options="header", width="100%", cols="3a,2"] |=== @@ -1093,6 +1118,11 @@ a|Rows: 1 The DBMS privileges for privilege management can be assigned by using Cypher administrative commands. They can be granted, denied and revoked like other privileges. +[NOTE] +==== +The syntax descriptions use xref:access-control/index.adoc#access-control-syntax[the style] from access control. +==== + .Privilege management privileges command syntax [options="header", width="100%", cols="3a,2"] |=== @@ -1240,6 +1270,11 @@ a|Rows: 1 The DBMS privileges for procedure and user defined function execution can be assigned by using Cypher administrative commands. They can be granted, denied and revoked like other privileges. +[NOTE] +==== +The syntax descriptions use xref:access-control/index.adoc#access-control-syntax[the style] from access control. +==== + .Execute privileges command syntax [options="header", width="100%", cols="3a,2"] |=== @@ -1821,6 +1856,11 @@ The right to perform the following privileges can be achieved with a single comm * Execute all procedures with elevated privileges. * Execute all user defined functions with elevated privileges. +[NOTE] +==== +The syntax descriptions use xref:access-control/index.adoc#access-control-syntax[the style] from access control. +==== + [source, cypher, role=noplay] ---- GRANT ALL [[DBMS] PRIVILEGES] diff --git a/modules/ROOT/pages/access-control/manage-privileges.adoc b/modules/ROOT/pages/access-control/manage-privileges.adoc index 8c773ed8b..0488982cb 100644 --- a/modules/ROOT/pages/access-control/manage-privileges.adoc +++ b/modules/ROOT/pages/access-control/manage-privileges.adoc @@ -31,6 +31,11 @@ If a user was not also provided with the database `ACCESS` privilege, then acces Information about the database access privilege can be found in xref::access-control/database-administration.adoc#access-control-database-administration-access[The ACCESS privilege]. ==== +[NOTE] +==== +The syntax descriptions use xref:access-control/index.adoc#access-control-syntax[the style] from access control. +==== + [role=enterprise-edition] [[access-control-graph-privileges]] diff --git a/modules/ROOT/pages/access-control/manage-roles.adoc b/modules/ROOT/pages/access-control/manage-roles.adoc index 9b29d9011..8f6334cd1 100644 --- a/modules/ROOT/pages/access-control/manage-roles.adoc +++ b/modules/ROOT/pages/access-control/manage-roles.adoc @@ -17,6 +17,11 @@ When connected to the DBMS over `bolt`, administration commands are automaticall [[access-control-role-syntax]] == Role management command syntax +[NOTE] +==== +The syntax descriptions use xref:access-control/index.adoc#access-control-syntax[the style] from access control. +==== + [cols="<15s,<85"] |=== diff --git a/modules/ROOT/pages/access-control/manage-servers.adoc b/modules/ROOT/pages/access-control/manage-servers.adoc new file mode 100644 index 000000000..b892fd9eb --- /dev/null +++ b/modules/ROOT/pages/access-control/manage-servers.adoc @@ -0,0 +1,392 @@ +:description: This section explains how to use Cypher to manage servers in Neo4j. +[role=enterprise-edition] +[[server-management]] += Managing servers + + +Servers can be added and managed using a set of Cypher administration commands executed against the `system` database. + +When connected to the DBMS over `bolt`, administration commands are automatically routed to the `system` database. + + +[[server-management-syntax]] +== Server management command syntax + +[NOTE] +==== +The syntax descriptions use xref:access-control/index.adoc#access-control-syntax[the style] from access control. +==== + +[cols="<15s,<85"] +|=== +| Command +m| ENABLE SERVER + +| Syntax +a| +[source, cyper, role=noplay] +---- +ENABLE SERVER 'serverId' [OPTIONS "{" option: value[,...] "}"] +---- + +| Description +a| Adds a server that has been discovered to the cluster. +For more information see <>. + +| Required privilege +a| `GRANT SERVER MANAGEMENT` + +(see xref:access-control/dbms-administration.adoc#access-control-dbms-administration-server-management[SERVER MANAGEMENT privileges]) +|=== + +[cols="<15s,<85"] +|=== +| Command +m| ALTER SERVER + +| Syntax +a| +[source, cyper, role=noplay] +---- +ALTER SERVER 'name' SET OPTIONS "{" option: value[,...] "}" +---- + +| Description +a| Changes the constraints for a server. +For more information see <>. + +| Required privilege +a| `GRANT SERVER MANAGEMENT` + +(see xref:access-control/dbms-administration.adoc#access-control-dbms-administration-server-management[SERVER MANAGEMENT privileges]) +|=== + +[cols="<15s,<85"] +|=== +| Command +m| RENAME SERVER + +| Syntax +a| +[source, cyper, role=noplay] +---- +RENAME SERVER 'name' TO 'newName' +---- + +| Description +a| Changes the name of a server. +For more information see <>. + +| Required privilege +a| `GRANT SERVER MANAGEMENT` + +(see xref:access-control/dbms-administration.adoc#access-control-dbms-administration-server-management[SERVER MANAGEMENT privileges]) +|=== + +[cols="<15s,<85"] +|=== +| Command +m| REALLOCATE DATABASES + +| Syntax +a| +[source, cyper, role=noplay] +---- +[DRYRUN] REALLOCATE DATABASE[S] +---- + +| Description +a| Re-balances databases among the servers in the cluster. +For more information see <>. + +| Required privilege +a| `GRANT SERVER MANAGEMENT` + +(see xref:access-control/dbms-administration.adoc#access-control-dbms-administration-server-management[SERVER MANAGEMENT privileges]) +|=== + +[cols="<15s,<85"] +|=== +| Command +m| DEALLOCATE DATABASES + +| Syntax +a| +[source, cyper, role=noplay] +---- +[DRYRUN] DEALLOCATE DATABASE[S] FROM SERVER[S] 'name'[, ...] +---- + +| Description +a| Removes all databases from the given servers. +For more information see <>. + +| Required privilege +a| `GRANT SERVER MANAGEMENT` + +(see xref:access-control/dbms-administration.adoc#access-control-dbms-administration-server-management[SERVER MANAGEMENT privileges]) +|=== + +[cols="<15s,<85"] +|=== +| Command +m| DROP SERVER + +| Syntax +a| +[source, cyper, role=noplay] +---- +DROP SERVER 'name' +---- + +| Description +a| Removes a server not hosting any databases from the cluster. +For more information see <>. + +| Required privilege +a| `GRANT SERVER MANAGEMENT` + +(see xref:access-control/dbms-administration.adoc#access-control-dbms-administration-server-management[SERVER MANAGEMENT privileges]) +|=== + +[cols="<15s,<85"] +|=== +| Command +m| SHOW SERVERS + +| Syntax +a| +[source, cyper, role=noplay] +---- +SHOW SERVER[S] + [YIELD { * \| field[, ...] } [ORDER BY field[, ...]] [SKIP n] [LIMIT n]] + [WHERE expression] + [RETURN field[, ...] [ORDER BY field[, ...]] [SKIP n] [LIMIT n]] +---- + +| Description +a| Lists all servers visible to the cluster. +For more information see <>. + +| Required privilege +a| `GRANT SHOW SERVERS` + +(see xref:access-control/dbms-administration.adoc#access-control-dbms-administration-server-management[SERVER MANAGEMENT privileges]) +|=== + +[[server-management-show-servers]] +== Listing servers + +`SHOW SERVERS` displays all servers running in the cluster, including servers that have yet to be enabled as well as dropped servers. + +The table of results shows information about the servers: + +[options="header", width="100%", cols="2a,4,1,1"] +|=== +| Column +| Description +| Default output +| Full output + +| name +| Name of the server. +| {check-mark} +| {check-mark} + +| serverId +| Id of the server. +| +| {check-mark} + +| address +| Bolt address of the server (if enabled). +| {check-mark} +| {check-mark} + +| httpAddress +| Http address of the server (if enabled). +| +| {check-mark} + +| httpsAddress +| Https address of the server (if enabled). +| +| {check-mark} + +| state +| Information of the state of the server: `free`, `enabled`, `deallocating`, or `dropped`. +| {check-mark} +| {check-mark} + +| health +| The availability of the server: `available` or `unavailable`. +| {check-mark} +| {check-mark} + +| hosting +| A list of databases currently hosted on the server. +| {check-mark} +| {check-mark} + +| requestedHosting +| A list of databases that should be hosted on the server, decided by the allocator. +| +| {check-mark} + +| tags +| Tags are user provided strings that can be used while allocating databases. +| +| {check-mark} + +| allowedDatabases +| A list of databases allowed to be hosted on the server. +| +| {check-mark} + +| deniedDatabases +| A list of databases not allowed to be hosted on the server. +| +| {check-mark} + +| modeConstraint +| Constraint for the allocator to allocate only databases in this mode on the server. +| +| {check-mark} + +| version +| Neo4j version the server is running. +| +| {check-mark} +|=== + +A summary of all servers can be displayed using the command `SHOW SERVERS`. + +.Result +[options="header,footer", width="100%", cols="m,m,m,m,m"] +|=== +|name|address|state|health|hosting + +| "server1" | "localhost:20000" | "Enabled" | "Available" | ["system","neo4j"] +| "server2" | "localhost:20007" | "Enabled" | "Available" | ["system","neo4j"] +| "server3" | "localhost:20014" | "Enabled" | "Available" | ["system","neo4j"] +| "0c030000-267b-49a8-801f-78bd0b5c6445" | "localhost:20021" | "Free" | "Available" | ["system"] +|=== + +[[server-management-enable-server]] +== Enabling servers + +A server can be added to the cluster with the `ENABLE SERVER 'name'` command. +The servers initial name is its id. +The server must be in the `free` state to be added to the cluster. +If the server is already `enabled` and the command is executed with the same options specified nothing is changed. +In any other case trying to enable a server fails. + +The possible options allowed when enabling a server are: + +[options="header", width="100%", cols="2a,2,^.^"] +|=== +| Option +| Allowed values +| Description + +| modeConstraint +| `PRIMARY`, `SECONDARY`, `NONE` +| Databases may only be hosted on the server in the mode specified by the constraint. +`None` means there is no constraint and any mode is allowed. + +| allowedDatabases +| list of database names +| Only databases matching the specified names may be hosted on the server. +This may not be specified in combination with `deniedDatabases`. + +| deniedDatabases +| list of database names +| Only databases **not** matching the specified names may be hosted on the server. +This may not be specified in combination with `allowedDatabases`. +|=== + +[[server-management-alter-server]] +== Modifying servers + +The constraints on a server can be changed with `ALTER SERVER 'name' SET OPTIONS { option: value }`. +Either the name or the id of the server can be used. + +The possible options allowed when altering a server are: + +[options="header", width="100%", cols="2a,2,^.^"] +|=== +| Option +| Allowed values +| Description + +| modeConstraint +| `PRIMARY`, `SECONDARY`, `NONE` +| Databases may only be hosted on the server in the mode specified by the constraint. +`None` means there is no constraint and any mode is allowed. + +| allowedDatabases +| list of database names +| Only databases matching the specified names may be hosted on the server. +This may not be specified in combination with `deniedDatabases`. + +| deniedDatabases +| list of database names +| Only databases **not** matching the specified names may be hosted on the server. +This may not be specified in combination with `allowedDatabases`. +|=== + +[[server-management-rename-server]] +== Renaming servers + +The name of a server can be altered with `RENAME SERVER 'name' TO 'newName'`. +Either the id or current name of the server can be used to identify the server. +The new name of the server must be unique. + +[[server-management-reallocate]] +== Reallocate databases + +After enabling a server, `REALLOCATE DATABASES` can be used to make the cluster re-balance databases across all servers that are part of the cluster. +Using `DRYRUN REALLOCATE DATABASE` returns a view of how the databases would have been re-balanced if the command was executed without `DRYRUN`: + +.Result +[options="header,footer", width="100%", cols="m,m,m,m,m,m"] +|=== +|database|fromServerName|fromServerId|toServerName|toServerId|mode + +| "db1" | "server-1" | "00000000-94ff-4ede-87be-3d741b795480" | "server-4" | "00000002-25a9-4984-9ad2-dc39024c9238" | "primary" +| "db3" | "server-1" | "00000000-94ff-4ede-87be-3d741b795480" | "server-5" | "00000003-0df7-4057-81fd-1cf43c9ef5f7" | "primary" +|=== + +[NOTE] +==== +`DRYRUN` is introduced in Neo4j 5.2, and thus is not available in earlier minor releases of v5. +==== + +[[server-management-deallocate]] +== Deallocate databases + +A server can be set to not host any databases with `DEALLOCATE DATABASES FROM SERVER 'name'`, in preparation for removing the server from the cluster. +Either the id or name of the server can be used. +All databases that the server is hosting are moved to other servers. +The server changes state to `deallocating`. +A deallocated server cannot readily be enabled again. + +Multiple servers can be deallocated at the same time, `DEALLOCATE DATABASES FROM SERVER 'server-1', 'server-2'`. +The command fails if there aren't enough servers available to move the databases to. + +Using `DRYRUN DEALLOCATE DATABASES FROM 'server-1', 'server-2'` returns a view of how the databases would have been re-balanced if the command was executed without `DRYRUN`: + +.Result +[options="header,footer", width="100%", cols="m,m,m,m,m,m"] +|=== +|database|fromServerName|fromServerId|toServerName|toServerId|mode +| "db1" | "server-1" | "00000001-8c04-4731-a2fd-7b0289c511ce" | "server-4" | "00000002-5b91-43c1-8b25-5289f674563e" | "primary" +| "db1" | "server-2" | "00000000-7e53-427c-a987-24634c4745f3" | "server-5" | "00000003-0e98-44c8-9844-f0a4eb95b0d8" | "primary" +|=== + +[[server-management-drop-server]] +== Drop server + +When a server has been deallocated and is no longer hosting any databases it can be removed from the cluster with `DROP SERVER 'name'`. +Either the id or name of the server can be used. +As long as the server is running, it is listed when showing servers with the state `dropped`. diff --git a/modules/ROOT/pages/access-control/manage-users.adoc b/modules/ROOT/pages/access-control/manage-users.adoc index 8c15df491..d6afe7c4b 100644 --- a/modules/ROOT/pages/access-control/manage-users.adoc +++ b/modules/ROOT/pages/access-control/manage-users.adoc @@ -15,6 +15,11 @@ When connected to the DBMS over `bolt`, administration commands are automaticall [[access-control-user-syntax]] == User management command syntax +[NOTE] +==== +The syntax descriptions use xref:access-control/index.adoc#access-control-syntax[the style] from access control. +==== + [cols="<15s,<85"] |=== diff --git a/modules/ROOT/pages/access-control/privileges-reads.adoc b/modules/ROOT/pages/access-control/privileges-reads.adoc index 9cf03287e..dfbab438d 100644 --- a/modules/ROOT/pages/access-control/privileges-reads.adoc +++ b/modules/ROOT/pages/access-control/privileges-reads.adoc @@ -15,6 +15,10 @@ There are three separate read privileges: * xref::access-control/privileges-reads.adoc#access-control-privileges-reads-read[`READ`] - enables the specified properties of the found entities to be read. * xref::access-control/privileges-reads.adoc#access-control-privileges-reads-match[`MATCH`] - combines both `TRAVERSE` and `READ`, enabling an entity to be found and its properties read. +[NOTE] +==== +The syntax descriptions use xref:access-control/index.adoc#access-control-syntax[the style] from access control. +==== [[access-control-privileges-reads-traverse]] == The `TRAVERSE` privilege diff --git a/modules/ROOT/pages/access-control/privileges-writes.adoc b/modules/ROOT/pages/access-control/privileges-writes.adoc index 8b1b5adfd..f96a7752a 100644 --- a/modules/ROOT/pages/access-control/privileges-writes.adoc +++ b/modules/ROOT/pages/access-control/privileges-writes.adoc @@ -23,6 +23,10 @@ There are also compound privileges which combine the above specific privileges: * xref::access-control/privileges-writes.adoc#access-control-privileges-writes-write[`WRITE`] - allows all `WRITE` operations on an entire graph. * xref::access-control/privileges-writes.adoc#access-control-privileges-writes-all[`ALL GRAPH PRIVILEGES`] - allows all `READ` and `WRITE` operations on an entire graph. +[NOTE] +==== +The syntax descriptions use xref:access-control/index.adoc#access-control-syntax[the style] from access control. +==== [[access-control-privileges-writes-create]] == The `CREATE` privilege diff --git a/modules/ROOT/pages/aliases.adoc b/modules/ROOT/pages/aliases.adoc index 0625e489e..54cddb7dd 100644 --- a/modules/ROOT/pages/aliases.adoc +++ b/modules/ROOT/pages/aliases.adoc @@ -28,6 +28,11 @@ When connected to the DBMS over Bolt, administration commands are automatically The syntax of the alias management commands is as follows: +[NOTE] +==== +The syntax descriptions use xref:access-control/index.adoc#access-control-syntax[the style] from access control. +==== + .Alias management command syntax [options="header", width="100%", cols="1m,5a"] |=== @@ -117,7 +122,6 @@ DROP ALIAS name [IF EXISTS] FOR DATABASE |=== - This is the list of the allowed driver settings for remote aliases. [[remote-alias-driver-settings]] diff --git a/modules/ROOT/pages/clauses/listing-functions.adoc b/modules/ROOT/pages/clauses/listing-functions.adoc index dfbb4ce70..6963594fb 100644 --- a/modules/ROOT/pages/clauses/listing-functions.adoc +++ b/modules/ROOT/pages/clauses/listing-functions.adoc @@ -65,6 +65,11 @@ Is `null` without the xref::access-control/dbms-administration.adoc#access-contr == Syntax +[NOTE] +==== +The syntax descriptions use xref:access-control/index.adoc#access-control-syntax[the style] from access control. +==== + List functions, either all or only built-in or user-defined:: [source, syntax, role="noheader", indent=0] diff --git a/modules/ROOT/pages/clauses/listing-procedures.adoc b/modules/ROOT/pages/clauses/listing-procedures.adoc index 5f2db572f..b5fbb906c 100644 --- a/modules/ROOT/pages/clauses/listing-procedures.adoc +++ b/modules/ROOT/pages/clauses/listing-procedures.adoc @@ -65,6 +65,11 @@ a| Map of extra output, e.g. if the procedure is deprecated. == Syntax +[NOTE] +==== +The syntax descriptions use xref:access-control/index.adoc#access-control-syntax[the style] from access control. +==== + List all procedures:: [source, syntax, role="noheader", indent=0] diff --git a/modules/ROOT/pages/clauses/transaction-clauses.adoc b/modules/ROOT/pages/clauses/transaction-clauses.adoc index 312256649..772086a4f 100644 --- a/modules/ROOT/pages/clauses/transaction-clauses.adoc +++ b/modules/ROOT/pages/clauses/transaction-clauses.adoc @@ -153,6 +153,11 @@ m|STRING === Syntax +[NOTE] +==== +The syntax descriptions use xref:access-control/index.adoc#access-control-syntax[the style] from access control. +==== + List transactions on the current server:: [source, cypher, role="noheader", indent=0] @@ -297,6 +302,11 @@ m|STRING === Syntax +[NOTE] +==== +The syntax descriptions use xref:access-control/index.adoc#access-control-syntax[the style] from access control. +==== + Terminate transactions by ID on the current server:: [source, cypher, role="noheader", indent=0] diff --git a/modules/ROOT/pages/constraints/syntax.adoc b/modules/ROOT/pages/constraints/syntax.adoc index 239a7d80d..74aec966f 100644 --- a/modules/ROOT/pages/constraints/syntax.adoc +++ b/modules/ROOT/pages/constraints/syntax.adoc @@ -4,6 +4,10 @@ = Syntax :check-mark: icon:check[] +[NOTE] +==== +The syntax descriptions use xref:access-control/index.adoc#access-control-syntax[the style] from access control. +==== [[administration-constraints-syntax-create]] == Syntax for creating constraints @@ -40,7 +44,6 @@ Non-specified settings have their respective default values. Creating a constraint requires the xref::access-control/database-administration.adoc#access-control-database-administration-constraints[`CREATE CONSTRAINT` privilege]. ==== - [[administration-constraints-syntax-create-unique]] [discrete] === Create a unique node property constraint diff --git a/modules/ROOT/pages/databases.adoc b/modules/ROOT/pages/databases.adoc index 9bc2d79c0..779957369 100644 --- a/modules/ROOT/pages/databases.adoc +++ b/modules/ROOT/pages/databases.adoc @@ -15,6 +15,11 @@ These administrative commands are automatically routed to the `system` database The syntax of the database management commands is as follows: +[NOTE] +==== +The syntax descriptions use xref:access-control/index.adoc#access-control-syntax[the style] from access control. +==== + .Database management command syntax [options="header", width="100%", cols="1m,5a"] |=== @@ -80,7 +85,6 @@ DROP DATABASE name [IF EXISTS] [{DUMP\|DESTROY} [DATA]] [WAIT [n [SEC[OND[S]]]]\ |=== - [[administration-databases-show-databases]] == Listing databases diff --git a/modules/ROOT/pages/indexes-for-full-text-search.adoc b/modules/ROOT/pages/indexes-for-full-text-search.adoc index 8940d2609..4f86b5397 100644 --- a/modules/ROOT/pages/indexes-for-full-text-search.adoc +++ b/modules/ROOT/pages/indexes-for-full-text-search.adoc @@ -108,6 +108,11 @@ Full-text indexes are created with the `CREATE FULLTEXT INDEX` command. An index can be given a unique name when created (or get a generated one), which is used to reference the specific index when querying or dropping it. A full-text index applies to a list of labels or a list of relationship types, for node and relationship indexes respectively, and then a list of property names. +[NOTE] +==== +The syntax descriptions use xref:access-control/index.adoc#access-control-syntax[the style] from access control. +==== + .Syntax for creating fulltext indexes [options="header", width="100%", cols="5a, 3, 3a"] |=== diff --git a/modules/ROOT/pages/indexes-for-search-performance.adoc b/modules/ROOT/pages/indexes-for-search-performance.adoc index e45fdbc47..5bb6cc27a 100644 --- a/modules/ROOT/pages/indexes-for-search-performance.adoc +++ b/modules/ROOT/pages/indexes-for-search-performance.adoc @@ -68,6 +68,11 @@ With `IF NOT EXISTS`, no error is thrown and nothing happens should an index wit It may still throw an error if conflicting constraints exist, such as constraints with the same name or schema and backing index type. ==== +[NOTE] +==== +The syntax descriptions use xref:access-control/index.adoc#access-control-syntax[the style] from access control. +==== + .+Create a single-property index on nodes+ label:deprecated[] [options="noheader", width="100%", cols="2, 8a"] From e8396b9ce335b7602a2101d3a2dce5b800a8bf54 Mon Sep 17 00:00:00 2001 From: lidiazuin Date: Fri, 16 Dec 2022 15:32:11 +0100 Subject: [PATCH 2/2] removing page that does not exist in 4.4 --- .../pages/access-control/manage-servers.adoc | 392 ------------------ 1 file changed, 392 deletions(-) delete mode 100644 modules/ROOT/pages/access-control/manage-servers.adoc diff --git a/modules/ROOT/pages/access-control/manage-servers.adoc b/modules/ROOT/pages/access-control/manage-servers.adoc deleted file mode 100644 index b892fd9eb..000000000 --- a/modules/ROOT/pages/access-control/manage-servers.adoc +++ /dev/null @@ -1,392 +0,0 @@ -:description: This section explains how to use Cypher to manage servers in Neo4j. -[role=enterprise-edition] -[[server-management]] -= Managing servers - - -Servers can be added and managed using a set of Cypher administration commands executed against the `system` database. - -When connected to the DBMS over `bolt`, administration commands are automatically routed to the `system` database. - - -[[server-management-syntax]] -== Server management command syntax - -[NOTE] -==== -The syntax descriptions use xref:access-control/index.adoc#access-control-syntax[the style] from access control. -==== - -[cols="<15s,<85"] -|=== -| Command -m| ENABLE SERVER - -| Syntax -a| -[source, cyper, role=noplay] ----- -ENABLE SERVER 'serverId' [OPTIONS "{" option: value[,...] "}"] ----- - -| Description -a| Adds a server that has been discovered to the cluster. -For more information see <>. - -| Required privilege -a| `GRANT SERVER MANAGEMENT` - -(see xref:access-control/dbms-administration.adoc#access-control-dbms-administration-server-management[SERVER MANAGEMENT privileges]) -|=== - -[cols="<15s,<85"] -|=== -| Command -m| ALTER SERVER - -| Syntax -a| -[source, cyper, role=noplay] ----- -ALTER SERVER 'name' SET OPTIONS "{" option: value[,...] "}" ----- - -| Description -a| Changes the constraints for a server. -For more information see <>. - -| Required privilege -a| `GRANT SERVER MANAGEMENT` - -(see xref:access-control/dbms-administration.adoc#access-control-dbms-administration-server-management[SERVER MANAGEMENT privileges]) -|=== - -[cols="<15s,<85"] -|=== -| Command -m| RENAME SERVER - -| Syntax -a| -[source, cyper, role=noplay] ----- -RENAME SERVER 'name' TO 'newName' ----- - -| Description -a| Changes the name of a server. -For more information see <>. - -| Required privilege -a| `GRANT SERVER MANAGEMENT` - -(see xref:access-control/dbms-administration.adoc#access-control-dbms-administration-server-management[SERVER MANAGEMENT privileges]) -|=== - -[cols="<15s,<85"] -|=== -| Command -m| REALLOCATE DATABASES - -| Syntax -a| -[source, cyper, role=noplay] ----- -[DRYRUN] REALLOCATE DATABASE[S] ----- - -| Description -a| Re-balances databases among the servers in the cluster. -For more information see <>. - -| Required privilege -a| `GRANT SERVER MANAGEMENT` - -(see xref:access-control/dbms-administration.adoc#access-control-dbms-administration-server-management[SERVER MANAGEMENT privileges]) -|=== - -[cols="<15s,<85"] -|=== -| Command -m| DEALLOCATE DATABASES - -| Syntax -a| -[source, cyper, role=noplay] ----- -[DRYRUN] DEALLOCATE DATABASE[S] FROM SERVER[S] 'name'[, ...] ----- - -| Description -a| Removes all databases from the given servers. -For more information see <>. - -| Required privilege -a| `GRANT SERVER MANAGEMENT` - -(see xref:access-control/dbms-administration.adoc#access-control-dbms-administration-server-management[SERVER MANAGEMENT privileges]) -|=== - -[cols="<15s,<85"] -|=== -| Command -m| DROP SERVER - -| Syntax -a| -[source, cyper, role=noplay] ----- -DROP SERVER 'name' ----- - -| Description -a| Removes a server not hosting any databases from the cluster. -For more information see <>. - -| Required privilege -a| `GRANT SERVER MANAGEMENT` - -(see xref:access-control/dbms-administration.adoc#access-control-dbms-administration-server-management[SERVER MANAGEMENT privileges]) -|=== - -[cols="<15s,<85"] -|=== -| Command -m| SHOW SERVERS - -| Syntax -a| -[source, cyper, role=noplay] ----- -SHOW SERVER[S] - [YIELD { * \| field[, ...] } [ORDER BY field[, ...]] [SKIP n] [LIMIT n]] - [WHERE expression] - [RETURN field[, ...] [ORDER BY field[, ...]] [SKIP n] [LIMIT n]] ----- - -| Description -a| Lists all servers visible to the cluster. -For more information see <>. - -| Required privilege -a| `GRANT SHOW SERVERS` - -(see xref:access-control/dbms-administration.adoc#access-control-dbms-administration-server-management[SERVER MANAGEMENT privileges]) -|=== - -[[server-management-show-servers]] -== Listing servers - -`SHOW SERVERS` displays all servers running in the cluster, including servers that have yet to be enabled as well as dropped servers. - -The table of results shows information about the servers: - -[options="header", width="100%", cols="2a,4,1,1"] -|=== -| Column -| Description -| Default output -| Full output - -| name -| Name of the server. -| {check-mark} -| {check-mark} - -| serverId -| Id of the server. -| -| {check-mark} - -| address -| Bolt address of the server (if enabled). -| {check-mark} -| {check-mark} - -| httpAddress -| Http address of the server (if enabled). -| -| {check-mark} - -| httpsAddress -| Https address of the server (if enabled). -| -| {check-mark} - -| state -| Information of the state of the server: `free`, `enabled`, `deallocating`, or `dropped`. -| {check-mark} -| {check-mark} - -| health -| The availability of the server: `available` or `unavailable`. -| {check-mark} -| {check-mark} - -| hosting -| A list of databases currently hosted on the server. -| {check-mark} -| {check-mark} - -| requestedHosting -| A list of databases that should be hosted on the server, decided by the allocator. -| -| {check-mark} - -| tags -| Tags are user provided strings that can be used while allocating databases. -| -| {check-mark} - -| allowedDatabases -| A list of databases allowed to be hosted on the server. -| -| {check-mark} - -| deniedDatabases -| A list of databases not allowed to be hosted on the server. -| -| {check-mark} - -| modeConstraint -| Constraint for the allocator to allocate only databases in this mode on the server. -| -| {check-mark} - -| version -| Neo4j version the server is running. -| -| {check-mark} -|=== - -A summary of all servers can be displayed using the command `SHOW SERVERS`. - -.Result -[options="header,footer", width="100%", cols="m,m,m,m,m"] -|=== -|name|address|state|health|hosting - -| "server1" | "localhost:20000" | "Enabled" | "Available" | ["system","neo4j"] -| "server2" | "localhost:20007" | "Enabled" | "Available" | ["system","neo4j"] -| "server3" | "localhost:20014" | "Enabled" | "Available" | ["system","neo4j"] -| "0c030000-267b-49a8-801f-78bd0b5c6445" | "localhost:20021" | "Free" | "Available" | ["system"] -|=== - -[[server-management-enable-server]] -== Enabling servers - -A server can be added to the cluster with the `ENABLE SERVER 'name'` command. -The servers initial name is its id. -The server must be in the `free` state to be added to the cluster. -If the server is already `enabled` and the command is executed with the same options specified nothing is changed. -In any other case trying to enable a server fails. - -The possible options allowed when enabling a server are: - -[options="header", width="100%", cols="2a,2,^.^"] -|=== -| Option -| Allowed values -| Description - -| modeConstraint -| `PRIMARY`, `SECONDARY`, `NONE` -| Databases may only be hosted on the server in the mode specified by the constraint. -`None` means there is no constraint and any mode is allowed. - -| allowedDatabases -| list of database names -| Only databases matching the specified names may be hosted on the server. -This may not be specified in combination with `deniedDatabases`. - -| deniedDatabases -| list of database names -| Only databases **not** matching the specified names may be hosted on the server. -This may not be specified in combination with `allowedDatabases`. -|=== - -[[server-management-alter-server]] -== Modifying servers - -The constraints on a server can be changed with `ALTER SERVER 'name' SET OPTIONS { option: value }`. -Either the name or the id of the server can be used. - -The possible options allowed when altering a server are: - -[options="header", width="100%", cols="2a,2,^.^"] -|=== -| Option -| Allowed values -| Description - -| modeConstraint -| `PRIMARY`, `SECONDARY`, `NONE` -| Databases may only be hosted on the server in the mode specified by the constraint. -`None` means there is no constraint and any mode is allowed. - -| allowedDatabases -| list of database names -| Only databases matching the specified names may be hosted on the server. -This may not be specified in combination with `deniedDatabases`. - -| deniedDatabases -| list of database names -| Only databases **not** matching the specified names may be hosted on the server. -This may not be specified in combination with `allowedDatabases`. -|=== - -[[server-management-rename-server]] -== Renaming servers - -The name of a server can be altered with `RENAME SERVER 'name' TO 'newName'`. -Either the id or current name of the server can be used to identify the server. -The new name of the server must be unique. - -[[server-management-reallocate]] -== Reallocate databases - -After enabling a server, `REALLOCATE DATABASES` can be used to make the cluster re-balance databases across all servers that are part of the cluster. -Using `DRYRUN REALLOCATE DATABASE` returns a view of how the databases would have been re-balanced if the command was executed without `DRYRUN`: - -.Result -[options="header,footer", width="100%", cols="m,m,m,m,m,m"] -|=== -|database|fromServerName|fromServerId|toServerName|toServerId|mode - -| "db1" | "server-1" | "00000000-94ff-4ede-87be-3d741b795480" | "server-4" | "00000002-25a9-4984-9ad2-dc39024c9238" | "primary" -| "db3" | "server-1" | "00000000-94ff-4ede-87be-3d741b795480" | "server-5" | "00000003-0df7-4057-81fd-1cf43c9ef5f7" | "primary" -|=== - -[NOTE] -==== -`DRYRUN` is introduced in Neo4j 5.2, and thus is not available in earlier minor releases of v5. -==== - -[[server-management-deallocate]] -== Deallocate databases - -A server can be set to not host any databases with `DEALLOCATE DATABASES FROM SERVER 'name'`, in preparation for removing the server from the cluster. -Either the id or name of the server can be used. -All databases that the server is hosting are moved to other servers. -The server changes state to `deallocating`. -A deallocated server cannot readily be enabled again. - -Multiple servers can be deallocated at the same time, `DEALLOCATE DATABASES FROM SERVER 'server-1', 'server-2'`. -The command fails if there aren't enough servers available to move the databases to. - -Using `DRYRUN DEALLOCATE DATABASES FROM 'server-1', 'server-2'` returns a view of how the databases would have been re-balanced if the command was executed without `DRYRUN`: - -.Result -[options="header,footer", width="100%", cols="m,m,m,m,m,m"] -|=== -|database|fromServerName|fromServerId|toServerName|toServerId|mode -| "db1" | "server-1" | "00000001-8c04-4731-a2fd-7b0289c511ce" | "server-4" | "00000002-5b91-43c1-8b25-5289f674563e" | "primary" -| "db1" | "server-2" | "00000000-7e53-427c-a987-24634c4745f3" | "server-5" | "00000003-0e98-44c8-9844-f0a4eb95b0d8" | "primary" -|=== - -[[server-management-drop-server]] -== Drop server - -When a server has been deallocated and is no longer hosting any databases it can be removed from the cluster with `DROP SERVER 'name'`. -Either the id or name of the server can be used. -As long as the server is running, it is listed when showing servers with the state `dropped`.