summaryrefslogtreecommitdiff
path: root/debian/mongos.1
blob: 72fb11495e8dded4d00cb77b5885e9b6d7af0011 (plain)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
.\" Man page generated from reStructuredText.
.
.TH "MONGOS" "1" "Jun 21, 2018" "4.0" "mongodb-manual"
.SH NAME
mongos \- MongoDB Sharded Cluster Query Router
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.SS On this page
.INDENT 0.0
.IP \(bu 2
\fI\%Synopsis\fP
.IP \(bu 2
\fI\%Considerations\fP
.IP \(bu 2
\fI\%Options\fP
.UNINDENT
.SH SYNOPSIS
.sp
\fI\%mongos\fP for “MongoDB Shard,” is a routing service for
MongoDB shard configurations that processes queries from the
application layer, and determines the location of this data in the
sharded cluster, in order to complete these operations.
From the perspective of the application, a
\fI\%mongos\fP instance behaves identically to any other MongoDB
instance.
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
Starting in version 4.0, MongoDB disables support for TLS 1.0
encryption on systems where TLS 1.1+ is available. For
more details, see 4.0\-disable\-tls\&.
.UNINDENT
.UNINDENT
.SH CONSIDERATIONS
.sp
Never change the name of the \fI\%mongos\fP binary.
.SH OPTIONS
.SS Core Options
.INDENT 0.0
.TP
.B \-\-help, \-h
Returns information on the options and use of \fBmongos\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-version
Returns the \fBmongos\fP release number.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-config <filename>, \-f <filename>
Specifies a configuration file for runtime configuration options. The
configuration file is the preferred method for runtime configuration of
\fBmongos\fP\&. The options are equivalent to the command\-line
configuration options. See /reference/configuration\-options for
more information.
.sp
Ensure the configuration file uses ASCII encoding. The \fBmongos\fP
instance does not support configuration files with non\-ASCII encoding,
including UTF\-8.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-verbose, \-v
Increases the amount of internal reporting returned on standard output
or in log files. Increase the verbosity with the \fB\-v\fP form by
including the option multiple times, (e.g. \fB\-vvvvv\fP\&.)
.UNINDENT
.INDENT 0.0
.TP
.B \-\-quiet
Runs \fBmongos\fP in a quiet mode that attempts to limit the amount
of output.
.sp
This option suppresses:
.INDENT 7.0
.IP \(bu 2
output from database commands
.IP \(bu 2
replication activity
.IP \(bu 2
connection accepted events
.IP \(bu 2
connection closed events
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \-\-port <port>
\fIDefault\fP: 27017
.sp
Specifies the TCP port on which the MongoDB instance listens for
client connections.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-bind_ip <ip address>
\fIDefault\fP: localhost
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
Starting in MongoDB 3.6, \fBmongos\fP bind to localhost
(\fB127.0.0.1\fP) by default. See 3.6\-bind\-to\-localhost\&.
.UNINDENT
.UNINDENT
.sp
The IP addresses and/or full Unix domain socket paths on which
\fBmongos\fP should listen for client connections. You may attach
\fBmongos\fP to any interface. To bind to multiple addresses, enter a
list of comma\-separated values.
.INDENT 7.0
.INDENT 3.5
.SS Example
.sp
\fBlocalhost,/tmp/mongod.sock\fP
.UNINDENT
.UNINDENT
.sp
\fBWARNING:\fP
.INDENT 7.0
.INDENT 3.5
Before you bind to other ip addresses, consider enabling
access control and other security measures listed
in /administration/security\-checklist to prevent unauthorized
access.
.UNINDENT
.UNINDENT
.sp
To bind to all IPv4 addresses, enter \fB0.0.0.0\fP\&.
.sp
To bind to all IPv4 and IPv6 addresses, enter \fB0.0.0.0,::\fP
or alternatively, use the \fBnet.bindIpAll\fP setting.
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
\fB\-\-bind_ip\fP and \fB\-\-bind_ip_all\fP are mutually exclusive. That
is, you can specify one or the other, but not both.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \-\-bind_ip_all
New in version 3.6.

.sp
If specified, the \fBmongos\fP instance binds to all ip addresses. When
attaching \fBmongos\fP to a publicly accessible interface, ensure
that you have implemented proper authentication and firewall
restrictions to protect the integrity of your database.
.sp
\fBWARNING:\fP
.INDENT 7.0
.INDENT 3.5
Before you bind to other ip addresses, consider enabling
access control and other security measures listed
in /administration/security\-checklist to prevent unauthorized
access.
.UNINDENT
.UNINDENT
.sp
Alternatively, you can set the \fB\-\-bind_ip\fP option to
\fB0.0.0.0,::\fP to bind to all IP addresses.
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
\fB\-\-bind_ip\fP and \fB\-\-bind_ip_all\fP are mutually exclusive. That
is, you can specify one or the other, but not both.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \-\-maxConns <number>
The maximum number of simultaneous connections that \fBmongos\fP will
accept. This setting has no effect if it is higher than your operating
system’s configured maximum connection tracking threshold.
.sp
Do not assign too low of a value to this option, or you will
encounter errors during normal application operation.
.sp
This is particularly useful for a \fI\%mongos\fP if you have a client
that creates multiple connections and allows them to timeout rather
than closing them.
.sp
In this case, set \fBmaxIncomingConnections\fP to a value slightly
higher than the maximum number of connections that the client creates, or the
maximum size of the connection pool.
.sp
This setting prevents the \fI\%mongos\fP from causing connection spikes on
the individual shards\&. Spikes like these may disrupt the
operation and memory allocation of the sharded cluster\&.
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
Changed in version 2.6: MongoDB removed the upward limit on the \fBmaxIncomingConnections\fP
setting.

.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \-\-syslog
Sends all logging output to the host’s syslog system rather
than to standard output or to a log file. , as with \fI\%\-\-logpath\fP\&.
.sp
The \fI\%\-\-syslog\fP option is not supported on Windows.
.sp
\fBWARNING:\fP
.INDENT 7.0
.INDENT 3.5
The \fBsyslog\fP daemon generates timestamps when it logs a message, not
when MongoDB issues the message. This can lead to misleading timestamps
for log entries, especially when the system is under heavy load. We
recommend using the \fI\%\-\-logpath\fP option for production systems to
ensure accurate timestamps.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \-\-syslogFacility <string>
\fIDefault\fP: user
.sp
Specifies 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  enable the \fI\%\-\-syslog\fP option.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-logpath <path>
Sends all diagnostic logging information to a log file instead of to
standard output or to the host’s syslog system. MongoDB creates
the log file at the path you specify.
.sp
By default, MongoDB will move any existing log file rather than overwrite
it. To instead append to the log file, set the \fI\%\-\-logappend\fP option.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-logappend
Appends new entries to the end of the existing log file when the \fBmongos\fP
instance restarts. Without this option, \fBmongod\fP will back up the
existing log and create a new file.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-redactClientLogData
New in version 3.4: Available in MongoDB Enterprise only.

.sp
A \fBmongos\fP running with \fI\%\-\-redactClientLogData\fP redacts any message accompanying a given
log event before logging. This prevents the \fBmongos\fP from writing
potentially sensitive data stored on the database to the diagnostic log.
Metadata such as error or operation codes, line numbers, and source file
names are still visible in the logs.
.sp
Use \fI\%\-\-redactClientLogData\fP in conjunction with encryption to assist compliance with regulatory
requirements.
.sp
For example, a MongoDB deployment might store Personally Identifiable
Information (PII) in one or more collections. The \fBmongos\fP logs events
such as those related to CRUD operations, sharding metadata, etc. It is
possible that the \fBmongos\fP may expose PII as a part of these logging
operations. A \fBmongos\fP running with \fI\%\-\-redactClientLogData\fP removes any message
accompanying these events before being output to the log, effectively
removing the PII.
.sp
Diagnostics on a \fBmongos\fP running with \fI\%\-\-redactClientLogData\fP may be more difficult
due to the lack of data related to a log event. See the
process logging manual page for an
example of the effect of \fI\%\-\-redactClientLogData\fP on log output.
.sp
You can enable or disable log redaction on a running \fBmongos\fP
using the \fBsetParameter\fP database command.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
db.adminCommand(
  { setParameter: 1, redactClientLogData : true | false }
)
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \-\-timeStampFormat <string>
\fIDefault\fP: iso8601\-local
.sp
The time format for timestamps in log messages. Specify one of the
following values:
.TS
center;
|l|l|.
_
T{
Value
T}	T{
Description
T}
_
T{
\fBctime\fP
T}	T{
Displays timestamps as \fBWed Dec 31
18:17:54.811\fP\&.
T}
_
T{
\fBiso8601\-utc\fP
T}	T{
Displays timestamps in Coordinated Universal Time (UTC) in the
ISO\-8601 format. For example, for New York at the start of the
Epoch: \fB1970\-01\-01T00:00:00.000Z\fP
T}
_
T{
\fBiso8601\-local\fP
T}	T{
Displays timestamps in local time in the ISO\-8601
format. For example, for New York at the start of the Epoch:
\fB1969\-12\-31T19:00:00.000\-0500\fP
T}
_
.TE
.UNINDENT
.INDENT 0.0
.TP
.B \-\-pidfilepath <path>
Specifies a file location to hold the process ID of the \fBmongos\fP
process where \fBmongos\fP will write its PID. This is useful for
tracking the \fBmongos\fP process in combination with
the \fI\%\-\-fork\fP option. Without a specified \fI\%\-\-pidfilepath\fP option, the
process creates no PID file.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-keyFile <file>
Specifies the path to a key file that stores the shared secret
that MongoDB instances use to authenticate to each other in a
sharded cluster or replica set\&. \fI\%\-\-keyFile\fP implies
\fBclient authorization\fP\&. See inter\-process\-auth for more
information.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-setParameter <options>
Specifies one of the MongoDB parameters described in
/reference/parameters\&. You can specify multiple \fBsetParameter\fP
fields.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-nounixsocket
Disables listening on the UNIX domain socket. \fI\%\-\-nounixsocket\fP applies only
to Unix\-based systems.
.sp
The \fBmongos\fP process
always listens on the UNIX socket unless one of the following is true:
.INDENT 7.0
.IP \(bu 2
\fI\%\-\-nounixsocket\fP is set
.IP \(bu 2
\fBnet.bindIp\fP is not set
.IP \(bu 2
\fBnet.bindIp\fP does not specify \fB127.0.0.1\fP
.UNINDENT
.sp
New in version 2.6: \fBmongos\fP installed from official \&.deb and \&.rpm packages
have the \fBbind_ip\fP configuration set to \fB127.0.0.1\fP by
default.

.UNINDENT
.INDENT 0.0
.TP
.B \-\-unixSocketPrefix <path>
\fIDefault\fP: /tmp
.sp
The path for the UNIX socket. \fI\%\-\-unixSocketPrefix\fP applies only
to Unix\-based systems.
.sp
If this option has no value, the
\fBmongos\fP process creates a socket with \fB/tmp\fP as a prefix. MongoDB
creates and listens on a UNIX socket unless one of the following is true:
.INDENT 7.0
.IP \(bu 2
\fBnet.unixDomainSocket.enabled\fP is \fBfalse\fP
.IP \(bu 2
\fI\%\-\-nounixsocket\fP is set
.IP \(bu 2
\fBnet.bindIp\fP is not set
.IP \(bu 2
\fBnet.bindIp\fP does not specify \fB127.0.0.1\fP
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \-\-filePermissions <path>
\fIDefault\fP: \fB0700\fP
.sp
Sets the permission for the UNIX domain socket file.
.sp
\fI\%\-\-filePermissions\fP applies only to Unix\-based systems.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-fork
Enables a daemon mode that runs the \fBmongos\fP process in the
background. By default \fBmongos\fP does not run as a daemon:
typically you will run \fBmongos\fP as a daemon, either by using
\fI\%\-\-fork\fP or by using a controlling process that handles the
daemonization process (e.g. as with \fBupstart\fP and \fBsystemd\fP).
.UNINDENT
.INDENT 0.0
.TP
.B \-\-transitionToAuth
New in version 3.4: Allows the \fBmongos\fP to accept and create authenticated and
non\-authenticated connections to and from other \fBmongod\fP
and \fI\%mongos\fP instances in the deployment. Used for
performing rolling transition of replica sets or sharded clusters
from a no\-auth configuration to internal authentication\&. Requires specifying a internal
authentication mechanism such as
\fI\%\-\-keyFile\fP\&.

.sp
For example, if using keyfiles for
internal authentication, the \fBmongos\fP creates
an authenticated connection with any \fBmongod\fP or \fI\%mongos\fP
in the deployment using a matching keyfile. If the security mechanisms do
not match, the \fBmongos\fP utilizes a non\-authenticated connection instead.
.sp
A \fBmongos\fP running with \fI\%\-\-transitionToAuth\fP does not enforce user access
controls\&. Users may connect to your deployment without any
access control checks and perform read, write, and administrative operations.
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
A \fBmongos\fP running with internal authentication and \fIwithout\fP \fI\%\-\-transitionToAuth\fP requires clients to connect
using user access controls\&. Update clients to
connect to the \fBmongos\fP using the appropriate user
prior to restarting \fBmongos\fP without \fI\%\-\-transitionToAuth\fP\&.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \-\-networkMessageCompressors <string>
New in version 3.4.

.sp
Changed in version 3.6: Add support for zlib compressor.

.sp
Enables network compression for communication between this
\fBmongos\fP instance and:
.INDENT 7.0
.IP \(bu 2
other members of the sharded cluster
.IP \(bu 2
a \fBmongo\fP shell.
.UNINDENT
.sp
\fBIMPORTANT:\fP
.INDENT 7.0
.INDENT 3.5
Messages are compressed when both parties enable network
compression. Otherwise, messages between the parties are
uncompressed.
.UNINDENT
.UNINDENT
.sp
You can specify the following compressors:
.INDENT 7.0
.IP \(bu 2
snappy (Default)
.IP \(bu 2
zlib
.UNINDENT
.sp
If you specify multiple compressors, then the order in which you list
the compressors matter as well as the communication initiator. For
example, if a \fBmongo\fP shell specifies the following network
compressors \fBzlib,snappy\fP and the \fBmongod\fP specifies
\fBsnappy,zlib\fP, messages between \fBmongo\fP shell and
\fBmongod\fP uses \fBzlib\fP\&.
.sp
If the parties do not share at least one common compressor, messages
between the parties are uncompressed. For example, if a
\fBmongo\fP shell specifies the network compressor
\fBzlib\fP and \fBmongod\fP specifies \fBsnappy\fP, messages
between \fBmongo\fP shell and \fBmongod\fP are not compressed.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-serviceExecutor <string>
\fIDefault\fP: synchronous
.sp
New in version 3.6.

.sp
Determines the threading and execution model \fBmongos\fP uses to
execute client requests. The \fB\-\-serviceExecutor\fP option accepts one
of the following values:
.TS
center;
|l|l|.
_
T{
Value
T}	T{
Description
T}
_
T{
\fBsynchronous\fP
T}	T{
The \fBmongos\fP uses synchronous networking and manages its
networking thread pool on a per connection basis. Previous
versions of MongoDB managed threads in this way.
T}
_
T{
\fBadaptive\fP
T}	T{
The \fBmongos\fP uses the new experimental asynchronous
networking mode with an adaptive thread pool which manages
threads on a per request basis. This mode should have more
consistent performance and use less resources when there are
more inactive connections than database requests.
T}
_
.TE
.UNINDENT
.INDENT 0.0
.TP
.B \-\-timeZoneInfo <path>
The full path from which to load the time zone database. If this option
is not provided, then MongoDB will use its built\-in time zone database.
.sp
The configuration file included with Linux and macOS packages sets the time
zone database path to \fB/usr/share/zoneinfo\fP by default.
.sp
The built\-in time zone database is a copy of the \fI\%Olson/IANA time zone
database\fP\&. It is updated along with MongoDB
releases, but the release cycle of the time zone database differs from the
release cycle of MongoDB. A copy of the most recent release of the time zone
database can be downloaded from
\fI\%https://downloads.mongodb.org/olson_tz_db/timezonedb\-latest.zip\fP\&.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
wget https://downloads.mongodb.org/olson_tz_db/timezonedb\-latest.zip
unzip timezonedb\-latest.zip
mongos \-\-timeZoneInfo timezonedb\-2017b/
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.SS Sharded Cluster Options
.INDENT 0.0
.TP
.B \-\-configdb <replicasetName>/<config1>,<config2>...
Changed in version 3.2.

.sp
Specifies the configuration servers for the
sharded cluster\&.
.sp
Starting in MongoDB 3.2, config servers for sharded clusters can be
deployed as a replica set\&. The
replica set config servers must run the WiredTiger storage engine\&. MongoDB 3.2 deprecates the use of three mirrored
\fBmongod\fP instances for config servers.
.sp
Specify the config server replica set name and the hostname and port of
at least one of the members of the config server replica set.
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
sharding:
  configDB: <configReplSetName>/cfg1.example.net:27017, cfg2.example.net:27017,...
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The \fI\%mongos\fP instances for the sharded cluster must specify
the same config server replica set name but can specify hostname and
port of different members of the replica set.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-localThreshold
\fIDefault\fP: 15
.sp
Specifies the ping time, in milliseconds, that \fI\%mongos\fP uses
to determine which secondary replica set members to pass read
operations from clients. The default value of \fB15\fP corresponds to
the default value in all of the client drivers\&.
.sp
When \fI\%mongos\fP receives a request that permits reads to
secondary members, the \fI\%mongos\fP will:
.INDENT 7.0
.IP \(bu 2
Find the member of the set with the lowest ping time.
.IP \(bu 2
Construct a list of replica set members that is within a ping time of
15 milliseconds of the nearest suitable member of the set.
.sp
If you specify a value for the \fI\%\-\-localThreshold\fP option, \fI\%mongos\fP will
construct the list of replica members that are within the latency
allowed by this value.
.IP \(bu 2
Select a member to read from at random from this list.
.UNINDENT
.sp
The ping time used for a member compared by the \fI\%\-\-localThreshold\fP setting is a
moving average of recent ping times, calculated at most every 10
seconds. As a result, some queries may reach members above the threshold
until the \fI\%mongos\fP recalculates the average.
.sp
See the replica\-set\-read\-preference\-behavior\-member\-selection
section of the read preference
documentation for more information.
.UNINDENT
.SS TLS/SSL Options
.INDENT 0.0
.INDENT 3.5
.SS See
.sp
/tutorial/configure\-ssl for full
documentation of MongoDB’s support.
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \-\-sslOnNormalPorts
Deprecated since version 2.6: Use \fI\%\-\-sslMode requireSSL\fP instead.

.sp
Enables TLS/SSL for \fBmongos\fP\&.
.sp
With \fI\%\-\-sslOnNormalPorts\fP, a \fBmongos\fP requires TLS/SSL encryption for all
connections on the default MongoDB port, or the port specified by
\fI\%\-\-port\fP\&. By default, \fI\%\-\-sslOnNormalPorts\fP is
disabled.
.sp
For more information about TLS/SSL and MongoDB, see
/tutorial/configure\-ssl and
/tutorial/configure\-ssl\-clients .
.UNINDENT
.INDENT 0.0
.TP
.B \-\-sslMode <mode>
New in version 2.6.

.sp
Enables TLS/SSL or mixed TLS/SSL used for all network connections. The
argument to the \fI\%\-\-sslMode\fP option can be one of the following:
.TS
center;
|l|l|.
_
T{
Value
T}	T{
Description
T}
_
T{
\fBdisabled\fP
T}	T{
The server does not use TLS/SSL.
T}
_
T{
\fBallowSSL\fP
T}	T{
Connections between servers do not use TLS/SSL. For incoming
connections, the server accepts both TLS/SSL and non\-TLS/non\-SSL.
T}
_
T{
\fBpreferSSL\fP
T}	T{
Connections between servers use TLS/SSL. For incoming
connections, the server accepts both TLS/SSL and non\-TLS/non\-SSL.
T}
_
T{
\fBrequireSSL\fP
T}	T{
The server uses and accepts only TLS/SSL encrypted connections.
T}
_
.TE
.sp
Starting in version 3.4, if \fB\-\-sslCAFile\fP or \fBssl.CAFile\fP is not
specified and you are not using x.509 authentication, the
system\-wide CA certificate store will be used when connecting to an
TLS/SSL\-enabled server.
.sp
If using x.509 authentication, \fB\-\-sslCAFile\fP or \fBssl.CAFile\fP
must be specified.
.sp
For more information about TLS/SSL and MongoDB, see
/tutorial/configure\-ssl and
/tutorial/configure\-ssl\-clients .
.UNINDENT
.INDENT 0.0
.TP
.B \-\-sslPEMKeyFile <filename>
Specifies the \fB\&.pem\fP file that contains both the TLS/SSL certificate
and key. Specify the file name of the \fB\&.pem\fP file using relative
or absolute paths.
.sp
You must specify \fI\%\-\-sslPEMKeyFile\fP when TLS/SSL is enabled.
.sp
For more information about TLS/SSL and MongoDB, see
/tutorial/configure\-ssl and
/tutorial/configure\-ssl\-clients .
.UNINDENT
.INDENT 0.0
.TP
.B \-\-sslPEMKeyPassword <value>
Specifies the password to de\-crypt the certificate\-key file (i.e.
\fI\%\-\-sslPEMKeyFile\fP). Use the \fI\%\-\-sslPEMKeyPassword\fP option only if the
certificate\-key file is encrypted. In all cases, the \fBmongos\fP will
redact the password from all logging and reporting output.
.sp
Changed in version 2.6: If the private key in the PEM file is encrypted and you do not
specify the \fI\%\-\-sslPEMKeyPassword\fP option, the \fBmongos\fP will prompt for a
passphrase. See ssl\-certificate\-password\&.

.sp
For more information about TLS/SSL and MongoDB, see
/tutorial/configure\-ssl and
/tutorial/configure\-ssl\-clients .
.UNINDENT
.INDENT 0.0
.TP
.B \-\-clusterAuthMode <option>
\fIDefault\fP: keyFile
.sp
New in version 2.6.

.sp
The authentication mode used for cluster authentication. If you use
internal x.509 authentication,
specify so here. This option can have one of the following values:
.TS
center;
|l|l|.
_
T{
Value
T}	T{
Description
T}
_
T{
\fBkeyFile\fP
T}	T{
Use a keyfile for authentication.
Accept only keyfiles.
T}
_
T{
\fBsendKeyFile\fP
T}	T{
For rolling upgrade purposes. Send a keyfile for
authentication but can accept both keyfiles and x.509
certificates.
T}
_
T{
\fBsendX509\fP
T}	T{
For rolling upgrade purposes. Send the x.509 certificate for
authentication but can accept both keyfiles and x.509
certificates.
T}
_
T{
\fBx509\fP
T}	T{
Recommended. Send the x.509 certificate for authentication and
accept only x.509 certificates.
T}
_
.TE
.sp
Starting in version 3.4, if \fB\-\-sslCAFile\fP or \fBssl.CAFile\fP is not
specified and you are not using x.509 authentication, the
system\-wide CA certificate store will be used when connecting to an
TLS/SSL\-enabled server.
.sp
If using x.509 authentication, \fB\-\-sslCAFile\fP or \fBssl.CAFile\fP
must be specified.
.sp
For more information about TLS/SSL and MongoDB, see
/tutorial/configure\-ssl and
/tutorial/configure\-ssl\-clients .
.UNINDENT
.INDENT 0.0
.TP
.B \-\-sslClusterFile <filename>
New in version 2.6.

.sp
Specifies the \fB\&.pem\fP file that contains the x.509 certificate\-key
file for membership authentication
for the cluster or replica set.
.sp
If \fI\%\-\-sslClusterFile\fP does not specify the \fB\&.pem\fP file for internal cluster
authentication, the cluster uses the \fB\&.pem\fP file specified in the
\fI\%\-\-sslPEMKeyFile\fP option.
.sp
If using x.509 authentication, \fB\-\-sslCAFile\fP or \fBssl.CAFile\fP
must be specified.
.sp
For more information about TLS/SSL and MongoDB, see
/tutorial/configure\-ssl and
/tutorial/configure\-ssl\-clients .
.UNINDENT
.INDENT 0.0
.TP
.B \-\-sslClusterPassword <value>
New in version 2.6.

.sp
Specifies the password to de\-crypt the x.509 certificate\-key file
specified with \fB\-\-sslClusterFile\fP\&. Use the \fI\%\-\-sslClusterPassword\fP option only
if the certificate\-key file is encrypted. In all cases, the \fBmongos\fP
will redact the password from all logging and reporting output.
.sp
If the x.509 key file is encrypted and you do not specify the
\fI\%\-\-sslClusterPassword\fP option, the \fBmongos\fP will prompt for a passphrase. See
ssl\-certificate\-password\&.
.sp
For more information about TLS/SSL and MongoDB, see
/tutorial/configure\-ssl and
/tutorial/configure\-ssl\-clients .
.UNINDENT
.INDENT 0.0
.TP
.B \-\-sslCAFile <filename>
Specifies the \fB\&.pem\fP file that contains the root certificate chain
from the Certificate Authority. Specify the file name of the
\fB\&.pem\fP file using relative or absolute paths.
.sp
Starting in version 3.4, if \fB\-\-sslCAFile\fP or \fBssl.CAFile\fP is not
specified and you are not using x.509 authentication, the
system\-wide CA certificate store will be used when connecting to an
TLS/SSL\-enabled server.
.sp
If using x.509 authentication, \fB\-\-sslCAFile\fP or \fBssl.CAFile\fP
must be specified.
.sp
For more information about TLS/SSL and MongoDB, see
/tutorial/configure\-ssl and
/tutorial/configure\-ssl\-clients .
.UNINDENT
.INDENT 0.0
.TP
.B \-\-sslCRLFile <filename>
Specifies the the \fB\&.pem\fP file that contains the Certificate Revocation
List. Specify the file name of the \fB\&.pem\fP file using relative or
absolute paths.
.sp
For more information about TLS/SSL and MongoDB, see
/tutorial/configure\-ssl and
/tutorial/configure\-ssl\-clients .
.UNINDENT
.INDENT 0.0
.TP
.B \-\-sslAllowConnectionsWithoutCertificates
Disables the requirement for TLS/SSL certificate validation that
\fB\-\-sslCAFile\fP enables. With the \fI\%\-\-sslAllowConnectionsWithoutCertificates\fP option, the \fBmongos\fP
will accept connections when the client does not present a certificate
when establishing the connection.
.sp
If the client presents a certificate and the \fBmongos\fP has \fI\%\-\-sslAllowConnectionsWithoutCertificates\fP
enabled, the \fBmongos\fP will validate the certificate using the root
certificate chain specified by \fB\-\-sslCAFile\fP and reject clients
with invalid certificates.
.sp
Use the \fI\%\-\-sslAllowConnectionsWithoutCertificates\fP option if you have a mixed deployment that includes
clients that do not or cannot present certificates to the \fBmongos\fP\&.
.sp
For more information about TLS/SSL and MongoDB, see
/tutorial/configure\-ssl and
/tutorial/configure\-ssl\-clients .
.UNINDENT
.INDENT 0.0
.TP
.B \-\-sslAllowInvalidCertificates
Bypasses the validation checks for TLS/SSL certificates on other
servers in the cluster and allows the use of invalid certificates to
connect.
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
Starting in MongoDB 4.0, if you specify
\fB\-\-sslAllowInvalidCertificates\fP or \fBssl.allowInvalidCertificates:
true\fP when using x.509 authentication, an invalid certificate is
only sufficient to establish a TLS/SSL connection but is
\fIinsufficient\fP for authentication.
.UNINDENT
.UNINDENT
.sp
When using
the \fI\%\-\-sslAllowInvalidCertificates\fP setting, MongoDB
logs a warning regarding the use of the invalid certificate.
.sp
For more information about TLS/SSL and MongoDB, see
/tutorial/configure\-ssl and
/tutorial/configure\-ssl\-clients .
.UNINDENT
.INDENT 0.0
.TP
.B \-\-sslAllowInvalidHostnames
New in version 3.0.

.sp
Disables the validation of the hostnames in TLS/SSL certificates,
when connecting to other members of the replica set or sharded cluster
for inter\-process authentication. This allows \fBmongos\fP to connect
to other members if the hostnames in their certificates do not match
their configured hostname.
.sp
For more information about TLS/SSL and MongoDB, see
/tutorial/configure\-ssl and
/tutorial/configure\-ssl\-clients .
.UNINDENT
.INDENT 0.0
.TP
.B \-\-sslDisabledProtocols <protocol(s)>
New in version 3.0.7.

.sp
Prevents a MongoDB server running with TLS/SSL from accepting
incoming connections that use a specific protocol or protocols. To
specify multiple protocols, use a comma separated list of protocols.
.sp
\fI\%\-\-sslDisabledProtocols\fP recognizes the following protocols: \fBTLS1_0\fP, \fBTLS1_1\fP,
and \fBTLS1_2\fP\&.
.INDENT 7.0
.IP \(bu 2
On macOS, you cannot disable \fBTLS1_1\fP and leave both \fBTLS1_0\fP and
\fBTLS1_2\fP enabled. You must disable at least one of the other
two, for example, \fBTLS1_0,TLS1_1\fP\&.
.IP \(bu 2
To list multiple protocols, specify as a comma separated list of
protocols. For example \fBTLS1_0,TLS1_1\fP\&.
.IP \(bu 2
Specifying an unrecognized protocol will prevent the server from
starting.
.IP \(bu 2
The specified disabled protocols overrides any default disabled
protocols.
.UNINDENT
.sp
Starting in version 4.0, MongoDB disables the use of TLS 1.0 if TLS
1.1+ is available on the system. To enable the disabled TLS 1.0,
specify \fBnone\fP to \fI\%\-\-sslDisabledProtocols\fP\&. 4.0\-disable\-tls
.sp
Members of replica sets and sharded clusters must speak at least one
protocol in common.
.sp
\fBSEE ALSO:\fP
.INDENT 7.0
.INDENT 3.5
ssl\-disallow\-protocols
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \-\-sslFIPSMode
Directs the \fBmongos\fP to use the FIPS mode of the installed OpenSSL
library. Your system must have a FIPS
compliant OpenSSL library to use the \fI\%\-\-sslFIPSMode\fP option.
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
FIPS\-compatible TLS/SSL is
available only in \fI\%MongoDB Enterprise\fP\&. See
/tutorial/configure\-fips for more information.
.UNINDENT
.UNINDENT
.UNINDENT
.SS Audit Options
.INDENT 0.0
.TP
.B \-\-auditDestination
Enables auditing and specifies where
\fBmongos\fP sends all audit events.
.sp
\fI\%\-\-auditDestination\fP can have one of the following values:
.TS
center;
|l|l|.
_
T{
Value
T}	T{
Description
T}
_
T{
\fBsyslog\fP
T}	T{
Output the audit events to syslog in JSON format. Not available on
Windows. Audit messages have a syslog severity level of \fBinfo\fP
and a facility level of \fBuser\fP\&.
.sp
The syslog message limit can result in the truncation of
audit messages. The auditing system will neither detect the
truncation nor error upon its occurrence.
T}
_
T{
\fBconsole\fP
T}	T{
Output the audit events to \fBstdout\fP in JSON format.
T}
_
T{
\fBfile\fP
T}	T{
Output the audit events to the file specified in
\fI\%\-\-auditPath\fP in the format specified in
\fI\%\-\-auditFormat\fP\&.
T}
_
.TE
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
Available only in \fI\%MongoDB Enterprise\fP\&.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \-\-auditFormat
New in version 2.6.

.sp
Specifies the format of the output file for auditing if \fI\%\-\-auditDestination\fP is \fBfile\fP\&. The
\fI\%\-\-auditFormat\fP option can have one of the following values:
.TS
center;
|l|l|.
_
T{
Value
T}	T{
Description
T}
_
T{
\fBJSON\fP
T}	T{
Output the audit events in JSON format to the file specified
in \fI\%\-\-auditPath\fP\&.
T}
_
T{
\fBBSON\fP
T}	T{
Output the audit events in BSON binary format to the file
specified in \fI\%\-\-auditPath\fP\&.
T}
_
.TE
.sp
Printing audit events to a file in JSON format degrades server
performance more than printing to a file in BSON format.
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
Available only in \fI\%MongoDB Enterprise\fP\&.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \-\-auditPath
New in version 2.6.

.sp
Specifies the output file for auditing if
\fI\%\-\-auditDestination\fP has value of \fBfile\fP\&. The \fI\%\-\-auditPath\fP
option can take either a full path name or a relative path name.
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
Available only in \fI\%MongoDB Enterprise\fP\&.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \-\-auditFilter
New in version 2.6.

.sp
Specifies the filter to limit the types of operations the audit system records. The option takes a string representation
of a query document of the form:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
{ <field1>: <expression1>, ... }
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The \fB<field>\fP can be any field in the audit message, including fields returned in the
param document. The
\fB<expression>\fP is a query condition expression\&.
.sp
To specify an audit filter, enclose the filter document in single
quotes to pass the document as a string.
.sp
To specify the audit filter in a configuration file, you must use the YAML format of
the configuration file.
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
Available only in \fI\%MongoDB Enterprise\fP\&.
.UNINDENT
.UNINDENT
.UNINDENT
.SS Profiler Options
.sp
New in version 4.0.

.INDENT 0.0
.TP
.B \-\-slowms <integer>
\fIDefault\fP: 100
.sp
The \fIslow\fP operation time threshold, in milliseconds. Operations
that run for longer than this threshold are considered \fIslow\fP\&.
.sp
When \fBlogLevel\fP is set to \fB0\fP, MongoDB
records \fIslow\fP operations to the diagnostic log at a rate determined by
\fBslowOpSampleRate\fP\&. At higher
\fBlogLevel\fP settings, all operations appear in the diagnostic
log regardless of their latency.
.sp
For \fI\%mongos\fP instances,  affects the diagnostic
log only and not the profiler since profiling is not available on
\fI\%mongos\fP\&.
.sp
New in version 4.0.

.UNINDENT
.INDENT 0.0
.TP
.B \-\-slowOpSampleRate <double>
\fIDefault\fP: 1.0
.sp
The fraction of \fIslow\fP operations that should be logged.
\fI\%\-\-slowOpSampleRate\fP accepts values between 0 and 1, inclusive.
.sp
For \fI\%mongos\fP instances, \fI\%\-\-slowOpSampleRate\fP affects the diagnostic log
only and not the profiler since profiling is not available on
\fI\%mongos\fP\&.
.sp
New in version 4.0.

.UNINDENT
.SS Text Search Options
.INDENT 0.0
.TP
.B \-\-basisTechRootDirectory <path>
New in version 3.2.

.sp
Specify the root directory of the Basis Technology Rosette
Linguistics Platform installation to support additional languages for
text search operations.
.INDENT 7.0
.INDENT 3.5
.IP "Enterprise Feature"
.sp
Available in MongoDB Enterprise only.
.UNINDENT
.UNINDENT
.UNINDENT
.SS LDAP Authentication and Authorization Options
.INDENT 0.0
.TP
.B \-\-ldapServers <host1>:<port>,<host2>:<port>,...,<hostN>:<port>
New in version 3.4: Available in MongoDB Enterprise only.

.sp
The LDAP server against which the \fBmongos\fP executes LDAP operations
against to authenticate users or determine what actions a user is authorized
to perform on a given database. If the LDAP server specified has any
replicated instances, you may specify the host and port of each replicated
server in a comma\-delimited list.
.sp
If your LDAP infrastrucure partitions the LDAP directory over multiple LDAP
servers, specify \fIone\fP LDAP server any of its replicated instances to
\fI\%\-\-ldapServers\fP\&. MongoDB supports following LDAP referrals as defined in \fI\%RFC 4511
4.1.10\fP\&. Do not use \fI\%\-\-ldapServers\fP
for listing every LDAP server in your infrastucture.
.sp
This setting can be configured on a running \fBmongos\fP using
\fBsetParameter\fP\&.
.sp
If unset, \fBmongos\fP cannot use LDAP authentication or authorization\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-ldapQueryUser <string>
New in version 3.4: Available in MongoDB Enterprise only.

.sp
The identity with which \fBmongos\fP binds as, when connecting to or
performing queries on an LDAP server.
.sp
Only required if any of the following are true:
.INDENT 7.0
.IP \(bu 2
Using LDAP authorization\&.
.IP \(bu 2
Using an LDAP query for \fI\%username transformation\fP\&.
.IP \(bu 2
The LDAP server disallows anonymous binds
.UNINDENT
.sp
You must use \fI\%\-\-ldapQueryUser\fP with \fI\%\-\-ldapQueryPassword\fP\&.
.sp
If unset, \fBmongos\fP will not attempt to bind to the LDAP server.
.sp
This setting can be configured on a running \fBmongos\fP using
\fBsetParameter\fP\&.
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
Windows MongoDB deployments can use \fI\%\-\-ldapBindWithOSDefaults\fP
instead of \fI\%\-\-ldapQueryUser\fP and \fI\%\-\-ldapQueryPassword\fP\&. You cannot specify
both \fI\%\-\-ldapQueryUser\fP and \fI\%\-\-ldapBindWithOSDefaults\fP at the same time.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \-\-ldapQueryPassword <string>
New in version 3.4: Available in MongoDB Enterprise only.
.sp
The password used to bind to an LDAP server when using
\fI\%\-\-ldapQueryUser\fP\&. You must use \fI\%\-\-ldapQueryPassword\fP with
\fI\%\-\-ldapQueryUser\fP\&.

.sp
If unset, \fBmongos\fP will not attempt to bind to the LDAP server.
.sp
This setting can be configured on a running \fBmongos\fP using
\fBsetParameter\fP\&.
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
Windows MongoDB deployments can use \fI\%\-\-ldapBindWithOSDefaults\fP
instead of \fI\%\-\-ldapQueryPassword\fP and \fI\%\-\-ldapQueryPassword\fP\&. You cannot specify
both \fI\%\-\-ldapQueryPassword\fP and \fI\%\-\-ldapBindWithOSDefaults\fP at the same time.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \-\-ldapBindWithOSDefaults <bool>
\fIDefault\fP: False
.sp
New in version 3.4: Available in MongoDB Enterprise for the Windows platform only.

.sp
Allows \fBmongos\fP to authenticate, or bind, using your Windows login
credentials when connecting to the LDAP server.
.sp
Only required if:
.INDENT 7.0
.IP \(bu 2
Using LDAP authorization\&.
.IP \(bu 2
Using an LDAP query for \fI\%username transformation\fP\&.
.IP \(bu 2
The LDAP server disallows anonymous binds
.UNINDENT
.sp
Use \fI\%\-\-ldapBindWithOSDefaults\fP to replace \fI\%\-\-ldapQueryUser\fP and
\fI\%\-\-ldapQueryPassword\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-ldapBindMethod <string>
\fIDefault\fP: simple
.sp
New in version 3.4: Available in MongoDB Enterprise only.

.sp
The method \fBmongos\fP uses to authenticate to an LDAP server.
Use with \fI\%\-\-ldapQueryUser\fP and \fI\%\-\-ldapQueryPassword\fP to
connect to the LDAP server.
.sp
\fI\%\-\-ldapBindMethod\fP supports the following values:
.INDENT 7.0
.IP \(bu 2
\fBsimple\fP \- \fBmongos\fP uses simple authentication.
.IP \(bu 2
\fBsasl\fP \- \fBmongos\fP uses SASL protocol for authentication
.UNINDENT
.sp
If you specify \fBsasl\fP, you can configure the available SASL mechanisms
using \fI\%\-\-ldapBindSASLMechanisms\fP\&. \fBmongos\fP defaults to
using \fBDIGEST\-MD5\fP mechanism.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-ldapBindSASLMechanisms <string>
\fIDefault\fP: DIGEST\-MD5
.sp
New in version 3.4: Available in MongoDB Enterprise only.

.sp
A comma\-separated list of SASL mechanisms \fBmongos\fP can
use when authenticating to the LDAP server. The \fBmongos\fP and the
LDAP server must agree on at least one mechanism. The \fBmongos\fP
dynamically loads any SASL mechanism libraries installed on the host
machine at runtime.
.sp
Install and configure the appropriate libraries for the selected
SASL mechanism(s) on both the \fBmongos\fP host and the remote
LDAP server host. Your operating system may include certain SASL
libraries by default. Defer to the documentation associated with each
SASL mechanism for guidance on installation and configuration.
.sp
If using the \fBGSSAPI\fP SASL mechanism for use with
security\-kerberos, verify the following for the
\fBmongos\fP host machine:
.INDENT 7.0
.TP
.B \fBLinux\fP
.INDENT 7.0
.IP \(bu 2
The \fBKRB5_CLIENT_KTNAME\fP environment
variable resolves to the name of the client keytab\-files
for the host machine. For more on Kerberos environment
variables, please defer to the
\fI\%Kerberos documentation\fP\&.
.IP \(bu 2
The client keytab includes a
kerberos\-user\-principal for the \fBmongos\fP to use when
connecting to the LDAP server and execute LDAP queries.
.UNINDENT
.TP
.B \fBWindows\fP
If connecting to an Active Directory server, the Windows
Kerberos configuration automatically generates a
\fI\%Ticket\-Granting\-Ticket\fP
when the user logs onto the system. Set \fI\%\-\-ldapBindWithOSDefaults\fP to
\fBtrue\fP to allow \fBmongos\fP to use the generated credentials when
connecting to the Active Directory server and execute queries.
.UNINDENT
.sp
Set \fI\%\-\-ldapBindMethod\fP to \fBsasl\fP to use this option.
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
For a complete list of SASL mechanisms see the
\fI\%IANA listing\fP\&.
Defer to the documentation for your LDAP or Active Directory
service for identifying the SASL mechanisms compatible with the
service.
.sp
MongoDB is not a source of SASL mechanism libraries, nor
is the MongoDB documentation a definitive source for
installing or configuring any given SASL mechanism. For
documentation and support, defer to the SASL mechanism
library vendor or owner.
.sp
For more information on SASL, defer to the following resources:
.INDENT 0.0
.IP \(bu 2
For Linux, please see the \fI\%Cyrus SASL documentation\fP\&.
.IP \(bu 2
For Windows, please see the \fI\%Windows SASL documentation\fP\&.
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \-\-ldapTransportSecurity <string>
\fIDefault\fP: tls
.sp
New in version 3.4: Available in MongoDB Enterprise only.

.sp
By default, \fBmongos\fP creates a TLS/SSL secured connection to the LDAP
server.
.sp
For Linux deployments, you must configure the appropriate TLS Options in
\fB/etc/openldap/ldap.conf\fP file. Your operating system’s package manager
creates this file as part of the MongoDB Enterprise installation, via the
\fBlibldap\fP dependency. See the documentation for \fBTLS Options\fP in the
\fI\%ldap.conf OpenLDAP documentation\fP
for more complete instructions.
.sp
For Windows deployment, you must add the LDAP server CA certificates to the
Windows certificate management tool. The exact name and functionality of the
tool may vary depending on operating system version. Please see the
documentation for your version of Windows for more information on
certificate management.
.sp
Set \fI\%\-\-ldapTransportSecurity\fP to \fBnone\fP to disable TLS/SSL between \fBmongos\fP and the LDAP
server.
.sp
\fBWARNING:\fP
.INDENT 7.0
.INDENT 3.5
Setting \fI\%\-\-ldapTransportSecurity\fP to \fBnone\fP transmits plaintext information and possibly
credentials between \fBmongos\fP and the LDAP server.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \-\-ldapTimeoutMS <long>
\fIDefault\fP: 10000
.sp
New in version 3.4: Available in MongoDB Enterprise only.

.sp
The amount of time in milliseconds \fBmongos\fP should wait for an LDAP server
to respond to a request.
.sp
Increasing the value of \fI\%\-\-ldapTimeoutMS\fP may prevent connection failure between the
MongoDB server and the LDAP server, if the source of the failure is a
connection timeout. Decreasing the value of \fI\%\-\-ldapTimeoutMS\fP reduces the time
MongoDB waits for a response from the LDAP server.
.sp
This setting can be configured on a running \fBmongos\fP using
\fBsetParameter\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-ldapUserToDNMapping <string>
New in version 3.4: Available in MongoDB Enterprise only.

.sp
Maps the username provided to \fBmongos\fP for authentication to a LDAP
Distinguished Name (DN). You may need to use \fI\%\-\-ldapUserToDNMapping\fP to transform a
username into an LDAP DN in the following scenarios:
.INDENT 7.0
.IP \(bu 2
Performing LDAP authentication with simple LDAP binding, where users
authenticate to MongoDB with usernames that are not full LDAP DNs.
.IP \(bu 2
Using an \fBLDAP authorization query template\fP that requires a DN.
.IP \(bu 2
Transforming the usernames of clients authenticating to Mongo DB using
different authentication mechanisms (e.g. x.509, kerberos) to a full LDAP
DN for authorization.
.UNINDENT
.sp
\fI\%\-\-ldapUserToDNMapping\fP expects a quote\-enclosed JSON\-string representing an ordered array
of documents. Each document contains a regular expression \fBmatch\fP and
either a \fBsubstitution\fP or \fBldapQuery\fP template used for transforming the
incoming username.
.sp
Each document in the array has the following form:
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
{
  match: "<regex>"
  substitution: "<LDAP DN>" | ldapQuery: "<LDAP Query>"
}
.ft P
.fi
.UNINDENT
.UNINDENT
.TS
center;
|l|l|l|.
_
T{
Field
T}	T{
Description
T}	T{
Example
T}
_
T{
\fBmatch\fP
T}	T{
An ECMAScript\-formatted regular expression (regex) to match against a
provided username. Each parenthesis\-enclosed section represents a
regex capture group used by \fBsubstitution\fP or \fBldapQuery\fP\&.
T}	T{
\fB"(.+)ENGINEERING"\fP
\fB"(.+)DBA"\fP
T}
_
T{
\fBsubstitution\fP
T}	T{
An LDAP distinguished name (DN) formatting template that converts the
authentication name matched by the \fBmatch\fP regex into a LDAP DN.
Each curly bracket\-enclosed numeric value is replaced by the
corresponding \fI\%regex capture group\fP extracted
from the authentication username via the \fBmatch\fP regex.
T}	T{
\fB"cn={0},ou=engineering,
dc=example,dc=com"\fP
T}
_
T{
\fBldapQuery\fP
T}	T{
A LDAP query formatting template that inserts the authentication
name matched by the \fBmatch\fP regex into an LDAP query URI encoded
respecting RFC4515 and RFC4516. Each curly bracket\-enclosed numeric
value is replaced by the corresponding \fI\%regex capture group\fP extracted
from the authentication username via the \fBmatch\fP expression.
\fBmongos\fP executes the query against the LDAP server to retrieve
the LDAP DN for the authenticated user. \fBmongos\fP requires
exactly one returned result for the transformation to be
successful, or \fBmongos\fP skips this transformation.
T}	T{
\fB"ou=engineering,dc=example,
dc=com??one?(user={0})"\fP
T}
_
.TE
.sp
For each document in the array, you must use either \fBsubstitution\fP or
\fBldapQuery\fP\&. You \fIcannot\fP specify both in the same document.
.sp
When performing authentication or authorization, \fBmongos\fP steps through
each document in the array in the given order, checking the authentication
username against the \fBmatch\fP filter.  If a match is found,
\fBmongos\fP applies the transformation and uses the output for
authenticating the user. \fBmongos\fP does not check the remaining documents
in the array.
.sp
If the given document does not match the provided authentication name, or
the transformation described by the document fails, \fBmongos\fP continues
through the list of documents to find additional matches. If no matches are
found in any document, \fBmongos\fP returns an error.
.INDENT 7.0
.INDENT 3.5
.SS Example
.sp
The following shows two transformation documents. The first
document matches against any string ending in \fB@ENGINEERING\fP, placing
anything preceeding the suffix into a regex capture group. The
second document matches against any string ending in \fB@DBA\fP, placing
anything preceeding the suffix into a regex capture group.
.sp
\fBIMPORTANT:\fP
.INDENT 0.0
.INDENT 3.5
You must pass the array to \fI\%\-\-ldapUserToDNMapping\fP as a string.
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
"[
   {
      match: "(.+)@ENGINEERING.EXAMPLE.COM",
      substitution: "cn={0},ou=engineering,dc=example,dc=com"
   },
   {
      match: "(.+)@DBA.EXAMPLE.COM",
      ldapQuery: "ou=dba,dc=example,dc=com??one?(user={0})"

   }

]"
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
A user with username \fBalice@ENGINEERING.EXAMPLE.COM\fP matches the first
document. The regex capture group \fB{0}\fP corresponds to the string
\fBalice\fP\&. The resulting output is the DN
\fB"cn=alice,ou=engineering,dc=example,dc=com"\fP\&.
.sp
A user with username \fBbob@DBA.EXAMPLE.COM\fP matches the second document.
The regex capture group \fB{0}\fP corresponds to the string \fBbob\fP\&.  The
resulting output is the LDAP query
\fB"ou=dba,dc=example,dc=com??one?(user=bob)"\fP\&. \fBmongos\fP executes this
query against the LDAP server, returning the result
\fB"cn=bob,ou=dba,dc=example,dc=com"\fP\&.
.UNINDENT
.UNINDENT
.sp
If \fI\%\-\-ldapUserToDNMapping\fP is unset, \fBmongos\fP applies no transformations to the username
when attempting to authenticate or authorize a user against the LDAP server.
.sp
This setting can be configured on a running \fBmongos\fP using the
\fBsetParameter\fP database command.
.sp
\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
An explanation of \fI\%RFC4515\fP,
\fI\%RFC4516\fP or LDAP queries is out
of scope for the MongoDB Documentation. Please review the RFC directly or
use your preferred LDAP resource.
.UNINDENT
.UNINDENT
.UNINDENT
.SS Additional Options
.INDENT 0.0
.TP
.B \-\-ipv6
Enables IPv6 support. \fBmongos\fP disables IPv6 support by default.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-noscripting
Disables the scripting engine.
.UNINDENT
.SH AUTHOR
MongoDB Documentation Project
.SH COPYRIGHT
2008-2018
.\" Generated by docutils manpage writer.
.