Skip to content

Commit 3d3be21

Browse files
committed
DOCSP-3509: ubuntu community install -- split pkg and tar installation
1 parent 2c29faf commit 3d3be21

10 files changed

+338
-86
lines changed

config/sphinx_local.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ theme:
9797
- /tutorial/remove-documents
9898
- /tutorial/update-documents
9999
- /tutorial/enable-authentication
100+
- /tutorial/install-mongodb-on-ubuntu
101+
- /tutorial/install-mongodb-on-red-hat
102+
- /tutorial/install-mongodb-on-debian
103+
- /tutorial/install-mongodb-on-suse
104+
- /tutorial/install-mongodb-on-amazon
100105
sidebars:
101106
'**':
102107
- 'pagenav.html'

source/includes/list-mongodb-org-packages.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@ repository contains the following packages:
1818
* - ``{+package-name-org+}-server``
1919

2020
- Contains the :binary:`~bin.mongod` daemon, associated init
21-
script, and a :doc:`configuration file
22-
</reference/configuration-options>` (``/etc/mongod.conf``). You
21+
script, and a :ref:`configuration file
22+
<conf-file>` (``/etc/mongod.conf``). You
2323
can use the initialization script to start :binary:`~bin.mongod`
2424
with the configuration file. For details, see `Run MongoDB
2525
Community Edition`_.
2626

27-
.. include:: /includes/fact-installation-bind-ip-default-in-config.rst
28-
2927
* - ``{+package-name-org+}-mongos``
3028
- Contains the :binary:`~bin.mongos` daemon.
3129

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
title: Download the MongoDB ``.tgz`` tarball.
2+
stepnum: 1
3+
level: 4
4+
ref: download
5+
pre: |
6+
Download the tarball for your system from the `MongoDB Download Center
7+
<https://www.mongodb.com/download-center?jmp=docs#production>`_.
8+
---
9+
title: Extract the files from the downloaded archive.
10+
stepnum: 2
11+
level: 4
12+
ref: extract
13+
pre: |
14+
15+
Using an archive manager program or the ``tar`` command, extract the
16+
files.
17+
18+
For example, to extract from the terminal shell, you can use the
19+
following ``tar`` command:
20+
21+
.. tip::
22+
23+
If you downloaded a different MongoDB {+version+} point release,
24+
be sure to modify the command to reflect the correct ``.tgz``
25+
file name.
26+
27+
.. code-block:: sh
28+
29+
tar -zxvf mongodb-linux-*-{+release+}.tgz
30+
31+
---
32+
title: Optional. Ensure the binaries are in a directory listed in your ``PATH`` environment variable.
33+
stepnum: 3
34+
level: 4
35+
ref: ensure-binaries-in-path
36+
content: |
37+
38+
The MongoDB binaries are in the ``<mongodb-install-directory>/bin/``
39+
directory. To avoid having to specify the path to the MongoDB
40+
binaries, you can modify your user's ``PATH`` environment variable
41+
to include this directory. For example, you can add the following
42+
line to your shell's initialization script (e.g. {{bashrc}}):
43+
44+
.. code-block:: none
45+
46+
export PATH=<mongodb-install-directory>/bin:$PATH
47+
48+
Replace ``<mongodb-install-directory>`` with the path to the
49+
extracted MongoDB archive.
50+
51+
Alternatively, you can:
52+
53+
- Copy these binaries into a directory listed in your ``PATH``
54+
variable such as ``/usr/local/bin``, or
55+
56+
- Create symbolic links to each of these binaries from a directory
57+
listed in your ``PATH`` variable.
58+
59+
replacement:
60+
bashrc: "``~/.bashrc``"
61+
...

source/includes/steps-run-mongodb-on-debian.yaml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,8 @@ action:
2121
code: |
2222
[initandlisten] waiting for connections on port 27017
2323
post: |
24-
``<port>`` is the port the :binary:`~bin.mongod` listens on. If you
25-
modified the :setting:`net.port` setting in the ``/etc/mongod.conf``
26-
configuration file, the port may differ.
27-
28-
If you modified the :setting:`systemLog.path` configuration
29-
file option, look for the log file at the location you specified
30-
to that setting.
24+
``27017`` is the default port the standalone :binary:`~bin.mongod`
25+
listens on.
3126
3227
You may see non-critical warnings in the :binary:`~bin.mongod`
3328
output. As long as you see the log line shown above, you can safely

