Skip to content

Commit 64beac2

Browse files
committed
DOCS-11323: skipShardingConfigurationChecks
1 parent 3fbbbf6 commit 64beac2

File tree

4 files changed

+319
-70
lines changed

4 files changed

+319
-70
lines changed

source/includes/options-mongod.yaml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,6 +1137,17 @@ description: |
11371137
11381138
Do not use the {{role}} option with :option:`--shardsvr`. Config
11391139
servers cannot be a shard server.
1140+
1141+
Do not use the {{role}} with the
1142+
:parameter:`skipShardingConfigurationChecks` parameter. That is, if
1143+
you are temporarily starting the :binary:`~bin.mongod` as a
1144+
standalone for maintenance operations, include the parameter
1145+
:parameter:`skipShardingConfigurationChecks` and exclude {{role}}.
1146+
Once maintenance has completed, remove the
1147+
:parameter:`skipShardingConfigurationChecks` parameter and restart
1148+
with {{role}}.
1149+
1150+
11401151
optional: false
11411152
---
11421153
program: mongod
@@ -1152,11 +1163,17 @@ description: |
11521163
11531164
.. important::
11541165
1155-
.. versionchanged:: 3.6
1156-
1157-
You must deploy shards as replica sets. See the :option:`--replSet`
1166+
Starting in MongoDB 3.6, you must deploy shards as replica sets. See the :option:`--replSet`
11581167
option to deploy {{program}} as part of a replica set.
11591168
1169+
Do not use the {{role}} with the
1170+
:parameter:`skipShardingConfigurationChecks` parameter. That is, if
1171+
you are temporarily starting the :binary:`~bin.mongod` as a
1172+
standalone for maintenance operations, include the parameter
1173+
:parameter:`skipShardingConfigurationChecks` and exclude {{role}}.
1174+
Once maintenance has completed, remove the
1175+
:parameter:`skipShardingConfigurationChecks` parameter and restart
1176+
with {{role}}.
11601177
11611178
optional: false
11621179
---

source/includes/steps-perform-maintenance-task-on-replica-set-members.yaml

