Skip to content

Commit 7673546

Browse files
author
Dave
authored
DOCSP-14283 ip addresses in split horizons v5.2 (#338)
* DOCSP-14283 Add warning, update tip * Default bind behavior * Update parameters * method reference * Staging review * DOCSP-14283 ip addresses in split horizons * Staging review * Change tip to important * Compatibility Notes * Build errors in core/security-mongodb-configuration.txt * Review feedback * Staging updates
1 parent c65d40d commit 7673546

34 files changed

+154
-106
lines changed

source/core/replica-set-architectures.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ interruptions, such as power failures and unexpected reboots.
185185
Hostnames
186186
~~~~~~~~~
187187

188-
.. include:: /includes/tip-hostnames.rst
188+
.. include:: /includes/important-hostnames.rst
189189

190190
Replica Set Naming
191191
------------------

source/core/security-mongodb-configuration.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ IP Binding
1313
Overview
1414
--------
1515

16-
.. include:: /includes/fact-default-bind-ip.rst
17-
:start-after: begin-intro
18-
:end-before: end-intro
16+
MongoDB binaries, :binary:`mongod` and :binary:`mongos`, bind to
17+
localhost by default. If the :setting:`net.ipv6` configuration file
18+
setting or the ``--ipv6`` command line option is set for the binary,
19+
the binary additionally binds to the localhost IPv6 address.
1920

2021
Considerations
2122
--------------
@@ -27,9 +28,9 @@ Considerations
2728
has more than one network interface, bind MongoDB programs to the
2829
private or internal network interface.
2930

30-
.. include:: /includes/fact-default-bind-ip.rst
31-
:start-after: begin-override
32-
:end-before: end-override
31+
If the :setting:`net.ipv6` configuration file setting or the ``--ipv6``
32+
command line option is set for the binary, the binary additionally
33+
binds to the localhost IPv6 address.
3334

3435
.. include:: /includes/fact-bind-to-all-ips.rst
3536

source/includes/considerations-deploying-replica-set.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ See :doc:`/core/replica-set-architectures` for more information.
99
Hostnames
1010
~~~~~~~~~
1111

12-
.. include:: /includes/tip-hostnames.rst
12+
.. include:: /includes/important-hostnames.rst
1313

1414
IP Binding
1515
~~~~~~~~~~
Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,37 @@
1-
.. begin-intro
2-
3-
Starting in MongoDB 3.6, MongoDB binaries, :binary:`~bin.mongod` and
4-
:binary:`~bin.mongos`, bind to localhost by default. If the
5-
:setting:`net.ipv6` configuration file setting or the ``--ipv6``
6-
command line option is set for the binary, the binary additionally binds
7-
to the localhost IPv6 address.
8-
9-
.. end-intro
10-
11-
Previously, starting from MongoDB 2.6, only the binaries from the
12-
official MongoDB RPM (Red Hat, CentOS, Fedora Linux, and derivatives)
13-
and DEB (Debian, Ubuntu, and derivatives) packages bind to localhost by
14-
default.
1+
.. include:: /includes/warning-bind-ip-security-considerations.rst
152

16-
When bound only to the localhost, these MongoDB 3.6 binaries can only
17-
accept connections from clients (including :binary:`~bin.mongosh` and
18-
other members of your deployment in replica sets and sharded clusters)
19-
that are running on the same machine. Remote clients cannot connect to
20-
the binaries bound only to localhost.
3+
MongoDB binaries, :binary:`~bin.mongod` and :binary:`~bin.mongos`, bind
4+
to localhost by default. If the :setting:`net.ipv6` configuration file
5+
setting or the ``--ipv6`` command line option is set for the binary,
6+
the binary additionally binds to the localhost IPv6 address.
217

22-
.. begin-override
8+
By default :binary:`~bin.mongod` and :binary:`~bin.mongos` that are
9+
bound to localhost only accept connections from clients that are
10+
running on the same computer. This binding behavior includes
11+
:binary:`~bin.mongosh` and other members of your replica set or sharded
12+
cluster. Remote clients cannot connect to binaries that are bound only
13+
to localhost.
2314

24-
To override and bind to other ip addresses, you can use the
25-
:setting:`net.bindIp` configuration file setting or the
26-
``--bind_ip`` command-line option to specify a list of hostnames or ip
27-
addresses.
15+
To override the default binding and bind to other IP addresses, use the
16+
:setting:`net.bindIp` configuration file setting or the ``--bind_ip``
17+
command-line option to specify a list of hostnames or IP addresses.
2818

29-
.. include:: /includes/warning-bind-ip-security-considerations.rst
19+
.. include:: /includes/warning-no-ip-addresses-in-split-horizons.rst
3020

3121
For example, the following :binary:`~bin.mongod` instance binds to both
3222
the localhost and the hostname ``My-Example-Associated-Hostname``, which is
33-
associated with the ip address ``198.51.100.1``:
23+
associated with the IP address ``198.51.100.1``:
3424

3525
.. code-block:: none
3626
3727
mongod --bind_ip localhost,My-Example-Associated-Hostname
3828
3929
In order to connect to this instance, remote clients must specify
40-
the hostname or its associated ip address ``198.51.100.1``:
30+
the hostname or its associated IP address ``198.51.100.1``:
4131

4232
.. code-block:: none
4333
4434
mongosh --host My-Example-Associated-Hostname
4535
4636
mongosh --host 198.51.100.1
4737
48-
.. end-override
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
To configure cluster nodes for `split horizon DNS
2+
<https://en.wikipedia.org/wiki/Split-horizon_DNS>`__, use host names
3+
instead of IP addresses.
4+
5+
Starting in MongoDB v5.0, :dbcommand:`replSetInitiate` and
6+
:dbcommand:`replSetReconfig` reject configurations that use IP
7+
addresses instead of hostnames.
8+
9+
Use :parameter:`disableSplitHorizonIPCheck` to modify nodes that
10+
cannot be updated to use host names. The parameter only applies to the
11+
configuration commands.
12+
13+
:binary:`mongod` and :binary:`mongos` do not rely on
14+
:parameter:`disableSplitHorizonIPCheck` for validation at startup.
15+
Legacy :binary:`mongod` and :binary:`mongos` instances that use IP
16+
addresses instead of host names will start after an upgrade.
17+
18+
Instances that are configured with IP addresses log a warning to use
19+
host names instead of IP addresses.
20+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.. important::
2+
3+
To avoid configuration updates due to IP address changes, use DNS
4+
hostnames instead of IP addresses. It is particularly important to
5+
use a DNS hostname instead of an IP address when configuring replica
6+
set members or sharded cluster members.
7+
8+
Use hostnames instead of IP addresses to configure clusters across a
9+
split network horizon. Starting in MongDB 5.0, nodes that are only
10+
configured with an IP address will fail startup validation and will
11+
not start.
12+

source/includes/steps-convert-replica-set-add-new-shard.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pre: |
4747
4848
.. include:: /includes/fact-rs-initiate-once-only.rst
4949
50-
.. include:: /includes/tip-hostnames.rst
50+
.. include:: /includes/important-hostnames.rst
5151
action:
5252
copyable: true
5353
language: javascript

source/includes/steps-convert-replica-set-shard-deploy-infrastructure.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ action:
2727
2828
.. include:: /includes/fact-rs-initiate-once-only.rst
2929
30-
.. include:: /includes/tip-hostnames.rst
30+
.. include:: /includes/important-hostnames.rst
3131
language: javascript
3232
code: |
3333
rs.initiate( {

source/includes/steps-deploy-replica-set-with-auth.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ action:
7979
mongod --keyFile <path-to-keyfile> --replSet <replicaSetName> --bind_ip localhost,<hostname(s)|ip address(es)>
8080
post: |
8181
82-
.. include:: /includes/tip-hostnames.rst
82+
.. include:: /includes/important-hostnames.rst
8383
8484
For more information on command-line options, see the
8585
:binary:`~bin.mongod` reference page.
@@ -116,7 +116,7 @@ action:
116116
117117
.. include:: /includes/fact-rs-initiate-once-only.rst
118118
119-
.. include:: /includes/tip-hostnames.rst
119+
.. include:: /includes/important-hostnames.rst
120120
121121
language: javascript
122122
code: |

source/includes/steps-deploy-replica-set.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ pre: |
107107
108108
.. include:: /includes/fact-rs-initiate-once-only.rst
109109
110-
.. include:: /includes/tip-hostnames.rst
110+
.. include:: /includes/important-hostnames.rst
111111
action:
112112
language: javascript
113113
code: |

source/includes/tip-hostnames.rst

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.. warning::
2+
3+
Starting in MongDB 5.0, `split horizon DNS
4+
<https://en.wikipedia.org/wiki/Split-horizon_DNS>`__ nodes that are
5+
only configured with an IP address fail startup validation and
6+
report an error. See :parameter:`disableSplitHorizonIPCheck`.
7+

source/reference/command/replSetInitiate.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ replSetInitiate
4444
]
4545
}
4646

47-
.. include:: /includes/tip-hostnames.rst
47+
.. include:: /includes/important-hostnames.rst
4848

4949
IP Binding
5050
----------
@@ -70,14 +70,12 @@ the :method:`rs.initiate()` helper:
7070

7171
rs.initiate(config)
7272

73-
.. include:: /includes/tip-hostnames.rst
73+
.. include:: /includes/important-hostnames.rst
7474

7575
Notice that omitting the port cause the host to use the default port
7676
of 27017. Notice also that you can specify other options in the config
7777
documents such as the ``arbiterOnly`` setting in this example.
7878

79-
.. slave-ok, admin-only
80-
8179
.. seealso::
8280

8381
- :doc:`/reference/replica-configuration`

source/reference/command/replSetReconfig.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ Mixed Version Replica Set
131131
~~~~~~~~~~~~~~~~~~~~~~~~~
132132

133133
.. warning::
134+
134135
.. include:: /includes/warning-mixed-version-rs-config.rst
135136

136137
Availability
@@ -206,11 +207,11 @@ modify this timeout using the
206207
Replace ``<hostname>`` and ``<port>`` with those of the removed
207208
member.
208209

210+
.. include:: /includes/warning-no-ip-addresses-in-split-horizons.rst
211+
209212
Member Priority and Votes
210213
~~~~~~~~~~~~~~~~~~~~~~~~~
211214

212-
.. versionchanged:: 3.2
213-
214215
- .. include:: /includes/fact-rs-nonzero-priority-vote-restriction.rst
215216

216217
- .. include:: /includes/fact-rs-non-voting-priority-restriction.rst

source/reference/configuration-options.txt

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -889,25 +889,17 @@ Core Options
889889

890890
The TCP port on which the MongoDB instance listens for
891891
client connections.
892-
893-
894-
895892

896893
.. setting:: net.bindIp
897894

898895
*Type*: string
899896

900897
*Default*: localhost
901898

902-
903-
.. note::
904-
905-
Starting in MongoDB 3.6, :binary:`~bin.mongos` or :binary:`~bin.mongod` bind to localhost
906-
by default. See :ref:`3.6-bind-to-localhost`.
907-
908899
The hostnames and/or IP addresses and/or full Unix domain socket
909-
paths on which :binary:`~bin.mongos` or :binary:`~bin.mongod` should listen for client connections. You
910-
may attach :binary:`~bin.mongos` or :binary:`~bin.mongod` to any interface. To bind to multiple
900+
paths on which :binary:`~bin.mongos` or :binary:`~bin.mongod` should
901+
listen for client connections. You may attach :binary:`~bin.mongos`
902+
or :binary:`~bin.mongod` to any interface. To bind to multiple
911903
addresses, enter a list of comma-separated values.
912904

913905
.. example::
@@ -924,9 +916,11 @@ Core Options
924916
.. note::
925917

926918
If specifying an IPv6 address *or* a hostname that resolves to an
927-
IPv6 address to :setting:`net.bindIp`, you must start :binary:`~bin.mongos` or :binary:`~bin.mongod` with
928-
:setting:`net.ipv6 : true <net.ipv6>` to enable IPv6 support. Specifying an IPv6 address
929-
to :setting:`net.bindIp` does not enable IPv6 support.
919+
IPv6 address to :setting:`net.bindIp`, you must start
920+
:binary:`~bin.mongos` or :binary:`~bin.mongod` with
921+
:setting:`net.ipv6 : true <net.ipv6>` to enable IPv6 support.
922+
Specifying an IPv6 address to :setting:`net.bindIp` does not
923+
enable IPv6 support.
930924

931925
If specifying a
932926
`link-local IPv6 address <https://en.wikipedia.org/wiki/Link-local_address#IPv6>`_
@@ -938,7 +932,7 @@ Core Options
938932

939933
``localhost,fe80::a00:27ff:fee0:1fcf%enp0s3``
940934

941-
.. include:: /includes/tip-hostnames.rst
935+
.. include:: /includes/important-hostnames.rst
942936

943937
.. include:: /includes/warning-bind-ip-security-considerations.rst
944938

@@ -961,8 +955,8 @@ Core Options
961955

962956
- The command-line option ``--bind_ip`` overrides the configuration
963957
file setting :setting:`net.bindIp`.
964-
965958

959+
.. include:: /includes/fact-split-horizon-binding.rst
966960

967961
.. setting:: net.bindIpAll
968962

source/reference/method/rs.add.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ IP Binding
8787

8888
.. include:: /includes/fact-default-bind-ip.rst
8989

90-
.. include:: /includes/tip-hostnames.rst
90+
.. include:: /includes/important-hostnames.rst
9191

9292
Behavior
9393
--------

source/reference/method/rs.addArb.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ IP Binding
5555

5656
.. include:: /includes/fact-default-bind-ip.rst
5757

58-
.. include:: /includes/tip-hostnames.rst
58+
.. include:: /includes/important-hostnames.rst

source/reference/method/rs.initiate.txt

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,19 @@ Description
2828
:widths: 20 20 80
2929

3030
* - Parameter
31-
3231
- Type
33-
3432
- Description
3533

3634
* - ``configuration``
37-
3835
- document
39-
4036
- Optional. A document that specifies :ref:`configuration
4137
<replica-set-configuration-document>` for the new replica set. If a
4238
configuration is not specified, MongoDB uses a default
4339
replica set configuration.
44-
45-
46-
47-
4840

4941
The :method:`rs.initiate()` method provides a wrapper around the
5042
:dbcommand:`replSetInitiate` command.
5143

52-
5344
IP Binding
5445
----------
5546

@@ -58,10 +49,10 @@ IP Binding
5849
Replica Set Configuration
5950
-------------------------
6051

61-
See :ref:`replica-set-configuration-document` for details of replica
62-
set configuration document.
52+
See :ref:`replica-set-configuration-document` for details of the
53+
replica set configuration document.
6354

64-
.. include:: /includes/tip-hostnames.rst
55+
.. include:: /includes/important-hostnames.rst
6556

6657
Example
6758
-------
@@ -84,7 +75,7 @@ instances and run :method:`rs.initiate()`.
8475

8576
.. include:: /includes/fact-rs-initiate-once-only.rst
8677

87-
.. include:: /includes/tip-hostnames.rst
78+
.. include:: /includes/important-hostnames.rst
8879

8980
.. code-block:: javascript
9081

0 commit comments

Comments
 (0)