@@ -89,80 +89,83 @@ your system.
89
89
``systemd`` stores configuration in unit files. Update the unit file to
90
90
set the ``KRB5_KTNAME`` variable.
91
91
92
- .. procedure::
93
- :style: normal
92
+ #. Find the unit file
94
93
95
- .. step:: Find the unit file
94
+ To display the unit file, run ``systemctl``:
96
95
97
- .. code-block:: shell
96
+ .. code-block:: shell
98
97
99
- sudo systemctl cat mongod
98
+ sudo systemctl cat mongod
100
99
101
- The ``systemctl`` command returns the file location and displays its
102
- contents.
100
+ The ``systemctl`` command returns the file location and displays its
101
+ contents.
103
102
104
- .. step:: Set ``KRB5_KTNAME``
103
+ #. Set ``KRB5_KTNAME``
105
104
106
- To set the ``KRB5_KTNAME`` variable, edit the following line to reflect
107
- the location of your ``keytab`` file:
105
+ To set the ``KRB5_KTNAME`` variable, edit the following line to reflect
106
+ the location of your ``keytab`` file:
108
107
109
- .. code-block:: shell
108
+ .. code-block:: shell
110
109
111
- Environment="KRB5_KTNAME=<path-to-your-mongod.keytab-file>"
110
+ Environment="KRB5_KTNAME=<path-to-your-mongod.keytab-file>"
112
111
113
- .. step:: Edit the unit file
112
+ #. Edit the unit file
114
113
115
- Add the edited line to the unit file. The edited unit file will
116
- resemble:
114
+ Add the edited line to the unit file. The edited unit file will
115
+ resemble:
117
116
118
- .. code-block:: shell
119
- :copyable: false
120
- :emphasize-lines: 9
117
+ .. code-block:: shell
118
+ :copyable: false
119
+ :emphasize-lines: 9
121
120
122
- [Unit]
123
- Description=High-performance, schema-free document-oriented database
124
- After=network.target
125
- Documentation=https://docs.mongodb.org/manual
126
-
127
- [Service]
128
- User=mongodb
129
- Group=mongodb
130
- ExecStart=/usr/bin/mongod --config /etc/mongod.conf
131
- Environment="KRB5_KTNAME=/etc/mongod.keytab"
132
- PIDFile=/var/run/mongodb/mongod.pid
133
- # file size
134
- LimitFSIZE=infinity
135
- # cpu time
136
- LimitCPU=infinity
137
- # virtual memory size
138
- LimitAS=infinity
139
- # open files
140
- LimitNOFILE=64000
141
- # processes/threads
142
- LimitNPROC=64000
143
- # locked memory
144
- LimitMEMLOCK=infinity
145
- # total threads (user+kernel)
146
- TasksMax=infinity
147
- TasksAccounting=false
148
-
149
- # Recommended limits for for mongod as specified in
150
- # http://docs.mongodb.org/manual/reference/ulimit/#recommended-settings
151
-
152
- [Install]
153
- WantedBy=multi-user.target
121
+ [Unit]
122
+ Description=High-performance, schema-free document-oriented database
123
+ After=network.target
124
+ Documentation=https://docs.mongodb.org/manual
125
+
126
+ [Service]
127
+ User=mongodb
128
+ Group=mongodb
129
+ ExecStart=/usr/bin/mongod --config /etc/mongod.conf
130
+ Environment="KRB5_KTNAME=/etc/mongod.keytab"
131
+ PIDFile=/var/run/mongodb/mongod.pid
132
+ # file size
133
+ LimitFSIZE=infinity
134
+ # cpu time
135
+ LimitCPU=infinity
136
+ # virtual memory size
137
+ LimitAS=infinity
138
+ # open files
139
+ LimitNOFILE=64000
140
+ # processes/threads
141
+ LimitNPROC=64000
142
+ # locked memory
143
+ LimitMEMLOCK=infinity
144
+ # total threads (user+kernel)
145
+ TasksMax=infinity
146
+ TasksAccounting=false
147
+
148
+ # Recommended limits for for mongod as specified in
149
+ # http://docs.mongodb.org/manual/reference/ulimit/#recommended-settings
150
+
151
+ [Install]
152
+ WantedBy=multi-user.target
154
153
155
- .. step:: Reload the updated unit file:
154
+ #. Reload the updated unit file
156
155
157
- .. code-block:: shell
156
+ To reload the unit file, use the ``systemctl`` command:
158
157
159
- sudo systemctl daemon-reload
158
+ .. code-block:: shell
160
159
161
- .. step:: Restart the :binary:`mongod` service
160
+ sudo systemctl daemon-reload
162
161
163
- .. code-block:: shell
162
+ #. Restart the :binary:`mongod` service
164
163
165
- sudo systemctl restart mongod
164
+ To restart ``mongod``, use the ``systemctl`` command:
165
+
166
+ .. code-block:: shell
167
+
168
+ sudo systemctl restart mongod
166
169
167
170
``init`` Configuration Files
168
171
````````````````````````````
0 commit comments