@@ -6,7 +6,7 @@ Start and Stop MongoDB
6
6
7
7
MongoDB runs as a standard program. You can start MongoDB from a command
8
8
line by issuing the :program:`mongod` command and specifying options.
9
- Fora list of options, see :doc:`/reference/mongod`. MongoDB can also run
9
+ For a list of options, see :doc:`/reference/mongod`. MongoDB can also run
10
10
as a Windows service. For details, see
11
11
:ref:`tutorial-mongod-as-windows-service`. To install MongoDB, see
12
12
:doc:`/installation`.
@@ -37,7 +37,9 @@ Specify a Data Directory
37
37
~~~~~~~~~~~~~~~~~~~~~~~~
38
38
39
39
When you specify a data directory, the directory must already exist. If
40
- it does not, create it and set its permissions appropriately.
40
+ it does not, create it and set its permissions appropriately for access
41
+ by :program:`mongod`. For more information on permissions, see the
42
+ :ref:`security operations documentation <security-operations>`.
41
43
42
44
To specify a data directory when starting MongoDB, use the
43
45
:option:`--dbpath <mongod --dbpath>` option. The following command
@@ -51,7 +53,7 @@ directory:
51
53
Specify a TCP Port
52
54
~~~~~~~~~~~~~~~~~~
53
55
54
- If you run several :program:`mongod` processes on a single machine, you
56
+ If you run multiple :program:`mongod` processes on a single machine, you
55
57
must assign each a different port to listen on for client connections.
56
58
Only one can listen on the default port of ``27017``.
57
59
@@ -64,10 +66,6 @@ starts :program:`mongod` listening on port ``12345``:
64
66
65
67
Use the default port number whenever possible, to avoid any confusion.
66
68
67
- If you use the :option:`--configsvr <mongod --configsvr>` or
68
- :option:`--shardsvr <mongod --shardsvr>` options, those options select an
69
- appropriate port number automatically.
70
-
71
69
Run ``mongod`` as a Daemon
72
70
~~~~~~~~~~~~~~~~~~~~~~~~~~
73
71
@@ -78,14 +76,11 @@ However, you need not create the log file. MongoDB will create the log
78
76
file if it does not exist.
79
77
80
78
The following command runs :program:`mongod` as a daemon and records log
81
- output to ``/var/log/mongodb.log``. The command also uses the
82
- :option:`--logappend <mongod --logappend>` option to ensure that
83
- :program:`mongod` appends new entries to the end of the log file rather
84
- than overwriting the content when the process restarts:
79
+ output to ``/var/log/mongodb.log``.
85
80
86
81
.. code-block:: sh
87
82
88
- mongod --fork --logpath /var/log/mongodb.log --logappend
83
+ mongod --fork --logpath /var/log/mongodb.log
89
84
90
85
Additional Configuration Options
91
86
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0 commit comments