@@ -95,8 +95,8 @@ Traffic to and from ``mongos`` Instances
9595~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9696
9797:program:`mongos` instances provide query routing for :term:`sharded
98- clusters sharded `. Clients connect to :program:`mongos` instances,
99- which behave from the client's perspective as :program:`mongod`
98+ clusters`. Clients connect to :program:`mongos` instances, which
99+ behave from the client's perspective as :program:`mongod`
100100instances. In turn, the :program:`mongos` connects to all
101101:program:`mongod` instances that are components of the sharded
102102cluster.
@@ -110,7 +110,7 @@ Traffic to and from a MongoDB Config Server
110110~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
111111
112112Config servers, host the :term:`config database` that stores metadata
113- for sharded clusters. Each production shard cluster has three config
113+ for sharded clusters. Each production cluster has three config
114114servers, initiated using the :option:`mongod --configsvr`
115115option. [#config-option]_ Config servers listen for connections on the
116116``27019``. As a result, add the following ``iptables`` rules to the
@@ -120,14 +120,14 @@ config server to allow incoming and outgoing connection on port
120120.. code-block:: sh
121121
122122 iptables -A INPUT -s <ip-address> -p tcp --destination-port 27019 -m state --state NEW,ESTABLISHED -j ACCEPT
123- iptabwles -A OUTPUT -d <ip-address> -p tcp --source-port 27019 -m state --state ESTABLISHED -j ACCEPT
123+ iptables -A OUTPUT -d <ip-address> -p tcp --source-port 27019 -m state --state ESTABLISHED -j ACCEPT
124124
125125Replace ``<ip-address>`` with the address or address space of *all*
126126the :program:`mongod` that provide config servers.
127127
128128Additionally, config servers need to allow incoming connections from
129129all of the :program:`mongos` instances in the cluster *and* all
130- :program:`mongod` instances in the shard cluster. Add rules that
130+ :program:`mongod` instances in the cluster. Add rules that
131131resemble the following:
132132
133133.. code-block:: sh
@@ -186,6 +186,42 @@ Create a rule that resembles the following, and replace the
186186 communicate with all other shards to facilitate :term:`chunk` and
187187 balancing operations.
188188
189+ Provide Access For Monitoring Systems
190+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
191+
192+ #. The :program:`mongostat` diagnostic tool, when running with the
193+ :option:`--discover <mongostat --discover>` needs to be able to
194+ reach all components of a cluster, including the config servers,
195+ the shard servers, and the :program:`mongos` instances.
196+
197+ #. If your monitoring system needs access the HTTP interface, insert
198+ the following rule to the chain:
199+
200+ .. code-block:: sh
201+
202+ iptables -A INPUT -s <ip-address> -p tcp --destination-port 28017 -m state --state NEW,ESTABLISHED -j ACCEPT
203+
204+ Replace ``<ip-address>`` with the address of the instance that
205+ needs access to the HTTP or REST interface. For *all* deployments,
206+ you should restrict access to this port to *only* the monitoring
207+ instance.
208+
209+ .. optional::
210+
211+ For shard server :program:`mongod` instances running with
212+ :setting:`shardsvr`, the rule would resemble the following:
213+
214+ .. code-block:: sh
215+
216+ iptables -A INPUT -s <ip-address> -p tcp --destination-port 28018 -m state --state NEW,ESTABLISHED -j ACCEPT
217+
218+ For config server :program:`mongod` instances running with
219+ :setting:`configsvr`, the rule would resemble the following:
220+
221+ .. code-block:: sh
222+
223+ iptables -A INPUT -s <ip-address> -p tcp --destination-port 28019 -m state --state NEW,ESTABLISHED -j ACCEPT
224+
189225.. _iptables-change-default-policy-to-drop:
190226
191227Change Default Policy to ``DROP``
0 commit comments