Skip to content

Commit 95aa086

Browse files
Clarify clustering ports and Docker tutorial for new v2 discovery protocol
1 parent 6c22c13 commit 95aa086

File tree

3 files changed

+153
-17
lines changed

3 files changed

+153
-17
lines changed

modules/ROOT/pages/configuration/ports.adoc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ The table below shows an overview of available Neo4j-specific ports and related
2626
| HTTP | `7474` | `xref:configuration/configuration-settings.adoc#config_server.http.listen_address[server.http.listen_address]`
2727
| HTTPS | `7473` | `xref:configuration/configuration-settings.adoc#config_server.https.listen_address[server.https.listen_address]`
2828
| Bolt | `7687` | `xref:configuration/configuration-settings.adoc#config_server.bolt.listen_address[server.bolt.listen_address]`
29-
| Cluster discovery management | `5000` | `xref:configuration/configuration-settings.adoc#config_server.discovery.listen_address[server.discovery.listen_address]`
30-
| Cluster transaction | `6000` | `xref:configuration/configuration-settings.adoc#config_server.cluster.listen_address[server.cluster.listen_address]`
29+
| Cluster discovery management | `5000` | `xref:configuration/configuration-settings.adoc#config_server.discovery.listen_address[server.discovery.listen_address]` label:deprecated[Deprecated in 5.23]
30+
| Cluster transaction/discovery management for v2 | `6000` | `xref:configuration/configuration-settings.adoc#config_server.cluster.listen_address[server.cluster.listen_address]`
3131
| Cluster RAFT | `7000` | `xref:configuration/configuration-settings.adoc#config_server.cluster.raft.listen_address[server.cluster.raft.listen_address]`
3232
| Cluster routing connector | `7688` | `xref:configuration/configuration-settings.adoc#config_server.routing.listen_address[server.routing.listen_address]`
3333
| Graphite monitoring | `2003` | `xref:configuration/configuration-settings.adoc#config_server.metrics.graphite.server[server.metrics.graphite.server]`
@@ -55,8 +55,8 @@ The table below shows an overview of available Neo4j-specific ports and related
5555
| HTTP | `7474` | `xref:configuration/configuration-settings.adoc#config_server.http.advertised_address[server.http.advertised_address]`
5656
| HTTPS | `7473` | `xref:configuration/configuration-settings.adoc#config_server.https.advertised_address[server.https.advertised_address]`
5757
| Bolt | `7687` | `xref:configuration/configuration-settings.adoc#config_server.bolt.advertised_address[server.bolt.advertised_address]`
58-
| Cluster discovery management | `5000` | `xref:configuration/configuration-settings.adoc#config_server.discovery.advertised_address[server.discovery.advertised_address]`
59-
| Cluster transaction | `6000` | `xref:configuration/configuration-settings.adoc#config_server.cluster.advertised_address[server.cluster.advertised_address]`
58+
| Cluster discovery management | `5000` | `xref:configuration/configuration-settings.adoc#config_server.discovery.advertised_address[server.discovery.advertised_address]` label:deprecated[Deprecated in 5.23]
59+
| Cluster transaction/discovery management for v2 | `6000` | `xref:configuration/configuration-settings.adoc#config_server.cluster.advertised_address[server.cluster.advertised_address]` is used for the discovery service v2 since Neo4j 5.23. See xref:clustering/setup/discovery.adoc[] for more details.
6060
| Cluster RAFT | `7000` | `xref:configuration/configuration-settings.adoc#config_server.cluster.raft.advertised_address[server.cluster.raft.advertised_address]`
6161
| Cluster routing connector | `7688` | `xref:configuration/configuration-settings.adoc#config_server.routing.advertised_address[server.routing.advertised_address]`
6262
|===
@@ -83,7 +83,7 @@ Default port: `6362`
8383

8484
In production environments, external access to the backup port should be blocked by a firewall.
8585

