@@ -72,7 +72,7 @@ as standalone instances or as part of a :term:`replica set`.
72
72
The goal of this pattern is to explicitly allow traffic to the
73
73
:program:`mongod.exe` instance from the application server.
74
74
75
- .. code-block:: netsh
75
+ .. code-block:: bat
76
76
77
77
netsh advfirewall firewall add rule name="Open mongod port 27017" dir=in action=allow protocol=TCP localport=27017
78
78
@@ -84,22 +84,22 @@ allows the application server to connect to the
84
84
an entire application rather than to a specific port, as in the
85
85
following example:
86
86
87
- .. code-block:: netsh
87
+ .. code-block:: bat
88
88
89
89
netsh advfirewall firewall add rule name="Allowing mongod" dir=in action=allow program=" C:\mongodb\bin\mongod.exe"
90
90
91
91
You can allow all access for a :program:`mongos.exe` server, with the
92
92
following invocation:
93
93
94
- .. code-block:: netsh
94
+ .. code-block:: bat
95
95
96
96
netsh advfirewall firewall add rule name="Allowing mongos" dir=in action=allow program=" C:\mongodb\bin\mongos.exe"
97
97
98
98
Traffic to and from ``mongos.exe`` Instances
99
99
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
100
100
101
101
:program:`mongos.exe` instances provide query routing for
102
- :term:`sharded clusters`. Clients connect to :program:`mongos.exe`
102
+ :term:`sharded clusters <sharded cluster> `. Clients connect to :program:`mongos.exe`
103
103
instances, which behave from the client's perspective as
104
104
:program:`mongod.exe` instances. In turn, the :program:`mongos.exe`
105
105
connects to all :program:`mongod.exe` instances that are components of
@@ -109,7 +109,7 @@ Use the same :guilabel:`Windows Firewall` command to allow traffic to
109
109
and from these instances as you would from the :program:`mongod.exe`
110
110
instances that are members of the replica set.
111
111
112
- .. code-block:: netsh
112
+ .. code-block:: bat
113
113
114
114
netsh advfirewall firewall add rule name="Open mongod shard port 27018" dir=in action=allow protocol=TCP localport=27018
115
115
@@ -124,7 +124,7 @@ option. [#config-option]_ Configuration servers listen for connections on port
124
124
config server to allow incoming and outgoing connection on port
125
125
``27019``, for connection to the other config servers.
126
126
127
- .. code-block:: netsh
127
+ .. code-block:: bat
128
128
129
129
netsh advfirewall firewall add rule name="Open mongod config svr port 27019" dir=in action=allow protocol=TCP localport=27019
130
130
@@ -133,7 +133,7 @@ all of the :program:`mongos.exe` instances in the cluster *and* all
133
133
:program:`mongod.exe` instances in the cluster. Add rules that
134
134
resemble the following:
135
135
136
- .. code-block:: netsh
136
+ .. code-block:: bat
137
137
138
138
netsh advfirewall firewall add rule name="Open mongod config svr inbound" dir=in action=allow protocol=TCP remoteip=<ip-address> localport=27019
139
139
@@ -152,7 +152,7 @@ For shard servers, running as :option:`mongod --shardsvr`
152
152
:setting:`shardsvr` is ``27018``, you must configure the following
153
153
:guilabel:`Windows Firewall` rules to allow traffic to and from each shard:
154
154
155
- .. code-block:: netsh
155
+ .. code-block:: bat
156
156
157
157
netsh advfirewall firewall add rule name="Open mongod shardsvr inbound" dir=in action=allow protocol=TCP remoteip=<ip-address> localport=27018
158
158
netsh advfirewall firewall add rule name="Open mongod shardsvr outbound" dir=out action=allow protocol=TCP remoteip=<ip-address> localport=27018
@@ -176,7 +176,7 @@ Create a rule that resembles the following, and replace the
176
176
``<ip-address>`` with the address of the config servers and the
177
177
:program:`mongos.exe` instances:
178
178
179
- .. code-block:: netsh
179
+ .. code-block:: bat
180
180
181
181
netsh advfirewall firewall add rule name="Open mongod config svr outbound" dir=out action=allow protocol=TCP remoteip=<ip-address> localport=27018
182
182
@@ -200,7 +200,7 @@ Provide Access For Monitoring Systems
200
200
#. If your monitoring system needs access the HTTP interface, insert
201
201
the following rule to the chain:
202
202
203
- .. code-block:: netsh
203
+ .. code-block:: bat
204
204
205
205
netsh advfirewall firewall add rule name="Open mongod HTTP monitoring inbound" dir=in action=allow protocol=TCP remoteip=<ip-address> localport=28017
206
206
@@ -214,14 +214,14 @@ Provide Access For Monitoring Systems
214
214
For shard server :program:`mongod.exe` instances running with
215
215
:setting:`shardsvr`, the rule would resemble the following:
216
216
217
- .. code-block:: netsh
217
+ .. code-block:: bat
218
218
219
219
netsh advfirewall firewall add rule name="Open mongos HTTP monitoring inbound" dir=in action=allow protocol=TCP remoteip=<ip-address> localport=28018
220
220
221
221
For config server :program:`mongod.exe` instances running with
222
222
:setting:`configsvr`, the rule would resemble the following:
223
223
224
- .. code-block:: netsh
224
+ .. code-block:: bat
225
225
226
226
netsh advfirewall firewall add rule name="Open mongod configsvr HTTP monitoring inbound" dir=in action=allow protocol=TCP remoteip=<ip-address> localport=28019
227
227
@@ -238,7 +238,7 @@ Delete all *Windows Firewall* Rules
238
238
239
239
To delete the firewall rule allowing :program:`mongod.exe` traffic:
240
240
241
- .. code-block:: netsh
241
+ .. code-block:: bat
242
242
243
243
netsh advfirewall firewall delete rule name="Open mongod port 27017" protocol=tcp localport=27017
244
244
@@ -249,7 +249,7 @@ List All *Windows Firewall* Rules
249
249
250
250
To return a list of all :guilabel:`Windows Firewall` rules:
251
251
252
- .. code-block:: netsh
252
+ .. code-block:: bat
253
253
254
254
netsh advfirewall firewall show rule name=all
255
255
@@ -258,7 +258,7 @@ Reset *Windows Firewall*
258
258
259
259
To reset the :guilabel:`Windows Firewall` rules:
260
260
261
- .. code-block:: netsh
261
+ .. code-block:: bat
262
262
263
263
netsh advfirewall reset
264
264
@@ -270,14 +270,14 @@ import firewall systems from different servers) rules very easily on Windows:
270
270
271
271
Export all firewall rules with the following command:
272
272
273
- .. code-block:: netsh
273
+ .. code-block:: bat
274
274
275
275
netsh advfirewall export "C:\temp\MongoDBfw.wfw"
276
276
277
277
Replace ``"C:\temp\MongoDBfw.wfw"`` with a path of your choosing. You
278
278
can use a command in the following form to import a file created using
279
279
this operation:
280
280
281
- .. code-block:: netsh
281
+ .. code-block:: bat
282
282
283
283
netsh advfirewall import "C:\temp\MongoDBfw.wfw"
0 commit comments