Skip to content

Commit ddc18c5

Browse files
committed
DOCS-11064: 3.6 shard repl sets
1 parent 935f8e8 commit ddc18c5

13 files changed

+109
-84
lines changed

source/core/master-slave.txt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,7 @@ Convert a Master-Slave Deployment to a Replica Set
256256
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
257257

258258
To convert a master-slave deployment to a replica set, restart the
259-
current master as a one-member replica set. Then remove the data
260-
directories from previous secondaries and add them as new secondaries to
261-
the new replica set.
259+
current master as a one-member replica set.
262260

263261
1. To confirm that the current instance is master, run:
264262

@@ -324,10 +322,9 @@ the new replica set.
324322

325323
rs.status()
326324

327-
You can now follow the :doc:`convert a standalone to a replica set
328-
</tutorial/convert-standalone-to-replica-set>` tutorial to deploy your
329-
replica set, picking up from the :ref:`Expand the Replica Set
330-
<expand-the-replica-set>` section.
325+
To add the former slaves as secondaries to the replica set, remove the
326+
their data directories and add to the replica set. See
327+
:doc:`/tutorial/expand-replica-set` to add new members to a replica set.
331328

332329
Failing over to a Slave (Promotion)
333330
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
arg_name: field
1+
name: addShard
22
description: |
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:
3+
4+
The replica set name, hostname, and port of at least one member of
5+
the shard's replica set. Any additional replica set member hostnames
6+
must be comma separated. For example:
77
88
.. code-block:: sh
99
1010
<replica_set>/<hostname><:port>,<hostname><:port>, ...
1111
1212
interface: dbcommand
13-
name: addShard
13+
arg_name: field
1414
operation: addShard
1515
optional: false
1616
position: 1

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
arg_name: param
22
description: |
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:
3+
The replica set name, hostname, and port of at least one member of
4+
the shard's replica set. Any additional replica set member hostnames
5+
must be comma separated. For example:
76
87
.. code-block:: sh
98

source/includes/fact-bind-ip-sharded-clusters.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,5 @@
22

33
The :option:`--bind_ip <mongod --bind_ip>` option must be specified when
44
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
5+
remote clients connect to the sharded cluster. For more information, see
96
:ref:`3.6-bind_ip-compatibility`.

source/includes/options-conf.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,7 @@ post: |
13841384
Setting ``sharding.clusterRole`` requires the :binary:`~bin.mongod`
13851385
instance to be running with replication. To deploy the instance as
13861386
a replica set member, use the :setting:`~replication.replSetName`
1387-
setting and specify the name of the replica set to join.
1387+
setting and specify the name of the replica set.
13881388
13891389
The {{role}} setting is available only for :binary:`~bin.mongod`.
13901390
---

source/includes/options-mongod.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,15 +1149,9 @@ description: |
11491149
11501150
.. versionchanged:: 3.6
11511151
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>`:
1152+
You must deploy shards as replica sets. See the :option:`--replSet`
1153+
option to deploy {{program}} as part of a replica set.
11571154
1158-
- :doc:`/tutorial/deploy-sharded-cluster-hashed-sharding`
1159-
1160-
- :doc:`/tutorial/deploy-sharded-cluster-ranged-sharding`
11611155
11621156
optional: false
11631157
---

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

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,16 @@ content: |-
4545
the |oldversion| binary with the |newversion| binary.
4646
4747
#. 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:
48+
:option:`--replSet <mongod --replSet>`, and :option:`--port <mongod --port>`.
49+
Include any other options as used by the deployment.
50+
51+
.. include:: /includes/fact-bind-ip-sharded-clusters.rst
5152
5253
.. cssclass:: copyable-code
5354
.. code-block:: sh
5455
5556
mongod --configsvr --replSet <replSetName> --port <port> --dbpath <path> --bind_ip localhost,<ip address>
5657
57-
.. include:: /includes/fact-bind-ip-sharded-clusters.rst
58-
5958
If using a :doc:`configuration file
6059
</reference/configuration-options>`, update the file to
6160
specify :setting:`sharding.clusterRole: configsvr
@@ -76,7 +75,7 @@ content: |-
7675
storage:
7776
dbpath: <path>
7877
79-
Include any other configuration as appropriate for your deployment.
78+
Include any other settings as appropriate for your deployment.
8079
8180
#. Wait for the member to recover to ``SECONDARY`` state before
8281
upgrading the next secondary member. To check the member's state,
@@ -138,11 +137,9 @@ title: Upgrade the shards.
138137
level: 4
139138
ref: 3.6-upgrade-shards
140139
content: |-
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:
140+
Upgrade the shards one at a time.
141+
142+
For each shard replica set:
146143
147144
1. Upgrade the :ref:`secondary <replica-set-secondary-members>`
148145
members of the replica set one at a time:
@@ -250,11 +247,7 @@ content: |-
250247
and restart. Include any other configuration as appropriate for your
251248
deployment.
252249
253-
If the sharded cluster members are run on different hosts or
254-
if you wish remote clients to connect to the sharded cluster,
255-
you must also specify ``--bind_ip`` (or the
256-
:setting:`net.bindIp` setting). For more information, see
257-
:ref:`3.6-bind_ip-compatibility`.
250+
.. include:: /includes/fact-bind-ip-sharded-clusters.rst
258251
259252
.. cssclass:: copyable-code
260253
.. code-block:: sh

