Skip to content

Commit c6dc55b

Browse files
Clarify clustering ports and Docker tutorial for new v2 discovery protocol (#1857) (#1868)
Co-authored-by: Nick Giles <[email protected]>
1 parent 4b218ed commit c6dc55b

File tree

3 files changed

+155
-19
lines changed

3 files changed

+155
-19
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 v1 | `5000` | `xref:configuration/configuration-settings.adoc#config_server.discovery.listen_address[server.discovery.listen_address]` label:deprecated[Deprecated in 5.23]
30+
| Cluster internal traffic | `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 v1 | `5000` | `xref:configuration/configuration-settings.adoc#config_server.discovery.advertised_address[server.discovery.advertised_address]` label:deprecated[Deprecated in 5.23]
59+
| Cluster internal traffic | `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 v1 | `5000` | `:5000` | `xref:configuration/configuration-settings.adoc#config_server.discovery.listen_address[server.discovery.listen_address]` label:deprecated[Deprecated in 5.23]
198+
| Internal traffic | `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 v1 | `5000` | `:5000` | `xref:configuration/configuration-settings.adoc#config_server.discovery.advertised_address[server.discovery.advertised_address]` label:deprecated[Deprecated in 5.23]
209+
| Internal traffic | `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: 136 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,58 @@ 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-v2 label--new-5.23]
40+
======
41+
[source,shell,subs="attributes+, +macros"]
42+
----
43+
# Setting that specifies how much memory Neo4j is allowed to use for the page cache.
44+
server.memory.pagecache.size=100M
45+
46+
# Setting that specifies the initial JVM heap size.
47+
server.memory.heap.initial_size=100M
48+
49+
# 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`.
50+
# The DNS strategy fetches the IP addresses of the cluster members using the DNS A records.
51+
dbms.cluster.discovery.resolver_type=DNS
52+
53+
# The value of `dbms.cluster.discovery.version` must be set to `V2_ONLY` if you want to use the discovery service v2.
54+
# The discovery service v2 utilizes the port `6000`.
55+
dbms.cluster.discovery.version=V2_ONLY
56+
57+
# The value of `dbms.cluster.discovery.v2.endpoints` should be set to a single domain name and the port of the discovery service.
58+
# The domain name returns an A record for every server in the cluster when a DNS lookup is performed.
59+
# Each A record returned by DNS should contain the IP address of the server in the cluster.
60+
# The configured server uses all the IP addresses from the A records to join or form a cluster.
61+
# The discovery port must be the same on all servers when using this configuration.
62+
dbms.cluster.discovery.v2.endpoints=neo4j-network:6000
63+
64+
# Address (the public hostname/IP address of the machine)
65+
# and port setting that specifies where this instance advertises for discovery protocol messages from other members of the cluster.
66+
server.cluster.advertised_address=$(hostname -i)
67+
68+
# Address (the public hostname/IP address of the machine)
69+
# and port setting that specifies where this instance advertises for Raft messages within the cluster.
70+
server.cluster.raft.advertised_address=$(hostname)
71+
72+
# Enable server-side routing
73+
dbms.routing.enabled=true
74+
75+
# Use server-side routing for neo4j:// protocol connections.
76+
dbms.routing.default_router=SERVER
77+
78+
# The advertised address for the intra-cluster routing connector.
79+
server.routing.advertised_address=$(hostname)
80+
81+
# Automatically enable servers, rather than needing to explicitly do so for Free servers
82+
initial.dbms.automatically_enable_free_servers=true
83+
----
84+
======
85+
[role=include-with-discovery-service-v1 label--deprecated-5.23]
86+
======
3887
[source,shell,subs="attributes+, +macros"]
3988
----
4089
# Setting that specifies how much memory Neo4j is allowed to use for the page cache.
@@ -75,7 +124,9 @@ dbms.routing.default_router=SERVER
75124
# The advertised address for the intra-cluster routing connector.
76125
server.routing.advertised_address=$(hostname)
77126
----
78-
====
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.
276-
* `+NEO4J_server_discovery_advertised_address+`: hostname/IP address and port to advertise for member discovery management communication.
277-
* `+NEO4J_server.cluster.advertised_address+`: hostname/IP address and port to advertise for transaction handling.
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]
328+
* `+NEO4J_server_discovery_advertised_address+`: hostname/IP address and port to advertise for member discovery management communication. label:deprecated[Deprecated in 5.23]
329+
* `+NEO4J_server.cluster.advertised_address+`: hostname/IP address and port to advertise for transaction handling and v2 discovery.
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,55 @@ 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-v2 label--new-5.23]
346+
======
347+
[source,shell,subs="attributes"]
348+
----
349+
docker network create --driver=bridge neo4j-cluster
350+
351+
docker run --name=server1 --detach --network=neo4j-cluster \
352+
--publish=7474:7474 --publish=7473:7473 --publish=7687:7687 \
353+
--hostname=server1 \
354+
--env NEO4J_initial_server_mode__constraint=PRIMARY \
355+
--env NEO4J_dbms_cluster_discovery_version=V2_ONLY \
356+
--env NEO4J_dbms_cluster_discovery_v2_endpoints=server1:6000,server2:6000,server3:6000 \
357+
--env NEO4J_ACCEPT_LICENSE_AGREEMENT=yes \
358+
--env NEO4J_server_bolt_advertised__address=localhost:7687 \
359+
--env NEO4J_server_http_advertised__address=localhost:7474 \
360+
--env NEO4J_AUTH=neo4j/mypassword \
361+
neo4j:{neo4j-version-exact}-enterprise
362+
363+
docker run --name=server2 --detach --network=neo4j-cluster \
364+
--publish=8474:7474 --publish=8473:7473 --publish=8687:7687 \
365+
--hostname=server2 \
366+
--env NEO4J_initial_server_mode__constraint=PRIMARY \
367+
--env NEO4J_dbms_cluster_discovery_version=V2_ONLY \
368+
--env NEO4J_dbms_cluster_discovery_v2_endpoints=server1:6000,server2:6000,server3:6000 \
369+
--env NEO4J_ACCEPT_LICENSE_AGREEMENT=yes \
370+
--env NEO4J_server_bolt_advertised__address=localhost:8687 \
371+
--env NEO4J_server_http_advertised__address=localhost:8474 \
372+
--env NEO4J_AUTH=neo4j/mypassword \
373+
neo4j:{neo4j-version-exact}-enterprise
374+
375+
docker run --name=server3 --detach --network=neo4j-cluster \
376+
--publish=9474:7474 --publish=9473:7473 --publish=9687:7687 \
377+
--hostname=server3 \
378+
--env NEO4J_initial_server_mode__constraint=PRIMARY \
379+
--env NEO4J_dbms_cluster_discovery_version=V2_ONLY \
380+
--env NEO4J_dbms_cluster_discovery_v2_endpoints=server1:6000,server2:6000,server3:6000 \
381+
--env NEO4J_ACCEPT_LICENSE_AGREEMENT=yes \
382+
--env NEO4J_server_bolt_advertised__address=localhost:9687 \
383+
--env NEO4J_server_http_advertised__address=localhost:9474 \
384+
--env NEO4J_AUTH=neo4j/mypassword \
385+
neo4j:{neo4j-version-exact}-enterprise
386+
----
387+
======
388+
[role=include-with-discovery-service-v1 label--deprecated-5.23]
389+
======
289390