source/includes/steps-run-mongodb-on-linux.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,22 +83,22 @@ ref: begin-using-mongodb
8383
pre: |
8484
8585
Start a :binary:`~bin.mongo` shell on the same host machine as the
86-
:binary:`~bin.mongod`. Use the :option:`--host <mongo --host>` command line option
87-
to specify the localhost address (in this case ``127.0.0.1``) and port that the :binary:`~bin.mongod`
88-
listens on:
86+
:binary:`~bin.mongod`. You can run the :binary:`~bin.mongo` shell
87+
without any command-line options to connect to a
88+
:binary:`~bin.mongod` that is running on your localhost with default
89+
port 27017:
90+
8991
action:
9092
language: shell
9193
code: |
9294
93-
mongo --host 127.0.0.1:27017
95+
mongo
9496
post: |
9597
96-
If you started the :binary:`~bin.mongod` on a different port, specify
97-
that port instead of ``27017``.
98-
9998
For more information on connecting using the :binary:`~bin.mongo`
100-
shell, see :doc:`/mongo`.
101-
99+
shell, such as to connect to a :binary:`~bin.mongod` instance running
100+
on a different host and/or port, see :doc:`/mongo`.
101+
102102
To help you start using MongoDB, MongoDB provides :ref:`Getting
103103
Started Guides <getting-started>` in various driver editions. See
104104
:ref:`getting-started` for the available editions.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
title: Create the data and log directories.
2+
ref: create-dirs
3+
content: |
4+
5+
.. note::
6+
7+
Depending on user permissions, you may need to ``sudo mkdir -p
8+
<directory>`` instead of ``mkdir -p <directory>``. Use or omit
9+
``sudo`` as appropriate. See your linux man pages for information
10+
on ``mkdir`` and ``sudo``.
11+
12+
Create a directory where the MongoDB instance stores its data. For
13+
example:
14+
15+
.. code-block:: sh
16+
17+
sudo mkdir -p /data/db
18+
19+
Create a directory where the MongoDB instance stores its log. For example:
20+
21+
.. code-block:: sh
22+
23+
sudo mkdir -p /var/log/mongodb
24+
25+
The user that starts the MongoDB process must have read and write
26+
permission to the directories.
27+
---
28+
title: Run MongoDB.
29+
ref: start-mdb
30+
content: |
31+
To run MongoDB, run the :binary:`~bin.mongod` process at the system prompt.
32+
33+
.. code-block:: sh
34+
35+
sudo mongod --dbpath /data/db --logpath /var/log/mongodb/mongod.log --fork
36+
37+
For details on the command-line options :option:`--dbpath <mongod
38+
--dbpath>` and :option:`--logpath <mongod --logpath>`, see
39+
:ref:`mongod-options`.
40+
41+
---
42+
title: "Verify that MongoDB has started successfully."
43+
ref: verify
44+
pre: |
45+
Verify that MongoDB has started successfully by
46+
checking the process output for the following line in the
47+
log file ``/var/log/mongodb/mongod.log``:
48+
action:
49+
language: none
50+
copyable: false
51+
code: |
52+
[initandlisten] waiting for connections on port 27017
53+
post: |
54+
55+
You may see non-critical warnings in the process
56+
output. As long as you see the log line shown above, you can safely
57+
ignore these warnings during your initial evaluation of MongoDB.
58+
---
59+
title: Begin using MongoDB.
60+
ref: begin-using-mongodb
61+
pre: |
62+
63+
Start a :binary:`~bin.mongo` shell on the same host machine as the
64+
:binary:`~bin.mongod`. You can run the :binary:`~bin.mongo` shell
65+
without any command-line options to connect to a
66+
:binary:`~bin.mongod` that is running on your localhost with default
67+
port 27017:
68+
69+
action:
70+
language: shell
71+
code: |
72+
73+
mongo
74+
post: |
75+
76+
For more information on connecting using the :binary:`~bin.mongo`
77+
shell, such as to connect to a :binary:`~bin.mongod` instance running
78+
on a different host and/or port, see :doc:`/mongo`.
79+
80+
To help you start using MongoDB, MongoDB provides :ref:`Getting
81+
Started Guides <getting-started>` in various driver editions. See
82+
:ref:`getting-started` for the available editions.
83+
84+
replacement:
85+
mongod: ":binary:`~bin.mongod`"
86+
mongo: ":binary:`~bin.mongo`"
87+
...

