From 3d92e68734df6aa4ae892a45fbd89f538bd507f7 Mon Sep 17 00:00:00 2001 From: Bob Grabar Date: Thu, 27 Jun 2013 16:41:54 -0400 Subject: [PATCH] edits+readability: rs-remove-member Old --- file: build/rs-remove/json/tutorial/remove-replica-set-member.json source: source/tutorial/remove-replica-set-member.txt stats: coleman-liau: 9.581293532338304 flesch-ease: 51.9180325644505 flesch-level: 10.557259158751695 foggy: count: 4 factor: 0.01990049751243781 threshold: 3 sentence-count: 11 sentence-len-avg: 18 smog-index: 6.574015621080383 word-count: 201 New --- file: build/rs-remove/json/tutorial/remove-replica-set-member.json source: source/tutorial/remove-replica-set-member.txt stats: coleman-liau: 8.032777777777778 flesch-ease: 64.144 flesch-level: 7.8898888888888905 foggy: count: 0 factor: 0.0 threshold: 3 sentence-count: 10 sentence-len-avg: 14 smog-index: 3.1291 word-count: 144 --- source/tutorial/remove-replica-set-member.txt | 55 +++++++++---------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/source/tutorial/remove-replica-set-member.txt b/source/tutorial/remove-replica-set-member.txt index d6aab0bce51..015ee7117f3 100644 --- a/source/tutorial/remove-replica-set-member.txt +++ b/source/tutorial/remove-replica-set-member.txt @@ -4,35 +4,32 @@ Remove Members from Replica Set .. default-domain:: mongodb -You may remove a member of a replica set at any time; *however*, for best +For best results always *shut down* the :program:`mongod` instance before -removing it from a replica set. +removing it from a :term:`replica set`. .. versionchanged:: 2.2 - Before 2.2, you *had* to shut down the :program:`mongod` instance - before removing it. While 2.2 removes this requirement, it remains - good practice. - -To remove a member, use the -:method:`rs.remove()` method in the :program:`mongo` shell while -connected to the current :term:`primary`. Issue the -:method:`db.isMaster()` command when connected to *any* member of the -set to determine the current primary. Use a command in either -of the following forms to remove the member: - -.. code-block:: javascript - - rs.remove("mongo2.example.net:27017") - rs.remove("mongo3.example.net") - -This operation disconnects the shell briefly and forces a -re-connection as the :term:`replica set` renegotiates which member -will be primary. The shell displays an error even if this -command succeeds. - -You can re-add a removed member to a replica set at any time using the -:doc:`procedure for adding replica set members `. -Additionally, consider using the :ref:`replica set reconfiguration procedure -` to change the -:data:`~local.system.replset.members[n].host` value to rename a member in a replica set -directly. + In versions prior to 2.2, you *must* to shut down the :program:`mongod` instance + before removing it. + +To remove a member: + +1. Connect to the :term:`primary`. + + If you do not know which member is the primary, connect to any member + and issue the :method:`db.isMaster()` command. + +#. Use :method:`rs.remove()` in either of the following forms to remove + the member: + + .. code-block:: javascript + + rs.remove("mongo2.example.net:27017") + rs.remove("mongo3.example.net") + + MongoDB disconnects the shell briefly and forces a re-connection as + the replica set runs a new election for primary. The shell displays + an error even if this command succeeds. + +To add a member back to a replica set, see the :doc:`procedure for +adding replica set members `.