diff --git a/source/tutorial/deploy-replica-set.txt b/source/tutorial/deploy-replica-set.txt index 21accc241bb..c6afb253905 100644 --- a/source/tutorial/deploy-replica-set.txt +++ b/source/tutorial/deploy-replica-set.txt @@ -4,18 +4,14 @@ Deploy a Replica Set .. default-domain:: mongodb -This tutorial describes how to create a three member -:term:`replica set` from three existing instances of MongoDB. -The tutorial provides one procedure for development and test systems and -a separate procedure for production systems. +This tutorial describes how to create a three-member +:term:`replica set` from three existing :program:`mongod` instances. +The tutorial provides two procedures: one for development and test systems; and +a one for production systems. -To deploy a replica set from a single standalone MongoDB instance, see +To instead deploy a replica set from a single standalone MongoDB instance, see :doc:`/tutorial/convert-standalone-to-replica-set`. -For background information on replica set deployments, see -:doc:`/core/replication` and -:doc:`/administration/replication-architectures`. - Overview -------- @@ -29,14 +25,14 @@ Requirements Most replica sets consist of two or more :program:`mongod` instances. [#odd-numbered-set-sizes]_ This tutorial -describes a three member set. Production environments should have at +describes a three member set. Production environments should have at least three distinct systems so that each system can run its own instance of :program:`mongod`. For development systems you can run all three instances -of the :program:`mongod` process on a local system. (e.g. a laptop) or within a virtual -instance. For production environments, you should endeavor to maintain as much separation -between the members as possible. For example, when using virtual +of the :program:`mongod` process on a local system or within a virtual +instance. For production environments, you should maintain as much separation +between members as possible. For example, when using virtual machines for production deployments, each member -should live on separate host servers, served by redundant power circuits, and with +should live on a separate host server, served by redundant power circuits and with redundant network paths. .. [#odd-numbered-set-sizes] To ensure smooth :ref:`elections @@ -44,16 +40,16 @@ redundant network paths. of members. Use :ref:`replica-set-arbiters` to ensure the set has odd number of voting members and avoid tied elections. -Procedure ---------- +Procedures +---------- These procedures assume you already have instances of MongoDB installed on the systems you will add as members of your :term:`replica set`. If you have not already installed MongoDB, see the :ref:`installation tutorials `. -Deploy a Development or Testing Replica Set -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Deploy a Development or Test Replica Set +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The examples in this procedure create a new replica set named ``rs0``. @@ -93,19 +89,12 @@ The examples in this procedure create a new replica set named ``rs0``. :option:`--replSet `. #. Open a :program:`mongo` shell and connect to the first - :program:`mongod` instance. If you're running this command remotely, - replace "localhost" with the appropriate hostname. In a new shell + :program:`mongod` instance. In a new shell session, enter the following: .. code-block:: sh - mongo localhost:27017 - - .. note:: - - In a replica set, *all* members of the set must use - ``localhost`` addresses or *no* members of the replica set can - use the ``localhost`` addresses. + mongo --port 27017 #. Use :method:`rs.initiate()` to initiate a replica set consisting of the current member and using the default configuration: @@ -120,13 +109,14 @@ The examples in this procedure create a new replica set named ``rs0``. rs.conf() -#. Add two members to the replica set by issuing a sequence of commands - similar to the following. +#. Add the second and third :program:`mongod` instances to the replica + set using the :method:`rs.add()` method. For example, if your machine + name is ``mongodb.example.net``, you would issue the following. .. code-block:: javascript - rs.add("localhost:27018") - rs.add("localhost:27019") + rs.add("mongodb.example.net:27018") + rs.add("mongodb.example.net:27019") After these commands return you have a fully functional replica set. New replica sets elect a :term:`primary` within a seconds. @@ -134,7 +124,6 @@ The examples in this procedure create a new replica set named ``rs0``. #. Check the status of your replica set at any time with the :method:`rs.status()` operation. - .. seealso:: The documentation of the following shell functions for more information: