Skip to content

Commit 22f4fd8

Browse files
committed
DOCS-6308: Elaborate on iptables w/ HTTP interface
1 parent da41d8d commit 22f4fd8

File tree

1 file changed

+15
-26
lines changed

1 file changed

+15
-26
lines changed

source/tutorial/configure-linux-iptables-firewall.txt

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,8 @@ members of the replica set. Take the configuration outlined in the
119119
Traffic to and from a MongoDB Config Server
120120
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
121121

122-
Config servers, host the :term:`config database` that stores metadata
123-
for sharded clusters. Each production cluster has three config
124-
servers, initiated using the :option:`mongod --configsvr`
125-
option. [#config-option]_ Config servers listen for connections on port
122+
Config servers host the :term:`config database` that stores metadata
123+
for sharded clusters. Config servers listen for connections on port
126124
``27019``. As a result, add the following ``iptables`` rules to the
127125
config server to allow incoming and outgoing connection on port
128126
``27019``, for connection to the other config servers.
@@ -148,18 +146,12 @@ Replace ``<ip-address>`` with the address of the
148146
:program:`mongos` instances and the shard :program:`mongod`
149147
instances.
150148

151-
.. [#config-option] You also can run a config server by using the
152-
``configsvr`` value for the :setting:`~sharding.clusterRole` setting in a
153-
configuration file.
154-
155149
Traffic to and from a MongoDB Shard Server
156150
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
157151

158-
For shard servers, running as :option:`mongod --shardsvr`
159-
[#shard-option]_ Because the default port number is ``27018`` when running
160-
with the ``shardsvr`` value for the :setting:`~sharding.clusterRole` setting,
161-
you must configure the following ``iptables`` rules to allow traffic to and
162-
from each shard:
152+
:ref:`Shard servers <sharding-background>` default to port number
153+
``27018``. You must configure the following ``iptables`` rules to allow
154+
traffic to and from each shard:
163155

164156
.. code-block:: sh
165157

@@ -187,11 +179,6 @@ Create a rule that resembles the following, and replace the
187179

188180
iptables -A OUTPUT -d <ip-address> -p tcp --source-port 27018 -m state --state ESTABLISHED -j ACCEPT
189181

190-
.. [#shard-option] You can also specify the shard server option with the
191-
``shardsvr`` value for the :setting:`~sharding.clusterRole` setting in the
192-
configuration file. Shard members are also often conventional replica sets
193-
using the default port.
194-
195182
.. [#migrations] All shards in a cluster need to be able to
196183
communicate with all other shards to facilitate :term:`chunk` and
197184
balancing operations.
@@ -204,8 +191,12 @@ Provide Access For Monitoring Systems
204191
reach all components of a cluster, including the config servers,
205192
the shard servers, and the :program:`mongos` instances.
206193

207-
#. If your monitoring system needs access the HTTP interface, insert
208-
the following rule to the chain:
194+
#. If your monitoring system needs access to the MongoDB HTTP interface,
195+
you must ensure the HTTP interface's port is open. The HTTP interface
196+
listens on the :option:`port <--port>` of your :program:`mongod`
197+
instance plus ``1000``. By default, this is port ``28017``.
198+
199+
Insert the following rule to your ``iptables`` chain:
209200

210201
.. code-block:: sh
211202

@@ -218,17 +209,15 @@ Provide Access For Monitoring Systems
218209

219210
.. optional::
220211

221-
For config server :program:`mongod` instances running with
222-
the ``shardsvr`` value for the :setting:`~sharding.clusterRole`
223-
setting, the rule would resemble the following:
212+
For :doc:`shard server </core/sharded-cluster-shards>`
213+
instances, the rule would resemble the following:
224214

225215
.. code-block:: sh
226216

227217
iptables -A INPUT -s <ip-address> -p tcp --destination-port 28018 -m state --state NEW,ESTABLISHED -j ACCEPT
228218

229-
For config server :program:`mongod` instances running with
230-
the ``configsvr`` value for the :setting:`~sharding.clusterRole`
231-
setting, the rule would resemble the following:
219+
For :ref:`config server <sharding-config-server>` instances, the
220+
rule would resemble the following:
232221

233222
.. code-block:: sh
234223

0 commit comments

Comments
 (0)