@@ -97,7 +97,7 @@ which will disconnect the shell (such as adding a new member with
97
97
a higher priority than the current primary). In such cases, the :binary:`~bin.mongo`
98
98
shell may display an error even if the operation succeeds.
99
99
100
- .. tip ::
100
+ .. warning ::
101
101
102
102
.. include:: /includes/tip-repl-set-add-members.rst
103
103
@@ -133,48 +133,18 @@ to a new replica set, you can call the :method:`rs.add()` method with:
133
133
Add a Secondary to an Existing Replica Set
134
134
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
135
135
136
- .. tip::
137
-
138
- .. include:: /includes/tip-repl-set-add-members.rst
139
-
140
- To add a new secondary member with default vote and priority settings
136
+ Add a new secondary member with default vote and priority settings
141
137
to an existing replica set:
142
138
143
- #. Add the member initially as a :ref:`non-voting
144
- <replica-set-non-voting-members>`, :doc:`priority 0
145
- </core/replica-set-priority-0-member>` member:
146
-
147
- .. cssclass:: copyable-code
148
-
149
- .. code-block:: javascript
150
-
151
- rs.add( { host: "mongodbd4.example.net:27017", priority: 0, votes: 0 } )
152
-
153
- #. Ensure that the new member has reached :replstate:`SECONDARY` state.
154
- To check the state of the replica set members, run
155
- :method:`rs.status()`:
156
-
157
- .. cssclass:: copyable-code
158
- .. code-block:: javascript
159
-
160
- rs.status()
161
-
162
- #. Reconfigure the replica set to update the votes and priority of the
163
- new member:
164
-
165
- .. code-block:: javascript
166
-
167
- var cfg = rs.conf();
139
+ .. cssclass:: copyable-code
168
140
169
- cfg.members[n].priority = 1; // Substitute the correct array index for the new member
170
- cfg.members[n].votes = 1; // Substitute the correct array index for the new member
141
+ .. code-block:: javascript
171
142
172
- rs.reconfig(cfg )
143
+ rs.add( { host: "mongodbd4.example.net:27017" } )
173
144
174
- where ``n`` is the array index of the new member in the
175
- :rsconf:`members` array.
145
+ .. warning::
176
146
177
- .. include:: /includes/warning-rs-reconfig .rst
147
+ .. include:: /includes/tip-repl-set-add-members .rst
178
148
179
149
.. _rs-add-priority-0:
180
150
@@ -212,7 +182,7 @@ the host ``mongodb3.example.net`` and accessible on the default port
212
182
.. cssclass:: copyable-code
213
183
214
184
.. code-block:: javascript
215
-
185
+
216
186
rs.add( { host: "mongodb3.example.net:27017", arbiterOnly: true } )
217
187
218
188
- Host name
0 commit comments