Skip to content

DOCS-970 remove localhost from deploy rs doc #572

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 24, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 21 additions & 32 deletions source/tutorial/deploy-replica-set.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------

Expand All @@ -29,31 +25,31 @@ 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
<replica-set-elections>` always design replica sets with odd numbers
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 <tutorials-installation>`.

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``.

Expand Down Expand Up @@ -93,19 +89,12 @@ The examples in this procedure create a new replica set named ``rs0``.
:option:`--replSet <mongod --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:
Expand All @@ -120,21 +109,21 @@ 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.

#. 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:

Expand Down