86-
For more information, see xref:backup-restore/online-backup.adoc#backup-server-configuration[Server configuration].
86+
For more information, see xref:backup-restore/online-backup.adoc#backup-server-configuration[Backup and restore -> Server configuration].
8787

8888

8989
=== HTTP
@@ -116,7 +116,7 @@ Default port: `7474`
116116

117117
* Used by Neo4j Browser and the HTTP API.
118118

119-
For more information, see xref:configuration/connectors.adoc[Configure connectors].
119+
For more information, see xref:configuration/connectors.adoc[].
120120

121121

122122
=== HTTPS
@@ -147,7 +147,7 @@ Default port: `7473`
147147

148148
* Used by Neo4j Browser and the HTTP API.
149149

150-
For more information, see xref:configuration/connectors.adoc[Configure connectors].
150+
For more information, see xref:configuration/connectors.adoc[].
151151

152152

153153
=== Bolt
@@ -182,7 +182,7 @@ Default port: `7687`
182182

183183
* Used by Cypher Shell, Neo4j Browser, and the official Neo4j drivers.
184184

185-
For more information, see xref:configuration/connectors.adoc[Configure connectors].
185+
For more information, see xref:configuration/connectors.adoc[].
186186

187187

188188
[role=enterprise-edition]
@@ -194,8 +194,8 @@ All instances of Neo4j Enterprise will open these ports, whether or not they are
194194
[options="header"]
195195
|===
196196
| Name | Default port | Default value | Related configuration setting
197-
| Discovery management | `5000` | `:5000` | `xref:configuration/configuration-settings.adoc#config_server.discovery.listen_address[server.discovery.listen_address]`
198-
| Transaction | `6000` | `:6000` | `xref:configuration/configuration-settings.adoc#config_server.cluster.listen_address[server.cluster.listen_address]`
197+
| Discovery management | `5000` | `:5000` | `xref:configuration/configuration-settings.adoc#config_server.discovery.listen_address[server.discovery.listen_address]` label:deprecated[Deprecated in 5.23]
198+
| Transaction/Discovery management for v2 | `6000` | `:6000` | `xref:configuration/configuration-settings.adoc#config_server.cluster.listen_address[server.cluster.listen_address]` See xref:clustering/setup/discovery.adoc[].
199199
| RAFT | `7000` | `:7000` | `xref:configuration/configuration-settings.adoc#config_server.cluster.raft.listen_address[server.cluster.raft.listen_address]`
200200
| Routing connector | `7688` | `:7688` | `xref:configuration/configuration-settings.adoc#config_server.routing.listen_address[server.routing.listen_address]`
201201
|===
@@ -205,8 +205,8 @@ All instances of Neo4j Enterprise will open these ports, whether or not they are
205205
[options="header"]
206206
|===
207207
| Name | Default port | Default value | Related configuration setting
208-
| Discovery management | `5000` | `:5000` | `xref:configuration/configuration-settings.adoc#config_server.discovery.advertised_address[server.discovery.advertised_address]`
209-
| Transaction | `6000` | `:6000` | `xref:configuration/configuration-settings.adoc#config_server.cluster.advertised_address[server.cluster.advertised_address]`
208+
| Discovery management | `5000` | `:5000` | `xref:configuration/configuration-settings.adoc#config_server.discovery.advertised_address[server.discovery.advertised_address]` label:deprecated[Deprecated in 5.23]
209+
| Transaction/Discovery management for v2 | `6000` | `:6000` | `xref:configuration/configuration-settings.adoc#config_server.cluster.advertised_address[server.cluster.advertised_address]` is used for the discovery service v2 since Neo4j 5.23. See xref:clustering/setup/discovery.adoc[].
210210
| RAFT | `7000` | `:7000` | `xref:configuration/configuration-settings.adoc#config_server.cluster.raft.advertised_address[server.cluster.raft.advertised_address]`
211211
| Routing connector | `7688` | `:7688` | `xref:configuration/configuration-settings.adoc#config_server.routing.advertised_address[server.routing.advertised_address]`
212212
|===