Lines changed: 189 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,94 @@ action:
1010
title: Restart the secondary as a standalone on a different port.
1111
stepnum: 2
1212
ref: restart-diff-port
13-
pre: |
14-
At the operating system shell prompt restart :binary:`~bin.mongod`
15-
as a standalone instance, making
16-
the following modifications to the configuration file.
17-
18-
- Comment out the :setting:`replication.replSetName` option.
19-
- For :term:`shard` or :term:`config server` replica sets, comment out
20-
the :setting:`sharding.clusterRole` option.
21-
- Change the :setting:`net.port` to a different port. Make a note
22-
of the original port setting as a comment.
23-
24-
If using command line options, modify :option:`--port <mongod --port>`
25-
and remove the :option:`--replSetName <mongod --replSet>`,
26-
:option:`--shardsvr <mongod --shardsvr>`, and
27-
:option:`--configsvr <mongod --configsvr>` options.
28-
29-
.. include:: /includes/warning-bind-ip-security-considerations.rst
13+
content: |
3014
31-
action:
32-
language: sh
33-
code: mongod --port 37017 --dbpath /srv/mongodb --bind_ip localhost,<ip address of the mongod host>
34-
post: |
35-
Always start :binary:`~bin.mongod` with the same user, even when
36-
restarting a replica set member as a standalone instance.
15+
At the operating system shell prompt restart :binary:`~bin.mongod`
16+
as a standalone instance.
17+
18+
.. tabs::
19+
20+
tabs:
21+
- id: config-file
22+
name: Configuration File
23+
content: |
24+
25+
If you are using a configuration file, make the following
26+
configuration updates:
27+
28+
- Comment out the :setting:`replication.replSetName` option.
29+
30+
- Change the :setting:`net.port` to a different port.
31+
Make a note of the original port setting as a comment.
32+
33+
- If the :binary:`~bin.mongod` is a :term:`shard` or
34+
:term:`config server` member, you must also:
35+
36+
- Comment out the :setting:`sharding.clusterRole` option.
37+
38+
- Set parameter :parameter:`skipShardingConfigurationChecks`
39+
(available for MongoDB 4.0+, 3.6.3+, 3.4.11+, 3.2.19+) to
40+
``true`` in the :setting:`setParameter` section.
41+
42+
For example, if performing maintenance on a shard/config
43+
server replica set member for maintenance, the updated
44+
configuration file will include content like the
45+
following example:
46+
47+
.. code-block:: yaml
48+
49+
net:
50+
bindIp: localhost,<ip address of the mongod host>
51+
port: 27218
52+
# port: 27018
53+
#replication:
54+
# replSetName: shardA
55+
#sharding:
56+
# clusterRole: shardsvr
57+
setParameter:
58+
skipShardingConfigurationChecks: true
59+
60+
- id: command-line
61+
name: Command-line Options
62+
content: |
63+
64+
If using command-line options, make the following
65+
configuration updates to restart:
66+
67+
- Remove :option:`--replSetName <mongod --replSet>`.
68+
69+
- Modify :option:`--port <mongod --port>` to a different port.
70+
71+
- If the :binary:`~bin.mongod` is a :term:`shard` or
72+
:term:`config server` member, you must also:
73+
74+
- Remove :option:`--shardsvr <mongod --shardsvr>` if a
75+
shard member and :option:`--configsvr <mongod
76+
--configsvr>` if a config server member.
77+
78+
- Set parameter
79+
:parameter:`skipShardingConfigurationChecks`
80+
(available for MongoDB 4.0+, 3.6.3+, 3.4.11+,
81+
3.2.19+) to ``true`` in the :setting:`setParameter`
82+
section.
83+
84+
85+
For example, to restart a replica set member that is not part of a sharded cluster:
86+
87+
.. code-block:: sh
88+
89+
mongod --port 37017 --dbpath /srv/mongodb --bind_ip localhost,<ip address of the mongod host>
90+
91+
For example, to restart a shard/config server replica set member for maintenance:
92+
93+
.. code-block:: sh
94+
95+
mongod --port 37017 --dbpath /srv/mongodb --bind_ip localhost,<ip address of the mongod host> --setParameter skipShardingConfigurationChecks=true
96+
97+
.. include:: /includes/warning-bind-ip-security-considerations.rst
98+
99+
Always start :binary:`~bin.mongod` with the same user, even when
100+
restarting a replica set member as a standalone instance.
37101
---
38102
title: Perform maintenance operations on the secondary.
39103
stepnum: 3
@@ -61,9 +125,13 @@ action:
61125
use admin
62126
db.shutdownServer()
63127
- pre: |
64-
Restart the :binary:`~bin.mongod` instance as a member of
65-
the replica set using its normal configuration file or
66-
command-line arguments.
128+
129+
Restart the :binary:`~bin.mongod` instance as a replica set
130+
member with its original configuration; that is, undo the
131+
configuration changes made when starting as a standalone.
132+
133+
For shard or config server members, be sure to remove the
134+
:parameter:`skipShardingConfigurationChecks` parameter.
67135

