Skip to content

Commit 5038c71

Browse files
author
Sam Kleinman
committed
DOCS-135 editing installation and tutorials with siddharth's comments.
1 parent 38b8843 commit 5038c71

6 files changed

+112
-76
lines changed

source/tutorial/deploy-geographically-distributed-replica-set.rst

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,11 @@ following notes:
5555

5656
Procedure
5757
---------
58-
// TODO : Can you please rewrite this sentence. Its clear what you are trying to say
59-
but when read as a whole line, i feel as if it doesn't flow as a sentence.
6058

61-
Although its possible to deploy multiple members on a single system,
62-
it reduces the redundancy and capacity of the system, these kinds of
63-
deployments are typically for testing purposes and beyond the scope of
64-
this tutorial.
59+
Although you may to deploy more than one replica set member on a
60+
single system, this configuration reduces the redundancy and capacity
61+
of the replica set. Such deployments are typically for testing
62+
purposes and beyond the scope of this tutorial.
6563

6664
Three Member Replica Set
6765
~~~~~~~~~~~~~~~~~~~~~~~~

source/tutorial/expand-replica-set.rst

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ tutorials which address these processes:
3737
Procedure
3838
---------
3939

40-
On the new system, ensure that a configuration file that resembles the
41-
following is located on the file system at ``/etc/mongodb.conf``.
40+
On the new system, create a configuration file that resembles the
41+
following on your system at ``/etc/mongodb.conf``.
4242

4343
.. code-block:: cfg
4444
@@ -48,13 +48,11 @@ following is located on the file system at ``/etc/mongodb.conf``.
4848
4949
dbpath = /srv/mongodb/
5050
51-
fork = true
51+
logpath = /var/log/mongodb.log
5252
53-
replSet = rs0/mongodb0.example.net,mongodb1.example.net,mongodb2.example.net,mongodb3.example.net
53+
fork = true
5454
55-
//TODO : On using fork=true, I received an error saying that "--fork has to be used with --logpath"
56-
Please verify
57-
55+
replSet = rs0
5856
5957
Modify the :setting:`bind_ip` to reflect a secure interface on
6058
your system that will be able to access all other members of the set
@@ -65,29 +63,26 @@ private network (i.e. "VPN") to permit this access.
6563

6664
// TODO : Please also add a line about the port variable
6765

66+
See the documentation of the configuration options used above:
67+
:setting:`dbpath`, :setting:`port`, :setting:`replSet`,
68+
:setting:`bind_ip`, and :setting:`fork`. Also consider any additional
69+
:doc:`configuration options </reference/configuration-options>` that
70+
your deployment may require.
6871

6972
.. note::
7073

71-
The portion of the :setting:`replSet` following the ``/``
72-
provides a "seed list" of hosts that are known to be members of the
73-
same replica set, which is used for fetching changed configurations
74-
following restarts. It is acceptable to omit this section entirely,
75-
and have the :setting:`replSet` option resemble:
74+
The default MongoDB port is ``27017``, and the remainder of the
75+
tutorial assumes that all MongoDB instances are running on the
76+
default port. If your MongoDB instances run on a different port,
77+
you will need to change the :setting:`port` above, and append a
78+
colon (``:``) and the port number to all host name references
79+
below.
7680

77-
.. code-block:: cfg
81+
Start the :program:`mongod` process with the following command:
7882

79-
replSet = rs0
83+
.. code-block:: sh
8084
81-
See the documentation of the configuration options used above:
82-
:setting:`dbpath`, :setting:`port`,
83-
:setting:`replSet`, :setting:`bind_ip`, and
84-
:setting:`fork`. Also consider any additional
85-
:doc:`configuration options </reference/configuration-options>` that
86-
your deployment may require.
87-
88-
Start the :program:`mongod` process with the following command: ::
89-
90-
mongod --config /etc/mongodb.conf
85+
mongod --config /etc/mongodb.conf
9186
9287
.. note::
9388

@@ -96,9 +91,11 @@ Start the :program:`mongod` process with the following command: ::
9691
command. Control scripts are beyond the scope of this document.
9792

9893
Log into one of the existing members of the current replica set by
99-
issuing the following command: ::
94+
issuing the following command:
95+
96+
.. code-block:: sh
10097
101-
mongo mongodb0.example.net
98+
mongo mongodb0.example.net
10299
103100
If this instance is not currently the :term:`primary` node, use the
104101
:func:`db.isMaster()` function to determine which node is in the