modules/ROOT/pages/security/ssl-framework.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ The SSL framework provides support for securing the following Neo4j communicatio
1212
1313
This page describes how to set up SSL within your environment, how to view, validate, and test the certificates.
1414

15+
[NOTE]
16+
====
17+
As of Neo4j 5.23, the use of port `5000` for discovery management and discovery service v1 is deprecated.
18+
Neo4j 5.23 introduces the discovery service v2, which now utilizes the port `6000`.
19+
For more details, refer to xref:clustering/setup/discovery.adoc[Clustering -> Cluster server discovery].
20+
====
21+
1522
[[ssl-providers]]
1623
== SSL Providers
1724

modules/ROOT/pages/tutorial/tutorial-clustering-docker.adoc

Lines changed: 134 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,12 @@ For more information, see the https://docs.docker.com/compose/install/[Install D
3232

3333
*Procedure*
3434

35-
. Create a configuration file `neo4j.conf` which will be shared across cluster members and make it readable and writable for the user (eg., `chmod 640 neo4j.conf`)
35+
. Create a configuration file _neo4j.conf_ which will be shared across cluster members and make it readable and writable for the user (eg., `chmod 640 neo4j.conf`)
3636
+
37-
====
37+
[.tabbed-example]
38+
=====
39+
[role=include-with-discovery-service-v1 label--deprecated-5.23]
40+
======
3841
[source,shell,subs="attributes+, +macros"]
3942
----
4043
# Setting that specifies how much memory Neo4j is allowed to use for the page cache.
@@ -75,7 +78,55 @@ dbms.routing.default_router=SERVER
7578
# The advertised address for the intra-cluster routing connector.
7679
server.routing.advertised_address=$(hostname)
7780
----
78-
====
81+
======
82+
[role=include-with-discovery-service-v2 label--new-5.23]
83+
======
84+
[source,shell,subs="attributes+, +macros"]
85+
----
86+
# Setting that specifies how much memory Neo4j is allowed to use for the page cache.
87+
server.memory.pagecache.size=100M
88+
89+
# Setting that specifies the initial JVM heap size.
90+
server.memory.heap.initial_size=100M
91+
92+
# The behavior of the discovery service is determined by the parameters `dbms.cluster.discovery.resolver_type`, `dbms.cluster.discovery.v2.endpoints`, and `dbms.cluster.discovery.version`.
93+
# The DNS strategy fetches the IP addresses of the cluster members using the DNS A records.
94+
dbms.cluster.discovery.resolver_type=DNS
95+
96+
# The value of `dbms.cluster.discovery.version` must be set to `V2_ONLY` if you want to use the discovery service v2.
97+
# The discovery service v2 utilizes the port `6000`.
98+
99+
# The value of `dbms.cluster.discovery.V2.endpoints` should be set to a single domain name and the port of the discovery service.
100+
# The domain name returns an A record for every server in the cluster when a DNS lookup is performed.
101+
# Each A record returned by DNS should contain the IP address of the server in the cluster.
102+
# The configured server uses all the IP addresses from the A records to join or form a cluster.
103+
# The discovery port must be the same on all servers when using this configuration.
104+
dbms.cluster.discovery.V2.endpoints=neo4j-network:6000
105+
106+
# Address (the public hostname/IP address of the machine)
107+
# and port setting that specifies where this instance advertises for discovery protocol messages from other members of the cluster.
108+
server.discovery.advertised_address=$(hostname -i)
109+
110+
# Address (the public hostname/IP address of the machine)
111+
# and port setting that specifies where this instance advertises for Raft messages within the cluster.
112+
server.cluster.raft.advertised_address=$(hostname)
113+
114+
# Address (the public hostname/IP address of the machine)
115+
# and port setting that specifies where this instance advertises for requests for transactions in the transaction-shipping catch-up protocol.
116+
server.cluster.advertised_address=$(hostname)
117+
118+
# Enable server-side routing
119+
dbms.routing.enabled=true
120+
121+
# Use server-side routing for neo4j:// protocol connections.
122+
dbms.routing.default_router=SERVER
123+
124+
# The advertised address for the intra-cluster routing connector.
125+
server.routing.advertised_address=$(hostname)
126+
----
127+
======
128+
=====
129+
79130
. Prepare your _docker-compose.yml_ file using the following example.
80131
For more information, see the https://docs.docker.com/compose/compose-file/#service-configuration-reference[Docker Compose official Service configuration reference].
81132
+
@@ -272,10 +323,12 @@ Each container must have a network route to each of the others, the `+NEO4J_init
272323
The following environment variables are specific to the Neo4j cluster, and are available in the Neo4j Enterprise Edition:
273324

274325
* `+NEO4J_initial_server_mode__constraint+`: the database mode, defaults to `NONE`, can be set to `PRIMARY` or `SECONDARY`.
275-
* `+NEO4J_dbms_cluster_discovery_endpoints+`: a comma-separated list of endpoints, which a server should contact to discover other cluster servers.
326+
* `+NEO4J_dbms_cluster_discovery_endpoints+`: a comma-separated list of endpoints, which a server should contact to discover other cluster servers. label:deprecated[Deprecated in 5.23]
327+
* `+NEO4J_dbms_cluster_discovery_V2_endpoints+`: a comma-separated list of endpoints, which a server should contact to discover other cluster servers. label:new[Introduced in 5.23]
276328
* `+NEO4J_server_discovery_advertised_address+`: hostname/IP address and port to advertise for member discovery management communication.
277329
* `+NEO4J_server.cluster.advertised_address+`: hostname/IP address and port to advertise for transaction handling.
278330
* `+NEO4J_server.cluster.raft.advertised_address+`: hostname/IP address and port to advertise for cluster communication.
331+
* `+NEO4J_dbms_cluster_discovery_version+`: the discovery service version to use, defaults to `V1_ONLY`, can be set to `V1_OVER_V2`, `V2_OVER_V1`, or `V2_ONLY`. label:new[Introduced in 5.23]
279332

280333
See xref:clustering/settings.adoc[] for more details of Neo4j cluster settings.
281334

@@ -285,7 +338,12 @@ See xref:clustering/settings.adoc[] for more details of Neo4j cluster settings.
285338
Within a single Docker host, you can use the default ports for HTTP, HTTPS, and Bolt.
286339
For each container, these ports are mapped to a different set of ports on the Docker host.
287340

288-
Example of a `docker run` command for deploying a cluster with 3 servers:
341+
Example of a `docker run` command for deploying a cluster with three servers:
342+
343+
[.tabbed-example]
344+
=====
345+
[role=include-with-discovery-service-v1 label--deprecated-5.23]
346+
======
289347

290348
[source,shell,subs="attributes"]
291349
----
@@ -324,11 +382,62 @@ docker run --name=server3 --detach --network=neo4j-cluster \
324382
--env NEO4J_AUTH=neo4j/mypassword \
325383
neo4j:{neo4j-version-exact}-enterprise
326384
----
385+
======
386+
[role=include-with-discovery-service-v2 label--new-5.23]
387+
======
388+
[source,shell,subs="attributes"]
389+
----
390+
docker network create --driver=bridge neo4j-cluster
391+
392+
docker run --name=server1 --detach --network=neo4j-cluster \
393+
--publish=7474:7474 --publish=7473:7473 --publish=7687:7687 \
394+
--hostname=server1 \
395+
--env NEO4J_initial_server_mode__constraint=PRIMARY \
396+
--env NEO4J_dbms_cluster_discovery_version=V2_ONLY \
397+
--env NEO4J_dbms_cluster_discovery_v2_endpoints=server1:6000,server2:6000,server3:6000 \
398+
--env NEO4J_ACCEPT_LICENSE_AGREEMENT=yes \
399+
--env NEO4J_server_bolt_advertised__address=localhost:7687 \
400+
--env NEO4J_server_http_advertised__address=localhost:7474 \
401+
--env NEO4J_AUTH=neo4j/mypassword \
402+
neo4j:{neo4j-version-exact}-enterprise
403+
404+
docker run --name=server2 --detach --network=neo4j-cluster \
405+
--publish=8474:7474 --publish=8473:7473 --publish=8687:7687 \
406+
--hostname=server2 \
407+
--env NEO4J_initial_server_mode__constraint=PRIMARY \
408+
--env NEO4J_dbms_cluster_discovery_version=V2_ONLY \
409+
--env NEO4J_dbms_cluster_discovery_v2_endpoints=server1:6000,server2:6000,server3:6000 \
410+
--env NEO4J_ACCEPT_LICENSE_AGREEMENT=yes \
411+
--env NEO4J_server_bolt_advertised__address=localhost:8687 \
412+
--env NEO4J_server_http_advertised__address=localhost:8474 \
413+
--env NEO4J_AUTH=neo4j/mypassword \
414+
neo4j:{neo4j-version-exact}-enterprise
415+
416+
docker run --name=server3 --detach --network=neo4j-cluster \
417+
--publish=9474:7474 --publish=9473:7473 --publish=9687:7687 \
418+
--hostname=server3 \
419+
--env NEO4J_initial_server_mode__constraint=PRIMARY \
420+
--env NEO4J_dbms_cluster_discovery_version=V2_ONLY \
421+
--env NEO4J_dbms_cluster_discovery_v2_endpoints=server1:6000,server2:6000,server3:6000 \
422+
--env NEO4J_ACCEPT_LICENSE_AGREEMENT=yes \
423+
--env NEO4J_server_bolt_advertised__address=localhost:9687 \
424+
--env NEO4J_server_http_advertised__address=localhost:9474 \
425+
--env NEO4J_AUTH=neo4j/mypassword \
426+
neo4j:{neo4j-version-exact}-enterprise
427+
----
428+
======
429+
=====
430+
327431

328432
Additional servers can be added to the cluster in an ad-hoc fashion.
329433

330434
Example of a `docker run` command for adding a fourth server with a role `SECONDARY` to the cluster:
331435

436+
[.tabbed-example]
437+
=====
438+
[role=include-with-discovery-service-v1 label--deprecated-5.23]
439+
======
440+
332441
[source,shell,subs="attributes"]
333442
----
334443
docker run --name=read-server4 --detach --network=neo4j-cluster \
@@ -341,3 +450,23 @@ docker run --name=read-server4 --detach --network=neo4j-cluster \
341450
--env NEO4J_server_http_advertised__address=localhost:10474 \
342451
neo4j:{neo4j-version-exact}-enterprise
343452
----
453+
454+
======
455+
[role=include-with-discovery-service-v2 label--new-5.23]
456+
======
457+
458+
[source,shell,subs="attributes"]
459+
----
460+
docker run --name=read-server4 --detach --network=neo4j-cluster \
461+
--publish=10474:7474 --publish=10473:7473 --publish=10687:7687 \
462+
--hostname=read-server4 \
463+
--env NEO4J_initial_server_mode__constraint=SECONDARY \
464+
--env NEO4J_dbms_cluster_discovery_version=V2_ONLY \
465+
--env NEO4J_dbms_cluster_discovery_V2_endpoints=server1:6000,server2:6000,server3:6000 \
466+
--env NEO4J_ACCEPT_LICENSE_AGREEMENT=yes \
467+
--env NEO4J_server_bolt_advertised__address=localhost:10687 \
468+
--env NEO4J_server_http_advertised__address=localhost:10474 \
469+
neo4j:{neo4j-version-exact}-enterprise
470+
----
471+
======
472+
=====

0 commit comments

Comments
 (0)