68136
When it has started, connect the :binary:`~bin.mongo` shell to the
69137
restarted instance.
@@ -90,25 +158,99 @@ action:
90158
language: javascript
91159
code: rs.stepDown(300)
92160
post: |
93-
After the primary steps down, the replica set will elect a new
94-
primary. See :ref:`replica-set-elections` for more
95-
information about replica set elections.
96-
97-
Restart :binary:`~bin.mongod` as a standalone instance, making
98-
the following modifications to the configuration file.
99-
100-
- Comment out the :setting:`replication.replSetName` option.
101-
- For :term:`shard` or :term:`config server` replica sets, comment out
102-
the :setting:`sharding.clusterRole`.
103-
104-
If using command line options, modify :option:`--port <mongod --port>`
105-
and remove the :option:`--replSetName <mongod --replSet>`,
106-
:option:`--shardsvr <mongod --shardsvr>`, and
107-
:option:`--configsvr <mongod --configsvr>` options.
108-
109-
.. include:: /includes/warning-bind-ip-security-considerations.rst
110-
111-
After performing all maintenance tasks, restart the
112-
:binary:`~bin.mongod` instance as a member of the replica set
113-
using its normal command-line arguments or configuration file.
161+
After the primary steps down, the replica set will :ref:`elect a new
162+
primary <replica-set-elections>`.
163+
164+
Restart :binary:`~bin.mongod` as a standalone instance, making the
165+
following configuration updates.
166+
167+
.. tabs::
168+
169+
tabs:
170+
- id: config-file
171+
name: Configuration File
172+
content: |
173+
174+
If you are using a configuration file, make the following
175+
configuration updates:
176+
177+
- Comment out the :setting:`replication.replSetName` option.
178+
179+
- Change the :setting:`net.port` to a different port.
180+
Make a note of the original port setting as a comment.
181+
182+
- If the :binary:`~bin.mongod` is a :term:`shard` or
183+
:term:`config server` member, you must also:
184+
185+
- Comment out the :setting:`sharding.clusterRole` option.
186+
187+
- Set parameter :parameter:`skipShardingConfigurationChecks`
188+
(available for MongoDB 4.0+, 3.6.3+, 3.4.11+, 3.2.19+) to
189+
``true`` in the :setting:`setParameter` section.
190+
191+
For example, if performing maintenance on a shard/config
192+
server replica set member for maintenance, the updated
193+
configuration file will include content like the
194+
following example:
195+
196+
.. code-block:: yaml
197+
198+
net:
199+
bindIp: localhost,<ip address of the mongod host>
200+
port: 27218
201+
# port: 27018
202+
#replication:
203+
# replSetName: shardA
204+
#sharding:
205+
# clusterRole: shardsvr
206+
setParameter:
207+
skipShardingConfigurationChecks: true
208+
209+
- id: command-line
210+
name: Command-line Options
211+
content: |
212+
213+
If using command-line options, make the following
214+
configuration updates:
215+
216+
- Remove :option:`--replSetName <mongod --replSet>`.
217+
218+
- Modify :option:`--port <mongod --port>` to a different port.
219+
220+
- If the :binary:`~bin.mongod` is a :term:`shard` or
221+
:term:`config server` member, you must also:
222+
223+
- Remove :option:`--shardsvr <mongod --shardsvr>` if a
224+
shard member and :option:`--configsvr <mongod
225+
--configsvr>` if a config server member.
226+
227+
- Set parameter
228+
:parameter:`skipShardingConfigurationChecks`
229+
(available for MongoDB 4.0+, 3.6.3+, 3.4.11+,
230+
3.2.19+) to ``true`` in the :setting:`setParameter`
231+
section.
232+
233+
234+
For example, to restart a replica set member that is not part of a sharded cluster:
235+
236+
.. code-block:: sh
237+
238+
mongod --port 37017 --dbpath /srv/mongodb --bind_ip localhost,<ip address of the mongod host>
239+
240+
For example, to restart a shard/config server replica set member for maintenance:
241+
242+
.. code-block:: sh
243+
244+
mongod --port 37017 --dbpath /srv/mongodb --bind_ip localhost,<ip address of the mongod host> --setParameter skipShardingConfigurationChecks=true
245+
246+
.. include:: /includes/warning-bind-ip-security-considerations.rst
247+
248+
After performing all maintenance tasks, restart the
249+
:binary:`~bin.mongod` instance as a replica set member with its
250+
original configuration; that is, undo the configuration changes made
251+
when starting as a standalone.
252+
253+
For shard or config server members, be sure to remove the
254+
:parameter:`skipShardingConfigurationChecks` parameter.
255+
114256
...

source/reference/parameters.txt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1597,6 +1597,40 @@ Sharding Parameters
15971597

15981598
db.adminCommand( { setParameter: 1, orphanCleanupDelaySecs: 1200 } )
15991599

1600+
.. parameter:: skipShardingConfigurationChecks
1601+
1602+
.. versionadded:: 3.6.3
1603+
1604+
|mongod-only|
1605+
1606+
Type: boolean
1607+
1608+
Default: false
1609+
1610+
When ``true``, allows for starting a shard member or config server
1611+
member as a standalone for maintenance operations. This parameter is
1612+
mutually exclusive with the :option:`--configsvr <mongod
1613+
--configsvr>` or :option:`--shardsvr <mongod --shardsvr>` options.
1614+
1615+
You can only set this parameter during start-up and cannot change
1616+
this setting using the :dbcommand:`setParameter` database command.
1617+
1618+
.. code-block:: sh
1619+
1620+
mongod --setParameter skipShardingConfigurationChecks=true
1621+
1622+
.. important::
1623+
1624+
Once maintenance has completed, remove the
1625+
:parameter:`skipShardingConfigurationChecks` parameter when
1626+
restarting the :binary:`~bin.mongod`.
1627+
1628+
The parameter is also available for MongoDB versions:
1629+
1630+
- MongoDB 3.2.19+
1631+
1632+
- MongoDB 3.4.11+
1633+
16001634
Storage Parameters
16011635
~~~~~~~~~~~~~~~~~~
16021636

0 commit comments

Comments
 (0)