Skip to content

Commit ec92c76

Browse files
author
Sam Kleinman
committed
migration: upgrading to replica sets
1 parent f597d64 commit ec92c76

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,28 @@ administration </replication>`, see:
2020
- :doc:`/administration/replica-sets`, and
2121
- :doc:`/applications/replication`.
2222

23+
.. note::
24+
25+
If you're converting a standalone instance into a replica set that
26+
is a :term:`shard` in a :term:`sharded cluster` you must change the
27+
shard host information in the :term:`config database`. While
28+
connected to a :program:`mongos` instance with a :program:`mongo`
29+
shell, issue a command in the following form:
30+
31+
.. code-block:: javascript
32+
33+
db.getSiblingDB("config").shards.save( {_id: "<name>", host: "<replica-set>/<member,><member,><...>" } )
34+
35+
Replace ``<name>`` with the name of the shard, replace
36+
``<replica-set>`` with the name of the replica set, and replace
37+
``<member,><member,><>`` with the list of the members of the
38+
replica set.
39+
40+
After completing this operation you must restart all
41+
:program:`mongos` instances. When possible you should restart all
42+
components of the replica sets (i.e. all :program:`mongos` and all
43+
shard :program:`mongod` instances.)
44+
2345
Procedure
2446
---------
2547

0 commit comments

Comments
 (0)