source/reference/command/addShard.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ Definition
1515

1616
.. dbcommand:: addShard
1717

18-
Adds a :term:`replica set` to a :term:`sharded cluster`.
18+
Adds a shard replica set to a :term:`sharded cluster`.
1919

2020
Run :dbcommand:`addShard` when connected to a :binary:`~bin.mongos`
21-
instance. The command takes the following form when adding a replica
22-
set as a shard:
21+
instance. The command takes the following form to add a shard
22+
replica set:
2323

2424
.. code-block:: javascript
2525

@@ -68,5 +68,5 @@ The following command adds a replica set as a shard:
6868
.. warning::
6969

7070
Do not use ``localhost`` for the hostname unless your
71-
:term:`configuration server <config database>` is also running on
71+
config server is also running on
7272
``localhost``.

source/reference/method/sh.addShard.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ sh.addShard()
1313
Definition
1414
----------
1515

16-
.. method:: sh.addShard(host)
16+
.. method:: sh.addShard(<url>)
1717

18-
Adds a :term:`replica set` to a :term:`sharded cluster`. This method
18+
Adds a shard replica set to a :term:`sharded cluster`. This method
1919
must be run on a :binary:`~bin.mongos` instance.
2020

2121
The :method:`sh.addShard()` method has the following parameter:
@@ -31,7 +31,7 @@ Definition
3131
.. warning::
3232

3333
Do not use ``localhost`` for the hostname unless your
34-
:term:`configuration server <config database>`
34+
config server
3535
is also running on ``localhost``.
3636

3737
.. |mongodb-package| replace:: :binary:`~bin.mongos`

source/release-notes/3.6-compatibility.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@ Localhost Binding Compatibility Changes
2222

2323
.. include:: /includes/fact-bind-to-all-ips.rst
2424

25+
Shard Replica Set
26+
-----------------
27+
28+
Starting in 3.6, shards must be replica sets. To upgrade your sharded
29+
cluster to version 3.6, the shard servers must be running as a replica
30+
set.
31+
32+
To convert an existing shard standalone instance to a shard replica
33+
set, see :doc:`/tutorial/convert-standalone-to-replica-set`.
34+
35+
2536
HTTP Interface and REST API
2637
---------------------------
2738

source/release-notes/3.6-upgrade-sharded-cluster.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,16 @@ clients to connect to your sharded cluster.
4040

4141
For more information, see :ref:`3.6-bind_ip-compatibility`
4242

43-
Shard Servers Require Replication
44-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43+
Shard Replica Sets
44+
~~~~~~~~~~~~~~~~~~
4545

4646
Starting in MongoDB 3.6, :binary:`~bin.mongod` instances with the shard
47-
server role must be replica set members. The following procedure uses
48-
the :option:`--replSet <mongod --replSet>` option to deploy the instance as a member of the
49-
specified replica set.
47+
server role must be replica set members.
48+
49+
To upgrade your sharded cluster to version 3.6, the shard servers must
50+
be running as a replica set. To convert an existing shard standalone
51+
instance to a shard replica set, see
52+
:doc:`/tutorial/convert-standalone-to-replica-set`.
5053

5154
Prerequisites
5255
-------------

source/release-notes/3.6.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,13 @@ Replica Sets
561561
Sharded Clusters
562562
----------------
563563

564+
- Starting in 3.6, shards must be replica sets. To upgrade your sharded
565+
cluster to version 3.6, the shard servers must be running as a
566+
replica set.
567+
568+
To convert an existing shard standalone instance to a shard replica
569+
set, see :doc:`/tutorial/convert-standalone-to-replica-set`.
570+
564571
- Added :parameter:`ShardingTaskExecutorPoolMaxConnecting` parameter
565572
for :binary:`~bin.mongos` to control the rate at which :binary:`~bin.mongos`
566573
adds connections to a :binary:`~bin.mongod` instance.
@@ -571,8 +578,7 @@ Sharded Clusters
571578
- The ``config.system.sessions`` collection in the ``config`` database
572579
may now be sharded.
573580

574-
- To upgrade your sharded cluster to version 3.6, the shard servers must
575-
be running as a replica set.
581+
576582

