@@ -109,7 +109,10 @@ This procedure assumes this configuration:
109
109
110
110
.. code-block:: javascript
111
111
112
- db.adminCommand({replSetFreeze:0})
112
+ rs.freeze()
113
+
114
+ The :method:`rs.freeze()` provides a wrapper around the
115
+ :dbcommand:`replSetFreeze` database command.
113
116
114
117
.. _replica-set-force-member-to-be-primary-via-dbcommands:
115
118
@@ -118,30 +121,40 @@ Force a Member to be Primary Using Database Commands
118
121
119
122
.. versionchanged:: 1.8
120
123
121
- For this procedure, assume you have a :term:`replica set` with members
122
- ``A``, ``B``, and ``C`` where ``A`` is current :term:`primary`. To
123
- make ``B`` the primary, use the :method:`rs.freeze()` and
124
- :method:`rs.stepDown()` methods that wrap the
125
- :dbcommand:`replSetFreeze` and :dbcommand:`replSetStepDown` commands.
124
+ Consider a :term:`replica set` with the following members:
125
+
126
+ - ``mdb0.example.net`` - the current :term:`primary`.
127
+ - ``mdb1.example.net`` - a :term:`secondary`.
128
+ - ``mdb2.example.net`` - a secondary .
129
+
130
+ To force a member to become primary use the following procedure:
126
131
127
132
1. In a :program:`mongo` shell, run :method:`rs.status()` to ensure your replica
128
133
set is running as expected.
129
134
130
- #. In a :program:`mongo` shell connected to ``C``, freeze ``C`` so that it does
131
- not attempt to become primary for 120 seconds.
135
+ #. In a :program:`mongo` shell connected to the :program:`mongod`
136
+ instance running on ``mdb2.example.net``, freeze
137
+ ``mdb2.example.net`` so that it does not attempt to become primary
138
+ for 120 seconds.
132
139
133
140
.. code-block:: javascript
134
141
135
142
rs.freeze(120)
136
143
137
- #. In a :program:`mongo` shell connected to ``A``, step down ``A`` so that it is not
138
- eligible to become primary for 120 seconds:
144
+ #. In a :program:`mongo` shell connected the :program:`mongod` running
145
+ on ``mdb0.example.net``, step down this instance that the
146
+ :program:`mongod` is not eligible to become primary for 120
147
+ seconds:
139
148
140
149
.. code-block:: javascript
141
150
142
151
rs.stepDown(120)
143
152
144
- ``B `` becomes primary.
153
+ ``mdb1.example.net `` becomes primary.
145
154
146
155
.. note:: During the transition, there is a short window where
147
156
the set does not have a primary.
157
+
158
+ For more information, consider the :method:`rs.freeze()` and
159
+ :method:`rs.stepDown()` methods that wrap the
160
+ :dbcommand:`replSetFreeze` and :dbcommand:`replSetStepDown` commands.
0 commit comments