Skip to content

Commit 935f8e8

Browse files
jdestefano-mongokay-kim
authored andcommitted
DOCS-11064 - Shard and config servers must be replica set members.
1 parent 2302a7e commit 935f8e8

15 files changed

+143
-137
lines changed

source/core/sharded-cluster-components.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ Sharded Cluster Components
1919
A MongoDB :term:`sharded cluster` consists of the following components:
2020

2121
* :doc:`shard </core/sharded-cluster-shards>`: Each shard contains a
22-
subset of the sharded data. Each shard can be deployed as a :term:`replica
23-
set`.
22+
subset of the sharded data. As of MongoDB 3.6, shards must be deployed
23+
as a :term:`replica set`.
2424

2525
* :doc:`/core/sharded-cluster-query-router`: The ``mongos`` acts as a
2626
query router, providing an interface between client applications and the

source/core/sharded-cluster-shards.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ A :term:`shard` contains a subset of sharded data for a :term:`sharded
1414
cluster`. Together, the cluster's shards hold the entire data set for the
1515
cluster.
1616

17-
Shards should be deployed as a :term:`replica set` to provide redundancy and
18-
high availability.
17+
As of MongoDB 3.6, shards must be deployed as a :term:`replica set` to
18+
provide redundancy and high availability.
1919

2020
Users, clients, or applications should only directly connect to a shard to
2121
perform local administrative and maintenance operations.

source/includes/apiargs-dbcommand-addShard-field.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
arg_name: field
22
description: |
3-
The hostname and port of the :binary:`~bin.mongod` instance to be added
4-
as a shard. To add a replica set as a shard, specify the name
5-
of the replica set and the hostname and port of a member of the replica set.
3+
The replica set name and hostname of at least one member of the
4+
shard's replica set. Include the port number if the instance is
5+
running on a non-standard port. All additional hostnames must be comma
6+
separated and belong to the same replica set. For example:
7+
8+
.. code-block:: sh
9+
10+
<replica_set>/<hostname><:port>,<hostname><:port>, ...
11+
612
interface: dbcommand
713
name: addShard
814
operation: addShard

source/includes/apiargs-method-sh.addShard-param.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
arg_name: param
22
description: |
3-
The hostname of either a standalone database instance or of a replica
4-
set. Include the port number if the instance is running on a
5-
non-standard port. Include the replica set name if the instance is a
6-
replica set, as explained below.
3+
The replica set name and hostname of at least one member of the
4+
shard's replica set. Include the port number if the instance is
5+
running on a non-standard port. All additional hostnames must be comma
6+
separated and belong to the same replica set. For example:
7+
8+
.. code-block:: sh
9+
10+
<replica_set>/<hostname><:port>,<hostname><:port>, ...
11+
712
interface: method
813
name: host
914
operation: sh.addShard
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.. note::
2+
3+
The :option:`--bind_ip <mongod --bind_ip>` option must be specified when
4+
the sharded cluster members are run on different hosts or if
5+
remote clients connect to the sharded cluster. If you are
6+
deploying the entire sharded cluster on a single host and
7+
do not require external client connections, you can omit the
8+
:option:`--bind_ip <mongod --bind_ip>` option. For more information, see
9+
:ref:`3.6-bind_ip-compatibility`.

source/includes/options-conf.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,6 +1379,13 @@ description: |
13791379
- Start this instance as a :term:`shard`. The instance starts
13801380
on port ``27018`` by default.
13811381
post: |
1382+
.. note::
1383+
1384+
Setting ``sharding.clusterRole`` requires the :binary:`~bin.mongod`
1385+
instance to be running with replication. To deploy the instance as
1386+
a replica set member, use the :setting:`~replication.replSetName`
1387+
setting and specify the name of the replica set to join.
1388+
13821389
The {{role}} setting is available only for :binary:`~bin.mongod`.
13831390
---
13841391
program: conf