source/reference/configuration-options.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ The following page describes the configuration options available in
1616
MongoDB |version|. For configuration file options for other versions of
1717
MongoDB, see the appropriate version of the MongoDB Manual.
1818

19+
.. _conf-file:
20+
1921
Configuration File
2022
------------------
2123

source/reference/program/mongod.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ your database.
3333

3434
.. |binary| replace:: MongoDB
3535

36+
.. _mongod-options:
37+
3638
Options
3739
-------
3840

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
====================================
2+
Install using .tgz Tarball on Ubuntu
3+
====================================
4+
5+
.. default-domain:: mongodb
6+
7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 1
11+
:class: singlecol
12+
13+
Overview
14+
--------
15+
16+
Although the recommended procedure to install is through the
17+
:ref:`package manager <install-community-ubuntu-pkg>`, you can also
18+
install by directly downloading the ``.tgz`` file. The following
19+
tutorial downloads the ``.tgz`` tarball directly to install MongoDB
20+
{+version+} Community Edition on LTS Ubuntu Linux systems.
21+
22+
MongoDB Version
23+
~~~~~~~~~~~~~~~
24+
25+
This tutorial installs MongoDB {+version+} Community Edition on LTS
26+
Ubuntu Linux systems. For other versions of MongoDB, refer to the
27+
corresponding version of the manual.
28+
29+
30+
.. |package-name| replace:: ``{+package-name-org+}``
31+
.. |distro-name| replace:: Ubuntu
32+
33+
Platform Support
34+
~~~~~~~~~~~~~~~~
35+
36+
.. include:: /includes/fact-ubuntu-lts-support.rst
37+
38+
39+
Production Notes
40+
~~~~~~~~~~~~~~~~~
41+
42+
Before deploying MongoDB in a production environment, consider the
43+
:doc:`/administration/production-notes` document.
44+
45+
Prerequisites
46+
-------------
47+
48+
Click on the tab for your version of Ubuntu
49+
50+
.. container::
51+
52+
.. include:: /includes/fact-tarball-dependencies.rst
53+
54+
55+
.. tabs::
56+
57+
tabs:
58+
- id: trusty
59+
name: Ubuntu 14.04 (Trusty)
60+
content: |
61+
62+
Install the dependencies for Ubuntu 14.04 (Trusty):
63+
64+
.. code-block:: sh
65+
66+
sudo apt-get install libcurl3 openssl
67+
68+
- id: xenial
69+
name: Ubuntu 16.04 (Xenial)
70+
content: |
71+
72+
.. include:: /includes/admonition-power-ubuntu-restriction.rst
73+
74+
Install the dependencies for Ubuntu 16.04 (Xenial):
75+
76+
.. code-block:: sh
77+
78+
sudo apt-get install libcurl3 openssl
79+
80+
- id: bionic
81+
name: Ubuntu 18.04 (Bionic)
82+
content: |
83+
84+
Install the dependencies for Ubuntu 18.04 (Bionic):
85+
86+
.. code-block:: sh
87+
88+
sudo apt-get install libcurl4 openssl
89+
90+
Install using the ``.tgz`` Tarball
91+
----------------------------------
92+
93+
.. container::
94+
95+
.. include:: /includes/steps/install-mongodb-on-ubuntu-tarball.rst
96+
97+
Run MongoDB Community Edition
98+
-----------------------------
99+
100+
Production Notes
101+
Before deploying MongoDB in a production environment, consider the
102+
:doc:`/administration/production-notes` document.
103+
104+
ulimit Considerations
105+
.. include:: /includes/fact-installation-ulimit.rst
106+
107+
.. |mongod-user| replace:: ``mongodb``
108+
.. |mongod-datadir| replace:: ``/var/lib/mongodb``
109+
110+
Configuration
111+
You can configure the MongoDB instance (such as the
112+
data directory and log directory specifications) using
113+
either the command-line options or a :ref:`configuration file
114+
<conf-file>`.
115+
116+
.. note::
117+
118+
Although the following procedure uses ``sudo`` to start the MongoDB
119+
instance as well as to create the directories used by the MongoDB
120+
instance, you may choose to perform the procedure as a different
121+
user.
122+
123+
.. include:: /includes/steps/run-mongodb-on-ubuntu-tarball.rst

0 commit comments

Comments
 (0)