source/tutorial/install-mongodb-on-debian-or-ubuntu-linux.rst

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ The Debian/Ubuntu package management tool (i.e. ``dpkg`` and ``apt``)
6363
ensure package consistency and authenticity by requring that
6464
distributors sign packages with GPG keys. Issue the following command
6565
to import the `10gen public GPG Key </_static/10gen-gpg-key.asc>`_ as
66-
the root user:
66+
the root user (or with ``sudo``:)
6767

6868
.. code-block:: sh
6969
@@ -73,7 +73,7 @@ Alternatively, you may use ``sudo`` to get root privileges:
7373

7474
.. code-block:: sh
7575
76-
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
76+
apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
7777
7878
Edit the ``/etc/apt/sources.list`` file to include the 10gen
7979
repository.
@@ -138,21 +138,18 @@ Controlling MongoDB
138138
Starting MongoDB
139139
~~~~~~~~~~~~~~~~
140140

141-
// TODO : Please add that the following commands should be run with root (sudo) privileges.
142-
143-
144-
Upstart users can start the :program:`mongod` process by issuing the following
145-
command:
141+
Upstart users can start the :program:`mongod` process by issuing the
142+
following command:
146143

147144
.. code-block:: sh
148145
149-
service mongodb start
146+
sudo service mongodb start
150147
151148
All other users can issue the following command to start :program:`mongod`:
152149

153150
.. code-block:: sh
154151
155-
/etc/init.d/mongodb start
152+
sudo /etc/init.d/mongodb start
156153
157154
You can verify that :program:`mongod` has started successfully by checking the
158155
contents of the log file at ``/var/log/mongodb/mongodb.log``.
@@ -165,13 +162,13 @@ command:
165162

166163
.. code-block:: sh
167164
168-
service mongodb stop
165+
sudo service mongodb stop
169166
170167
All other users can issue the following command to stop :program:`mongod`:
171168

172169
.. code-block:: sh
173170
174-
/etc/init.d/mongodb stop
171+
sudo /etc/init.d/mongodb stop
175172
176173
Restarting MongoDB
177174
~~~~~~~~~~~~~~~~~~
@@ -181,14 +178,14 @@ following command:
181178

182179
.. code-block:: sh
183180
184-
service mongodb restart
181+
sudo service mongodb restart
185182
186183
All other users can issue the following command to restart
187184
:program:`mongod`:
188185

189186
.. code-block:: sh
190187
191-
/etc/init.d/mongodb restart
188+
sudo /etc/init.d/mongodb restart
192189
193190
Controlling :program:`mongos`
194191
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

source/tutorial/install-mongodb-on-linux.rst

Lines changed: 44 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,20 @@ most cases you will want to download the 64-bit version of MongoDB.
4141

4242
.. code-block:: sh
4343
44-
curl http://downloads.mongodb.org/linux/mongodb-linux-x86_64-latest.tgz > mongo.tgz
44+
curl http://downloads.mongodb.org/linux/mongodb-linux-x86_64-x.y.z.tgz > mongo.tgz
4545
4646
If you need to run the 32-bit version, use the following command.
4747

4848
.. code-block:: sh
4949
50-
curl http://downloads.mongodb.org/linux/mongodb-linux-i686-latest.tgz > mongo.tgz
50+
curl http://downloads.mongodb.org/linux/mongodb-linux-i686-x.y.z.tgz > mongo.tgz
51+
52+
.. note::
53+
54+
Replace x.y.z with the current stable version (i.e. |version|).
55+
56+
You may also choose to install a development release, in which case
57+
you will need to specify that version number above.
5158

5259
Once you've downloaded the release, issue the following command to
5360
extract the files from the archive:
@@ -58,16 +65,12 @@ extract the files from the archive:
5865
5966
.. optional::
6067

61-
You may use the following command to move the extracted folder into
68+
You may use the following command to copy the extracted folder into
6269
a more generic location.
6370