290391
[source,shell,subs="attributes"]
291392
----
@@ -324,11 +425,36 @@ docker run --name=server3 --detach --network=neo4j-cluster \
324425
--env NEO4J_AUTH=neo4j/mypassword \
325426
neo4j:{neo4j-version-exact}-enterprise
326427
----
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-v2 label--new-5.23]
439+
======
440+
441+
[source,shell,subs="attributes"]
442+
----
443+
docker run --name=read-server4 --detach --network=neo4j-cluster \
444+
--publish=10474:7474 --publish=10473:7473 --publish=10687:7687 \
445+
--hostname=read-server4 \
446+
--env NEO4J_initial_server_mode__constraint=SECONDARY \
447+
--env NEO4J_dbms_cluster_discovery_version=V2_ONLY \
448+
--env NEO4J_dbms_cluster_discovery_v2_endpoints=server1:6000,server2:6000,server3:6000 \
449+
--env NEO4J_ACCEPT_LICENSE_AGREEMENT=yes \
450+
--env NEO4J_server_bolt_advertised__address=localhost:10687 \
451+
--env NEO4J_server_http_advertised__address=localhost:10474 \
452+
neo4j:{neo4j-version-exact}-enterprise
453+
----
454+
======
455+
[role=include-with-discovery-service-v1 label--deprecated-5.23]
456+
======
457+
332458
[source,shell,subs="attributes"]
333459
----
334460
docker run --name=read-server4 --detach --network=neo4j-cluster \
@@ -341,3 +467,6 @@ docker run --name=read-server4 --detach --network=neo4j-cluster \
341467
--env NEO4J_server_http_advertised__address=localhost:10474 \
342468
neo4j:{neo4j-version-exact}-enterprise
343469
----
470+
471+
======
472+
=====

0 commit comments

Comments
 (0)