Skip to content

Commit 6d07075

Browse files
author
Sam Kleinman
committed
merge: DOCS-401
2 parents 4028c95 + 70e54bf commit 6d07075

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

source/administration/replica-sets.txt

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,8 @@ directly.
407407
Replacing a Member
408408
~~~~~~~~~~~~~~~~~~
409409

410-
Use this procedure to replace a member of a replica set when the host
411-
name has changed. This procedure preserves all existing configuration
410+
Use this procedure to replace a member of a replica set when the hostname
411+
has changed. This procedure preserves all existing configuration
412412
for a member, except its hostname/location.
413413

414414
You may need to replace a replica set member if you want to replace an
@@ -937,3 +937,32 @@ use an update operation that resembles the following:
937937
Modify the timestamp values as needed based on your oplog entry. This
938938
operation may take some period to complete because the update must
939939
scan and pull the entire oplog into memory.
940+
941+
Duplicate Key Error on local.slaves
942+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
943+
944+
The *duplicate key on local.slaves* error, shown below, occurs when a
945+
:term:`secondary` or :term:`slave` changes its hostname and the
946+
:term:`primary` or :term:`master` tries to update its ``local.slaves``
947+
collection with the new name. The update fails because it contains the
948+
same `_id` value as the document containing the previous hostname.
949+
950+
.. example::
951+
952+
.. code-block:: javascript
953+
954+
exception 11000 E11000 duplicate key error index: local.slaves.$_id_ dup key: { : ObjectId('<object ID>') } 0ms
955+
956+
This is a benign error and does not affect replication operations on
957+
the :term:`secondary` or :term:`slave`.
958+
959+
To stop the error from appearing, drop the ``local.slaves`` collection
960+
from the :term:`primary` or :term:`master`, as shown here:
961+
962+
.. code-block:: javascript
963+
964+
db.slaves.drop()
965+
966+
The next time a :term:`secondary` or :term:`slave` polls the
967+
:term:`primary` or :term:`master`, the :term:`primary` or :term:`master`
968+
recreates the ``local.slaves`` collection.

0 commit comments

Comments
 (0)