64-
//TODO: this is an installation guide for linux hence the package that will be downloaded
65-
will probably have name like mongodb-linux-x86_64?-20??-??-??
66-
and not mongdo-osx-20??-??-?? that you have mentioned below.
67-
6871
.. code-block:: sh
6972
70-
mv -n mongodb-osx-20??-??-??/ mongodb
73+
cp -R -n mongodb-osx-20??-??-??/ mongodb
7174
7275
You can find the :program:`mongod` binary, and the binaries all of the
7376
associated MongoDB utilities, in the "``bin/``" directory within the
@@ -85,36 +88,59 @@ following command:
8588
8689
mkdir -p /data/db
8790
88-
// TODO: you might want to mention that the users should also give write permissions
89-
to the directory /data/db or wherever they want the dbpath to point to.
91+
.. note::
92+
93+
Ensure that the system account that will run the :program:`mongod`
94+
process has read and write permissions to this directory. If
95+
:program:`mongod` runs under the ``mongo`` user account, issue the
96+
following command to change the owner of this folder:
97+
98+
.. code-block:: sh
99+
100+
chown mongo /data/db
101+
102+
If you use an alternate location for your data directory, ensure
103+
that this user can write to your chosen data path.
90104

91105
You can specify, and create, an alternate path using the
92106
:option:`--dbpath <mongod>` option to :program:`mongod` and the above
93107
command.
94108

95-
// TODO : the part to start mongod is completely missing. I think we should add a few lines
96-
on how to start the mongod process. The previous step tells how to create a directory,
97-
the next step tells how to use the mongo shell. We should definitely have a line on how to start
98-
the mongod process.
99-
100109
The 10gen builds of MongoDB contain no :term:`control scripts <control
101110
script>` or method to control the :program:`mongod` process. You may
102111
wish to create control scripts, modify your path, and/or create
103112
symbolic links to the MongoDB programs in your ``/usr/local/bin`` or
104113
"``/usr/bin``" directory for easier use.
105114

115+
For testing purposes, you can start a :program:`mongod` directly in
116+
the terminal without creating a control script:
117+
118+
.. code-block:: sh
119+
120+
mongod --config /etc/mongod.conf
121+
122+
.. note::
123+
124+
The above command assumes that the :program:`mongod` binary is
125+
accessible via your system's search path, and that you have created
126+
a default configuration file located at ``/etc/mongod.conf``.
127+
106128
Among the tools included with this MongoDB distribution, is the
107129
:program:`mongo` shell. You can use this shell to connect to your
108130
MongoDB instance by issuing the following command at the system
109131
prompt:
110-
111-
TODO : You might want to add that the following command is to be issued
112-
from the directory in which mongodb was extracted to. './bin' is not very descritpive.
113132

114133
.. code-block:: sh
115134
116135
./bin/mongo
117136
137+
.. note::
138+
139+
The ``./bin/mongo`` command assumes that the :program:`mongo`
140+
binary is in the "``bin/``" sub-directory of the current
141+
directory. This is the directory into which you extracted the
142+
"``.tgz``" file.
143+
118144
This will connect to the database running on the localhost interface
119145
by default. At the :program:`mongo` prompt, issue the following two
120146
commands to insert a record in the "test" :term:`collection` of the

source/tutorial/install-mongodb-on-os-x.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,19 @@ wish to create control scripts, modify your path, and/or create
173173
symbolic links to the MongoDB programs in your ``/usr/local/bin``
174174
directory for easier use.
175175

176+
For testing purposes, you can start a :program:`mongod` directly in
177+
the terminal without creating a control script:
178+
179+
.. code-block:: sh
180+
181+
mongod --config /etc/mongod.conf
182+
183+
.. note::
184+
185+
This command assumes that the :program:`mongod` binary is
186+
accessible via your system's search path, and that you have created
187+
a default configuration file located at ``/etc/mongod.conf``.
188+
176189
Among the tools included with this MongoDB distribution, is the
177190
:program:`mongo` shell. You can use this shell to connect to your
178191
MongoDB instance by issuing the following command at the system
@@ -182,6 +195,14 @@ prompt:
182195
183196
./bin/mongo
184197
198+
199+
.. note::
200+
201+
The ``./bin/mongo`` command assumes that the :program:`mongo`
202+
binary is in the "``bin/``" sub-directory of the current
203+
directory. This is the directory into which you extracted the
204+
"``.tgz``" file.
205+
185206
This will connect to the database running on the localhost interface
186207
by default. At the :program:`mongo` prompt, issue the following two
187208
commands to insert a record in the "test" :term:`collection` of the

0 commit comments

Comments
 (0)