source/includes/options-mongod.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,6 +1144,21 @@ description: |
11441144
Configures this {{program}} instance as a shard in a
11451145
sharded cluster. The default port for these instances is
11461146
``27018``.
1147+
1148+
.. important::
1149+
1150+
.. versionchanged:: 3.6
1151+
1152+
You must deploy shards as replica sets with the :option:`--replSet`
1153+
option or :setting:`~replication.replSetName` setting
1154+
specified. To deploy sharded clusters with shard replica
1155+
sets, follow the appropriate tutorial depending on your
1156+
:ref:`sharding strategy<sharding-strategy>`:
1157+
1158+
- :doc:`/tutorial/deploy-sharded-cluster-hashed-sharding`
1159+
1160+
- :doc:`/tutorial/deploy-sharded-cluster-ranged-sharding`
1161+
11471162
optional: false
11481163
---
11491164
program: mongod

source/includes/steps-3.6-upgrade-sharded-cluster.yaml

Lines changed: 66 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -38,38 +38,38 @@ title: "Upgrade the config servers."
3838
level: 4
3939
ref: 3.6-upgrade-config-servers
4040
content: |-
41-
If the config servers are replica sets:
42-
4341
1. Upgrade the :ref:`secondary <replica-set-secondary-members>`
4442
members of the replica set one at a time:
4543
4644
a. Shut down the secondary :binary:`~bin.mongod` instance and replace
4745
the |oldversion| binary with the |newversion| binary.
4846
49-
#. Start the |newversion| binary with both the ``--configsvr``,
50-
``--port`` options,
51-
52-
If the sharded cluster members are run on different hosts or
53-
if you wish remote clients to connect to the sharded cluster,
54-
you must also specify ``--bind_ip`` (or the
55-
:setting:`net.bindIp` setting). For more information, see
56-
:ref:`3.6-bind_ip-compatibility`.
47+
#. Start the |newversion| binary with the :option:`--configsvr <mongod --configsvr>`,
48+
:option:`--replSet <mongod --replSet>`, :option:`--port <mongod --port>`, and :option:`--bind_ip <mongod --bind_ip>`
49+
options. Include any optional command line options used by the
50+
previous deployment:
5751
52+
.. cssclass:: copyable-code
5853
.. code-block:: sh
5954
60-
mongod --configsvr --port <port> --dbpath <path> --bind_ip localhost,<ip address>
55+
mongod --configsvr --replSet <replSetName> --port <port> --dbpath <path> --bind_ip localhost,<ip address>
56+
57+
.. include:: /includes/fact-bind-ip-sharded-clusters.rst
6158
6259
If using a :doc:`configuration file
6360
</reference/configuration-options>`, update the file to
6461
specify :setting:`sharding.clusterRole: configsvr
65-
<sharding.clusterRole>` and :setting:`net.port` (and
66-
:setting:`net.bindIp` setting if needed) and start the
67-
|newversion| binary:
62+
<sharding.clusterRole>`, :setting:`replication.replSetName`,
63+
:setting:`net.port`, and :setting:`net.bindIp`,
64+
then start the |newversion| binary:
6865
66+
.. cssclass:: copyable-code
6967
.. code-block:: yaml
7068
7169
sharding:
7270
clusterRole: configsvr
71+
replication:
72+
replSetName: <string>
7373
net:
7474
port: <port>
7575
bindIp: localhost,<ip address>
@@ -90,6 +90,7 @@ content: |-
9090
:method:`rs.stepDown()` to step down the primary and force an
9191
election of a new primary:
9292
93+
.. cssclass:: copyable-code
9394
.. code-block:: javascript
9495
9596
rs.stepDown()
@@ -99,31 +100,32 @@ content: |-
99100
the stepped-down primary and replace the :binary:`~bin.mongod` binary
100101
with the |newversion| binary.
101102
102-
#. Start the |newversion| binary with both the ``--configsvr`` and
103-
``--port`` options:
104-
105-
If the sharded cluster members are run on different hosts or
106-
if you wish remote clients to connect to the sharded cluster,
107-
you must also specify ``--bind_ip`` (or the
108-
:setting:`net.bindIp` setting). For more information, see
109-
:ref:`3.6-bind_ip-compatibility`.
103+
#. Start the |newversion| binary with the :option:`--configsvr <mongod --configsvr>`,
104+
:option:`--replSet <mongod --replSet>`, :option:`--port <mongod --port>`, and :option:`--bind_ip <mongod --bind_ip>`
105+
options. Include any optional command line options used by the
106+
previous deployment:
110107
108+
.. cssclass:: copyable-code
111109
.. code-block:: sh
112110
113-
mongod --configsvr --port <port> --dbpath <path> --bind_ip localhost,<ip address>
111+
mongod --configsvr --replSet <replSetName> --port <port> --dbpath <path> --bind_ip localhost,<ip address>
114112
113+
.. include:: /includes/fact-bind-ip-sharded-clusters.rst
115114
116115
If using a :doc:`configuration file
117116
</reference/configuration-options>`, update the file to
118117
specify :setting:`sharding.clusterRole: configsvr
119-
<sharding.clusterRole>` and :setting:`net.port` (and
120-
:setting:`net.bindIp` setting if needed), and start the
121-
|newversion| binary:
118+
<sharding.clusterRole>`, :setting:`replication.replSetName`,
119+
:setting:`net.port`, and :setting:`net.bindIp`,
120+
then start the |newversion| binary:
122121
122+
.. cssclass:: copyable-code
123123
.. code-block:: yaml
124124
125125
sharding:
126126
clusterRole: configsvr
127+
replication:
128+
replSetName: <string>
127129
net:
128130
port: <port>
129131
bindIp: localhost,<ip address>
@@ -136,37 +138,43 @@ title: Upgrade the shards.
136138
level: 4
137139
ref: 3.6-upgrade-shards
138140
content: |-
139-
Upgrade the shards one at a time. If the shards are replica sets, for each shard:
141+
Upgrade the shards one at a time. If you are running standalone
142+
shards, first convert them to a
143+
:doc:`replica set</tutorial/convert-standalone-to-replica-set>`.
144+
145+
For each shard:
140146
141147
1. Upgrade the :ref:`secondary <replica-set-secondary-members>`
142148
members of the replica set one at a time:
143149
144150
a. Shut down the :binary:`~bin.mongod` instance and replace the |oldversion|
145151
binary with the |newversion| binary.
146152
147-
#. Start the |newversion| binary with the ``--shardsvr`` and
148-
``--port`` command line options.
149-
150-
If the sharded cluster members are run on different hosts or
151-
if you wish remote clients to connect to the sharded cluster,
152-
you must also specify ``--bind_ip`` (or the
153-
:setting:`net.bindIp` setting). For more information, see
154-
:ref:`3.6-bind_ip-compatibility`.
153+
#. Start the |newversion| binary with the :option:`--shardsvr <mongod --shardsvr>`,
154+
:option:`--replSet <mongod --replSet>`, :option:`--port <mongod --port>`, and :option:`--bind_ip <mongod --bind_ip>`
155+
options. Include any optional command line options used by the
156+
previous deployment:
155157
158+
.. cssclass:: copyable-code
156159
.. code-block:: sh
157160
158-
mongod --shardsvr --port <port> --dbpath <path> --bind_ip localhost,<ip address>
161+
mongod --shardsvr --replSet <replSetName> --port <port> --dbpath <path> --bind_ip localhost,<ip address>
162+
163+
.. include:: /includes/fact-bind-ip-sharded-clusters.rst
159164
160-
Of if using a :doc:`configuration file
165+
If using a :doc:`configuration file
161166
</reference/configuration-options>`, update the file to
162-
include :setting:`sharding.clusterRole: shardsvr
163-
<sharding.clusterRole>` and :setting:`net.port` (and
164-
:setting:`net.bindIp` setting if needed) and start:
167+
include :setting:`sharding.clusterRole: shardsvr <sharding.clusterRole>`,
168+
:setting:`replication.replSetName`, :setting:`net.port`, and
169+
:setting:`net.bindIp`, then start the |newversion| binary:
165170
171+
.. cssclass:: copyable-code
166172
.. code-block:: yaml
167173
168174
sharding:
169175
clusterRole: shardsvr
176+
replication:
177+
replSetName: <string>
170178
net:
171179
port: <port>
172180
bindIp: localhost,<ip address>
@@ -188,6 +196,7 @@ content: |-
188196
:method:`rs.stepDown()` to step down the primary and force an
189197
election of a new primary:
190198
199+
.. cssclass:: copyable-code
191200
.. code-block:: javascript
192201
193202
rs.stepDown()
@@ -199,30 +208,32 @@ content: |-
199208
1. Shut down the stepped-down primary and replace the
200209
:binary:`~bin.mongod` binary with the |newversion| binary.
201210
202-
#. Start the |newversion| binary with the ``--shardsvr`` and
203-
``--port`` command line options.
204-
205-
If the sharded cluster members are run on different hosts or
206-
if you wish remote clients to connect to the sharded cluster,
207-
you must also specify ``--bind_ip`` (or the
208-
:setting:`net.bindIp` setting). For more information, see
209-
:ref:`3.6-bind_ip-compatibility`.
211+
#. Start the |newversion| binary with the :option:`--shardsvr <mongod --shardsvr>`,
212+
:option:`--replSet <mongod --replSet>`, :option:`--port <mongod --port>`, and :option:`--bind_ip <mongod --bind_ip>`
213+
options. Include any optional command line options used by the
214+
previous deployment:
210215
216+
.. cssclass:: copyable-code
211217
.. code-block:: sh
212218
213-
mongod --shardsvr --port <port> --dbpath <path> --bind_ip localhost,<ip address>
219+
mongod --shardsvr --replSet <replSetName> --port <port> --dbpath <path> --bind_ip localhost,<ip address>
214220
215-
Of if using a :doc:`configuration file
221+
.. include:: /includes/fact-bind-ip-sharded-clusters.rst
222+
223+
If using a :doc:`configuration file
216224
</reference/configuration-options>`, update the file to
217225
specify :setting:`sharding.clusterRole: shardsvr
218-
<sharding.clusterRole>` and :setting:`net.port` (and
219-
:setting:`net.bindIp` setting if needed) and start the
226+
<sharding.clusterRole>`, :setting:`replication.replSetName`,
227+
:setting:`net.port`, and :setting:`net.bindIp`, then start the
220228
|newversion| binary:
221229
230+
.. cssclass:: copyable-code
222231
.. code-block:: yaml
223232
224233
sharding:
225234
clusterRole: shardsvr
235+
replication:
236+
replSetName: <string>
226237
net:
227238
port: <port>
228239
bindIp: localhost,<ip address>
@@ -245,6 +256,7 @@ content: |-
245256
:setting:`net.bindIp` setting). For more information, see
246257
:ref:`3.6-bind_ip-compatibility`.
247258
259+
.. cssclass:: copyable-code
248260
.. code-block:: sh
249261
250262
mongos --configdb csReplSet/<rsconfigsver1:port1>,<rsconfigsver2:port2>,<rsconfigsver3:port3> --bind_ip localhost,<ip address>
@@ -259,7 +271,6 @@ content: |-
259271
:method:`sh.setBalancerState()` to re-enable the balancer:
260272
261273
.. cssclass:: copyable-code
262-
263274
.. code-block:: javascript
264275
265276
sh.setBalancerState(true)
@@ -286,9 +297,11 @@ action:
286297
On a :binary:`~bin.mongos` instance, run the
287298
:dbcommand:`setFeatureCompatibilityVersion` command in the ``admin``
288299
database:
300+
copyable: true
289301
language: javascript
290302
code: |
291303
db.adminCommand( { setFeatureCompatibilityVersion: "3.6" } )
304+
292305
post: |
293306
This command must perform writes to an internal system
294307
collection. If for any reason the command does not complete

source/includes/steps-deploy-sharded-cluster-shard-replica.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ action:
4444
following example:
4545
language: sh
4646
code: |
47-
mongod --keyFile <path-to-keyfile> --shardsvr --replSet <replSetname> --dbpath <path>
47+
mongod --keyFile <path-to-keyfile> --shardsvr --replSet <replSetName> --dbpath <path>
4848
post: |
4949
.. include:: /includes/extracts/default-bind-ip-security-additional-command-line.rst
5050
---

0 commit comments

Comments
 (0)