-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
configuration-options.txt
2597 lines (1547 loc) · 71.5 KB
/
configuration-options.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
==========================
Configuration File Options
==========================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
The following page describes the configuration options available in
MongoDB |version|. For configuration file options for other versions of
MongoDB, see the appropriate version of the MongoDB Manual.
Configuration File
------------------
You can configure :binary:`~bin.mongod` and :binary:`~bin.mongos` instances at
startup using a configuration file. The configuration file contains
settings that are equivalent to the :binary:`~bin.mongod` and
:binary:`~bin.mongos` command-line options.
Using a configuration file makes managing :binary:`~bin.mongod` and
:binary:`~bin.mongos` options easier, especially for large-scale
deployments. You can also add comments to the configuration file to
explain the server's settings.
- On Linux, a default :file:`/etc/mongod.conf` configuration file is
included when using a package manager to install MongoDB.
- On macOS, a default :file:`/usr/local/etc/mongod.conf` configuration
file is included when installing from MongoDB's official Homebrew tap.
File Format
~~~~~~~~~~~
.. important::
.. versionchanged:: 2.6
MongoDB 2.6 introduces a YAML-based configuration file format.
The :v2.4:`2.4 configuration file format
</reference/configuration-options>` remains for backward
compatibility.
MongoDB configuration files use the `YAML <http://www.yaml.org>`_ format
[#yaml-json]_.
The following sample configuration file contains several :binary:`~bin.mongod`
settings that you may adapt to your local configuration:
.. note::
YAML does not support tab characters for indentation: use spaces instead.
.. code-block:: yaml
systemLog:
destination: file
path: "/var/log/mongodb/mongod.log"
logAppend: true
storage:
journal:
enabled: true
processManagement:
fork: true
net:
bindIp: 127.0.0.1
port: 27017
setParameter:
enableLocalhostAuthBypass: false
...
The Linux package init scripts included in the official MongoDB packages depend
on specific values for :setting:`systemLog.path`, :setting:`storage.dbpath`, and
:setting:`processManagement.fork`. If you modify these settings in the default
configuration file, :binary:`~bin.mongod` may not start.
.. [#yaml-json] YAML is a superset of :term:`JSON`.
Use the Configuration File
~~~~~~~~~~~~~~~~~~~~~~~~~~
To start :binary:`~bin.mongod` or :binary:`~bin.mongos` using a config file,
specify the config file with the ``--config`` option or the
``-f`` option, as in the following examples:
The following examples use :option:`mongod --config` and
:binary:`mongos --config` to specify the configuration file:
.. code-block:: sh
mongod --config /etc/mongod.conf
mongos --config /etc/mongos.conf
You can also use the ``-f`` alias to specify the configuration
file, as in the following:
.. code-block:: sh
mongod -f /etc/mongod.conf
mongos -f /etc/mongos.conf
If you installed from a package and have started MongoDB using your
system's :term:`init script`, you are already using a configuration
file.
Core Options
------------
``systemLog`` Options
~~~~~~~~~~~~~~~~~~~~~
.. code-block:: yaml
systemLog:
verbosity: <int>
quiet: <boolean>
traceAllExceptions: <boolean>
syslogFacility: <string>
path: <string>
logAppend: <boolean>
logRotate: <string>
destination: <string>
timeStampFormat: <string>
component:
accessControl:
verbosity: <int>
command:
verbosity: <int>
# COMMENT additional component verbosity settings omitted for brevity
.. setting:: systemLog.verbosity
*Type*: integer
*Default*: 0
.. versionchanged:: 3.0
The default :doc:`log message </reference/log-messages>`
verbosity level for :ref:`components <log-message-components>`. The
verbosity level determines the amount of :ref:`Informational and
Debug <log-severity-levels>` messages MongoDB outputs.
.. include:: /includes/log-verbosity-levels.rst
To use a different verbosity level for a named component, use the
component's verbosity setting. For example, use the
:setting:`systemLog.component.accessControl.verbosity` to set the
verbosity level specifically for :data:`ACCESS` components.
See the ``systemLog.component.<name>.verbosity`` settings for
specific component verbosity settings.
For various ways to set the log verbosity level, see
:ref:`log-messages-configure-verbosity`.
.. setting:: systemLog.quiet
*Type*: boolean
Run the :binary:`~bin.mongos` or :binary:`~bin.mongod` in a quiet mode that attempts to limit the amount
of output.
:setting:`systemLog.quiet` is **not** recommended for production systems as it may make
tracking problems during particular connections much more difficult.
.. setting:: systemLog.traceAllExceptions
*Type*: boolean
Print verbose information for debugging. Use for additional logging for
support-related troubleshooting.
.. setting:: systemLog.syslogFacility
*Type*: string
*Default*: user
The facility level used when logging messages to syslog.
The value you specify must be supported by your
operating system's implementation of syslog. To use this option, you
must set :setting:`systemLog.destination` to ``syslog``..
.. setting:: systemLog.path
*Type*: string
The path of the log file to which :binary:`~bin.mongod` or :binary:`~bin.mongos` should send all diagnostic
logging information, rather than the standard output or the host's
:term:`syslog`. MongoDB creates the log file at the specified path.
.. include:: /includes/extracts/linux-config-expectations-systemlog-path.rst
.. setting:: systemLog.logAppend
*Type*: boolean
*Default*: false
When ``true``, :binary:`~bin.mongos` or :binary:`~bin.mongod` appends new entries to the end of the existing log file when the :binary:`~bin.mongos` or :binary:`~bin.mongod`
instance restarts. Without this option, :binary:`~bin.mongod` will back up the
existing log and create a new file.
.. setting:: systemLog.logRotate
*Type*: string
*Default*: rename
.. versionadded:: 3.0.0
The behavior for the :dbcommand:`logRotate` command.
Specify either ``rename`` or ``reopen``:
- ``rename`` renames the log file.
- ``reopen`` closes and reopens the log file following the typical
Linux/Unix log rotate behavior. Use ``reopen`` when using the
Linux/Unix logrotate utility to avoid log loss.
If you specify ``reopen``, you must also set :setting:`systemLog.logAppend` to ``true``.
.. setting:: systemLog.destination
*Type*: string
The destination to which MongoDB sends all log output. Specify either
``file`` or ``syslog``. If you specify ``file``, you must also specify
:setting:`systemLog.path`.
If you do not specify :setting:`systemLog.destination`, MongoDB sends
all log output to standard output.
.. setting:: systemLog.timeStampFormat
*Type*: string
*Default*: iso8601-local
The time format for timestamps in log messages. Specify one of the
following values:
.. list-table::
:header-rows: 1
:widths: 20 40
* - Value
- Description
* - ``ctime``
- Displays timestamps as ``Wed Dec 31
18:17:54.811``.
* - ``iso8601-utc``
- Displays timestamps in Coordinated Universal Time (UTC) in the
ISO-8601 format. For example, for New York at the start of the
Epoch: ``1970-01-01T00:00:00.000Z``
* - ``iso8601-local``
- Displays timestamps in local time in the ISO-8601
format. For example, for New York at the start of the Epoch:
``1969-12-31T19:00:00.000-0500``
``systemLog.component`` Options
```````````````````````````````
.. code-block:: yaml
systemLog:
component:
accessControl:
verbosity: <int>
command:
verbosity: <int>
# COMMENT some component verbosity settings omitted for brevity
storage:
verbosity: <int>
journal:
verbosity: <int>
write:
verbosity: <int>
.. setting:: systemLog.component.accessControl.verbosity
*Type*: integer
*Default*: 0
.. versionadded:: 3.0
The log message verbosity level for components related to
access control. See :data:`ACCESS` components.
.. include:: /includes/log-verbosity-levels.rst
.. setting:: systemLog.component.command.verbosity
*Type*: integer
*Default*: 0
.. versionadded:: 3.0
The log message verbosity level for components related to
commands. See :data:`COMMAND` components.
.. include:: /includes/log-verbosity-levels.rst
.. setting:: systemLog.component.control.verbosity
*Type*: integer
*Default*: 0
.. versionadded:: 3.0
The log message verbosity level for components related to
control operations. See :data:`CONTROL` components.
.. include:: /includes/log-verbosity-levels.rst
.. setting:: systemLog.component.ftdc.verbosity
*Type*: integer
*Default*: 0
.. versionadded:: 3.2
The log message verbosity level for components related to
diagnostic data collection operations. See :data:`FTDC` components.
.. include:: /includes/log-verbosity-levels.rst
.. setting:: systemLog.component.geo.verbosity
*Type*: integer
*Default*: 0
.. versionadded:: 3.0
The log message verbosity level for components related to
geospatial parsing operations. See :data:`GEO` components.
.. include:: /includes/log-verbosity-levels.rst
.. setting:: systemLog.component.index.verbosity
*Type*: integer
*Default*: 0
.. versionadded:: 3.0
The log message verbosity level for components related to
indexing operations. See :data:`INDEX` components.
.. include:: /includes/log-verbosity-levels.rst
.. setting:: systemLog.component.network.verbosity
*Type*: integer
*Default*: 0
.. versionadded:: 3.0
The log message verbosity level for components related to
networking operations. See :data:`NETWORK` components.
.. include:: /includes/log-verbosity-levels.rst
.. setting:: systemLog.component.query.verbosity
*Type*: integer
*Default*: 0
.. versionadded:: 3.0
The log message verbosity level for components related to
query operations. See :data:`QUERY` components.
.. include:: /includes/log-verbosity-levels.rst
.. setting:: systemLog.component.replication.verbosity
*Type*: integer
*Default*: 0
.. versionadded:: 3.0
The log message verbosity level for components related to
replication. See :data:`REPL` components.
.. include:: /includes/log-verbosity-levels.rst
.. setting:: systemLog.component.sharding.verbosity
*Type*: integer
*Default*: 0
.. versionadded:: 3.0
The log message verbosity level for components related to
sharding. See :data:`SHARDING` components.
.. include:: /includes/log-verbosity-levels.rst
.. setting:: systemLog.component.storage.verbosity
*Type*: integer
*Default*: 0
.. versionadded:: 3.0
The log message verbosity level for components related to
storage. See :data:`STORAGE` components.
If :setting:`systemLog.component.storage.journal.verbosity` is unset,
:setting:`systemLog.component.storage.verbosity` level also applies to
journaling components.
.. include:: /includes/log-verbosity-levels.rst
.. setting:: systemLog.component.storage.journal.verbosity
*Type*: integer
*Default*: 0
.. versionadded:: 3.0
The log message verbosity level for components related to
journaling. See :data:`JOURNAL` components.
If :setting:`systemLog.component.storage.journal.verbosity` is
unset, the journaling components have the same verbosity level as the
parent storage components: i.e. either the
:setting:`systemLog.component.storage.verbosity` level if
set or the default verbosity level.
.. include:: /includes/log-verbosity-levels.rst
.. setting:: systemLog.component.write.verbosity
*Type*: integer
*Default*: 0
.. versionadded:: 3.0
The log message verbosity level for components related to
write operations. See :data:`WRITE` components.
.. include:: /includes/log-verbosity-levels.rst
``processManagement`` Options
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: yaml
processManagement:
fork: <boolean>
pidFilePath: <string>
.. setting:: processManagement.fork
*Type*: boolean
*Default*: false
Enable a :term:`daemon` mode that runs the :binary:`~bin.mongos` or :binary:`~bin.mongod` process in the
background. By default :binary:`~bin.mongos` or :binary:`~bin.mongod` does not run as a daemon:
typically you will run :binary:`~bin.mongos` or :binary:`~bin.mongod` as a daemon, either by using
:setting:`processManagement.fork` or by using a controlling process that handles the
daemonization process (e.g. as with ``upstart`` and ``systemd``).
The :setting:`processManagement.fork` option is not supported on Windows.
.. include:: /includes/extracts/linux-config-expectations-processmanagement-fork.rst
.. setting:: processManagement.pidFilePath
*Type*: string
Specifies a file location to hold the process ID of the :binary:`~bin.mongos` or :binary:`~bin.mongod`
process where :binary:`~bin.mongos` or :binary:`~bin.mongod` will write its PID. This is useful for
tracking the :binary:`~bin.mongos` or :binary:`~bin.mongod` process in combination with the
:setting:`processManagement.fork` setting. Without a specified :setting:`processManagement.pidFilePath` option, the
process creates no PID file.
``net`` Options
~~~~~~~~~~~~~~~
.. code-block:: yaml
net:
port: <int>
bindIp: <string>
maxIncomingConnections: <int>
wireObjectCheck: <boolean>
ipv6: <boolean>
unixDomainSocket:
enabled: <boolean>
pathPrefix: <string>
filePermissions: <int>
http:
enabled: <boolean>
JSONPEnabled: <boolean>
RESTInterfaceEnabled: <boolean>
ssl:
sslOnNormalPorts: <boolean> # deprecated since 2.6
mode: <string>
PEMKeyFile: <string>
PEMKeyPassword: <string>
clusterFile: <string>
clusterPassword: <string>
CAFile: <string>
CRLFile: <string>
allowConnectionsWithoutCertificates: <boolean>
allowInvalidCertificates: <boolean>
allowInvalidHostnames: <boolean>
disabledProtocols: <string>
FIPSMode: <boolean>
.. setting:: net.port
*Type*: integer
*Default*: 27017
The TCP port on which the MongoDB instance listens for
client connections.
.. setting:: net.bindIp
*Type*: string
*Default*: All interfaces.
.. versionchanged:: 2.6.0
The ``deb`` and ``rpm`` packages include a default configuration
file (``/etc/mongod.conf``) that sets :setting:`net.bindIp` to ``127.0.0.1``.
The IP addresses and/or full Unix domain socket paths on which
:binary:`~bin.mongos` or :binary:`~bin.mongod` should listen for client connections. You may attach
:binary:`~bin.mongos` or :binary:`~bin.mongod` to any interface. To bind to multiple addresses, enter a
list of comma-separated values.
.. example:: ``localhost,/tmp/mongod.sock``
You can specify both IPv4 and IPv6 addresses, or hostnames that
resolve to an IPv4 or IPv6 address.
.. example:: ``localhost, 2001:0DB8:e132:ba26:0d5c:2774:e7f9:d513``
.. note::
If specifying an IPv6 address *or* a hostname that resolves to an
IPv6 address to :setting:`net.bindIp`, you must start :binary:`~bin.mongos` or :binary:`~bin.mongod` with
:setting:`net.ipv6 : true <net.ipv6>` to enable IPv6 support. Specifying an IPv6 address
to :setting:`net.bindIp` does not enable IPv6 support.
If specifying a
`link-local IPv6 address <https://en.wikipedia.org/w/index.php?title=Link-local_address&oldid=880793020#IPv6>`_
(``fe80::/10``), you must append the
`zone index <https://en.wikipedia.org/w/index.php?title=IPv6_address&oldid=877601778#Scoped_literal_IPv6_addresses>`_
to that address (i.e. ``fe80::<address>%<adapter-name>``).
.. example:: ``localhost,fe80::a00:27ff:fee0:1fcf%enp0s3``
.. include:: /includes/tip-hostnames.rst
.. include:: /includes/warning-bind-ip-security-considerations.rst
To bind to all IPv4 addresses, enter ``0.0.0.0``.
To bind to all IPv4 and IPv6 addresses, enter ``0.0.0.0,::``.
.. setting:: net.maxIncomingConnections
*Type*: integer
*Default*: 65536
The maximum number of simultaneous connections that :binary:`~bin.mongos` or :binary:`~bin.mongod` will
accept. This setting has no effect if it is higher than your operating
system's configured maximum connection tracking threshold.
Do not assign too low of a value to this option, or you will encounter errors
during normal application operation.
.. include:: /includes/fact-maxconns-mongos.rst
.. setting:: net.wireObjectCheck
*Type*: boolean
*Default*: true
When ``true``, the :binary:`~bin.mongod` or :binary:`~bin.mongos` instance validates
all requests from clients upon receipt to prevent clients from inserting
malformed or invalid BSON into a MongoDB database.
For objects with a high degree of sub-document nesting, :setting:`net.wireObjectCheck` can
have a small impact on performance.
.. setting:: net.ipv6
*Type*: boolean
*Default*: false
Set :setting:`net.ipv6` to ``true`` to enable IPv6 support. :binary:`~bin.mongos`/:binary:`~bin.mongod` disables IPv6 support by default.
Setting :setting:`net.ipv6` does *not* direct the :binary:`~bin.mongos`/:binary:`~bin.mongod` to listen on any
local IPv6 addresses or interfaces. To configure the :binary:`~bin.mongos`/:binary:`~bin.mongod` to
listen on an IPv6 interface, you must configure :setting:`net.bindIp` with one
or more IPv6 addresses or hostnames that resolve to IPv6 addresses.
.. PENDING SERVER-13097
``net.unixDomainSocket`` Options
````````````````````````````````
.. code-block:: yaml
net:
unixDomainSocket:
enabled: <boolean>
pathPrefix: <string>
filePermissions: <int>
.. setting:: net.unixDomainSocket.enabled
*Type*: boolean
*Default*: true
Enable or disable listening on the UNIX domain socket. :setting:`net.unixDomainSocket.enabled` applies only
to Unix-based systems.
When :setting:`net.unixDomainSocket.enabled` is ``true``, :binary:`~bin.mongos` or :binary:`~bin.mongod` listens on the UNIX socket.
The :binary:`~bin.mongos` or :binary:`~bin.mongod` process always listens on the UNIX socket unless
one of the following is true:
- :setting:`net.unixDomainSocket.enabled` is ``false``
- ``--nounixsocket`` is set. The command
line option takes precedence over the configuration file setting.
- :setting:`net.bindIp` is not set
- :setting:`net.bindIp` does not specify ``127.0.0.1``
.. |mongodb-package| replace:: :binary:`~bin.mongos` or :binary:`~bin.mongod`
.. include:: /includes/note-deb-and-rpm-default-to-localhost.rst
.. setting:: net.unixDomainSocket.pathPrefix
*Type*: string
*Default*: /tmp
The path for the UNIX socket. :setting:`net.unixDomainSocket.pathPrefix` applies only
to Unix-based systems.
If this option has no value, the
:binary:`~bin.mongos` or :binary:`~bin.mongod` process creates a socket with ``/tmp`` as a prefix. MongoDB
creates and listens on a UNIX socket unless one of the following is true:
- :setting:`net.unixDomainSocket.enabled` is ``false``
- ``--nounixsocket`` is set
- :setting:`net.bindIp` is not set
- :setting:`net.bindIp` does not specify ``127.0.0.1``
.. setting:: net.unixDomainSocket.filePermissions
*Type*: int
*Default*: ``0700``
Sets the permission for the UNIX domain socket file.
:setting:`net.unixDomainSocket.filePermissions` applies only to Unix-based systems.
``net.http`` Options
````````````````````
.. code-block:: yaml
net:
http:
enabled: <boolean>
JSONPEnabled: <boolean>
RESTInterfaceEnabled: <boolean>
.. include:: /includes/warning-http-interface.rst
.. setting:: net.http.enabled
*Type*: boolean
*Default*: false
.. include:: /includes/fact-deprecated-http-interface.rst
Enable or disable the HTTP interface. Enabling the interface can increase
network exposure.
Leave the HTTP interface *disabled* for production deployments. If you
*do* enable this interface, you should only allow trusted clients to
access this port. See :ref:`security-firewalls`.
.. note::
- .. include:: /includes/fact-http-interface-kerberos.rst
.. versionadded:: 2.6
.. setting:: net.http.JSONPEnabled
*Type*: boolean
*Default*: false
Enable or disable :term:`JSONP` access via an HTTP interface. Enabling the
interface can increase network exposure. The :setting:`net.http.JSONPEnabled` option enables the
HTTP interface, even if the :setting:`HTTP interface <net.http.enabled>`
option is disabled.
.. include:: /includes/fact-deprecated-http-interface.rst
The :setting:`net.http.JSONPEnabled` setting is available only for :binary:`~bin.mongod`.
.. setting:: net.http.RESTInterfaceEnabled
*Type*: boolean
*Default*: false
Enable or disable the simple :term:`REST` API. Enabling the :term:`REST` API
enables the HTTP interface, even if the :setting:`HTTP interface
<net.http.enabled>` option is disabled, and as a result can increase
network exposure.
.. include:: /includes/fact-deprecated-http-interface.rst
The :setting:`net.http.RESTInterfaceEnabled` setting is available only for :binary:`~bin.mongod`.
``net.ssl`` Options
```````````````````
.. code-block:: yaml
net:
ssl:
sslOnNormalPorts: <boolean> # deprecated since 2.6
mode: <string>
PEMKeyFile: <string>
PEMKeyPassword: <string>
clusterFile: <string>
clusterPassword: <string>
CAFile: <string>
CRLFile: <string>
allowConnectionsWithoutCertificates: <boolean>
allowInvalidCertificates: <boolean>
allowInvalidHostnames: <boolean>
disabledProtocols: <string>
FIPSMode: <boolean>
.. setting:: net.ssl.sslOnNormalPorts
*Type*: boolean
.. deprecated:: 2.6 Use :setting:`net.ssl.mode: requireSSL <~net.ssl.mode>` instead.
Enable or disable TLS/SSL for :binary:`~bin.mongos` or :binary:`~bin.mongod`.
With :setting:`net.ssl.sslOnNormalPorts`, a :binary:`~bin.mongos` or :binary:`~bin.mongod` requires TLS/SSL encryption for all
connections on the default MongoDB port, or the port specified by
:setting:`net.port`. By default, :setting:`net.ssl.sslOnNormalPorts` is
disabled.
.. include:: /includes/extracts/ssl-facts-see-more.rst
.. setting:: net.ssl.mode
*Type*: string
.. versionadded:: 2.6
Enable or disable TLS/SSL or mixed TLS/SSL used for all network connections. The
argument to the :setting:`net.ssl.mode` setting can be one of the following:
.. list-table::
:header-rows: 1
:widths: 20 40
* - Value
- Description
* - ``disabled``
- The server does not use TLS/SSL.
* - ``allowSSL``
- Connections between servers do not use TLS/SSL. For incoming
connections, the server accepts both TLS/SSL and non-TLS/non-SSL.
* - ``preferSSL``
- Connections between servers use TLS/SSL. For incoming
connections, the server accepts both TLS/SSL and non-TLS/non-SSL.
* - ``requireSSL``
- The server uses and accepts only TLS/SSL encrypted connections.
.. include:: /includes/extracts/ssl-facts-x509-ca-file.rst
.. include:: /includes/extracts/ssl-facts-see-more.rst
.. setting:: net.ssl.PEMKeyFile
*Type*: string
The :file:`.pem` file that contains both the TLS/SSL certificate
and key. Specify the file name of the :file:`.pem` file using relative
or absolute paths.
You must specify :setting:`net.ssl.PEMKeyFile` when TLS/SSL is enabled.
.. include:: /includes/extracts/ssl-facts-see-more.rst
.. setting:: net.ssl.PEMKeyPassword
*Type*: string
The password to de-crypt the certificate-key file (i.e.
:setting:`~net.ssl.PEMKeyFile`). Use the :setting:`net.ssl.PEMKeyPassword` option only if the
certificate-key file is encrypted. In all cases, the :binary:`~bin.mongos` or :binary:`~bin.mongod` will
redact the password from all logging and reporting output.
.. versionchanged:: 2.6
If the private key in the PEM file is encrypted and you do not
specify the :setting:`net.ssl.PEMKeyPassword` option, the :binary:`~bin.mongos` or :binary:`~bin.mongod` will prompt for a
passphrase. See :ref:`ssl-certificate-password`.
.. include:: /includes/extracts/ssl-facts-see-more.rst
.. setting:: net.ssl.clusterFile
*Type*: string
.. versionadded:: 2.6
The :file:`.pem` file that contains the x.509 certificate-key
file for :ref:`membership authentication <x509-internal-authentication>`
for the cluster or replica set.
If :setting:`net.ssl.clusterFile` does not specify the ``.pem`` file for internal cluster
authentication, the cluster uses the ``.pem`` file specified in the
:setting:`~net.ssl.PEMKeyFile` setting.
.. include:: /includes/extracts/ssl-facts-x509-ca-file.rst
.. include:: /includes/extracts/ssl-facts-see-more.rst
.. setting:: net.ssl.clusterPassword
*Type*: string
.. versionadded:: 2.6
The password to de-crypt the x.509 certificate-key file
specified with ``--sslClusterFile``. Use the :setting:`net.ssl.clusterPassword` option only
if the certificate-key file is encrypted. In all cases, the :binary:`~bin.mongos` or :binary:`~bin.mongod`
will redact the password from all logging and reporting output.
If the x.509 key file is encrypted and you do not specify the
:setting:`net.ssl.clusterPassword` option, the :binary:`~bin.mongos` or :binary:`~bin.mongod` will prompt for a passphrase. See
:ref:`ssl-certificate-password`.
.. include:: /includes/extracts/ssl-facts-see-more.rst
.. setting:: net.ssl.CAFile
*Type*: string
The :file:`.pem` file that contains the root certificate chain
from the Certificate Authority. Specify the file name of the
:file:`.pem` file using relative or absolute paths.
.. include:: /includes/extracts/ssl-facts-x509-ca-file.rst
.. include:: /includes/extracts/ssl-facts-see-more.rst
.. setting:: net.ssl.CRLFile
*Type*: string
The the :file:`.pem` file that contains the Certificate Revocation
List. Specify the file name of the :file:`.pem` file using relative or
absolute paths.
.. include:: /includes/extracts/ssl-facts-see-more.rst