@@ -10,30 +10,94 @@ action:
10
10
title : Restart the secondary as a standalone on a different port.
11
11
stepnum : 2
12
12
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 : |
30
14
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.
37
101
---
38
102
title : Perform maintenance operations on the secondary.
39
103
stepnum : 3
@@ -61,9 +125,13 @@ action:
61
125
use admin
62
126
db.shutdownServer()
63
127
- 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.
67
135
68
136
When it has started, connect the :binary:`~bin.mongo` shell to the
69
137
restarted instance.
@@ -90,25 +158,99 @@ action:
90
158
language : javascript
91
159
code : rs.stepDown(300)
92
160
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
+
114
256
...
0 commit comments