577583
General Enhancements
578584
--------------------

source/tutorial/convert-standalone-to-replica-set.txt

Lines changed: 49 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ Convert a Standalone to a Replica Set
1010
:depth: 1
1111
:class: singlecol
1212

13-
This tutorial describes the process for converting a
14-
:term:`standalone` :binary:`~bin.mongod` instance into a three-member
15-
:term:`replica set`. Use standalone instances for testing and
16-
development, but always use replica sets in production. To install a
17-
standalone instance, see the :ref:`installation tutorials
18-
<tutorials-installation>`.
13+
This tutorial describes the process for converting a :term:`standalone`
14+
:binary:`~bin.mongod` instance into a :term:`replica set`. Use
15+
standalone instances for testing and development, but always use
16+
replica sets in production. To install a standalone instance, see the
17+
:ref:`installation tutorials <tutorials-installation>`.
1918

20-
To deploy a replica set without using a pre-existing :binary:`~bin.mongod`
21-
instance, see :doc:`/tutorial/deploy-replica-set`.
19+
To deploy a replica set without using a pre-existing
20+
:binary:`~bin.mongod` instance, see :doc:`/tutorial/deploy-replica-set`
21+
instead.
2222

2323
Procedure
2424
---------
@@ -40,6 +40,10 @@ Procedure
4040

4141
.. include:: /includes/fact-unique-replica-set-names.rst
4242

43+
If converting a shard standalone instance to a shard replica set,
44+
the shard replica set name must not use the same name as the config
45+
server replica set.
46+
4347
For more information on configuration options, see
4448
:doc:`/reference/configuration-options` and the :binary:`~bin.mongod`
4549
manual page.
@@ -52,36 +56,57 @@ Procedure
5256

5357
rs.initiate()
5458

55-
The replica set is now operational.
59+
The replica set is now operational. To view the replica set
60+
configuration, use :method:`rs.conf()`. To check the status of the
61+
replica set, use :method:`rs.status()`.
5662

57-
To view the replica set configuration, use :method:`rs.conf()`. To
58-
check the status of the replica set, use :method:`rs.status()`.
63+
.. important::
5964

60-
.. _expand-the-replica-set:
65+
If converting a shard standalone instance to a shard replica set, you
66+
must also :ref:`update the shard information <update-shard-host-info>`.
6167

6268
To add members to this replica set, use the :method:`rs.add()` method.
6369
For more information on adding members to a replica set, see
6470
:doc:`/tutorial/expand-replica-set`.
6571

72+
.. _update-shard-host-info:
73+
6674
Sharding Considerations
6775
~~~~~~~~~~~~~~~~~~~~~~~
6876

69-
If the new replica set is part of a :term:`sharded cluster`, change
70-
the shard host information in the :term:`config database` by doing
71-
the following:
77+
If the new replica set is a shard replica set, change the shard
78+
information in the :term:`config database` by doing the following:
7279

7380
#. Connect to one of the sharded cluster's :binary:`~bin.mongos`
74-
instances and issue a command in the following form:
81+
instances and retrieve the shard information:
82+
83+
.. code-block:: javascript
84+
85+
var myShard = db.getSiblingDB("config").shards.findOne( { _id: "<name>"} )
86+
87+
Replace ``<name>`` with the name of the shard.
88+
89+
.. note::
90+
91+
The ``<name>`` of the shard is separate from the shard replica
92+
set name. To retrieve the name of the shard, see the
93+
:data:`shards <sh.status.shards._id>` section in the results from
94+
the :method:`sh.status()` method.
95+
96+
#. Update the ``host`` information with the replica set information:
97+
98+
.. code-block:: javascript
99+
100+
myShard.host = "<replica-set>/<member,><member,><...>"
101+
102+
Replace ``<replica-set>`` with the name of the replica set. Replace
103+
``<member,><member,><...>`` with the list of the replica set members.
104+
105+
#. Save the information.
75106

76107
.. code-block:: javascript
77108

78-
db.getSiblingDB("config").shards.save( {_id: "<name>", host: "<replica-set>/<member,><member,><...>" } )
109+
db.getSiblingDB("config").shards.save( myShard )
79110

80-
Replace ``<name>`` with the name of the shard. Replace
81-
``<replica-set>`` with the name of the replica set. Replace
82-
``<member,><member,><>`` with the list of the members of the
83-
replica set.
111+
#. Restart all :binary:`~bin.mongos` instances and all shard binaries.
84112

85-
#. Restart all :binary:`~bin.mongos` instances. If possible, restart all
86-
components of the replica sets (i.e., all :binary:`~bin.mongos` and
87-
all shard :binary:`~bin.mongod` instances).

0 commit comments

Comments
 (0)