.\" Man page generated from reStructuredText. . .TH "MONGOS" "1" "January 30, 2015" "3.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 .. .SH SYNOPSIS .sp \fBmongos\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 \fIsharded cluster\fP, in order to complete these operations. From the perspective of the application, a \fBmongos\fP instance behaves identically to any other MongoDB instance. .SH CONSIDERATIONS .sp Never change the name of the \fBmongos\fP binary. .SH OPTIONS .SS Core Options .INDENT 0.0 .TP .B mongos .UNINDENT .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 , \-f 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 http://docs.mongodb.org/manual/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 the \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 \fIdatabase commands\fP .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 \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 \fIDefault\fP: All interfaces. .sp Changed in version 2.6.0: The \fBdeb\fP and \fBrpm\fP packages include a default configuration file that sets \fI\%\-\-bind_ip\fP to \fB127.0.0.1\fP\&. .sp Specifies the IP address that \fBmongos\fP binds to in order to listen for connections from applications. You may attach \fBmongos\fP to any interface. 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. .UNINDENT .INDENT 0.0 .TP .B \-\-maxConns Specifies the maximum number of simultaneous connections that \fBmongos\fP will accept. This setting will have no effect if the value of this setting is higher than your operating system\(aqs configured maximum connection tracking threshold. .sp This setting is particularly useful for \fBmongos\fP if you have a client that creates a number of connections but allows them to timeout rather than close the connections. When you set \fBmaxIncomingConnections\fP, ensure the value is slightly higher than the size of the connection pool or the total number of connections to prevent erroneous connection spikes from propagating to the members of a \fIsharded cluster\fP\&. .sp Changed in version 2.6: MongoDB removed the upward limit on the \fBmaxIncomingConnections\fP setting. .UNINDENT .INDENT 0.0 .TP .B \-\-syslog Sends all logging output to the host\(aqs \fIsyslog\fP 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. .UNINDENT .INDENT 0.0 .TP .B \-\-syslogFacility \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\(aqs implementation of syslog. To use this option, you must enable the \fI\%\-\-syslog\fP option. .UNINDENT .INDENT 0.0 .TP .B \-\-logpath Sends all diagnostic logging information to a log file instead of to standard output or to the host\(aqs \fIsyslog\fP system. MongoDB creates the log file at the path you specify. .sp By default, MongoDB overwrites the log file when the process restarts. 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 log file rather than overwriting the content of the log when the \fBmongos\fP instance restarts. .UNINDENT .INDENT 0.0 .TP .B \-\-timeStampFormat \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 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 Specifies the path to a key file that stores the shared secret that MongoDB instances use to authenticate to each other in a \fIsharded cluster\fP or \fIreplica set\fP\&. \fI\%\-\-keyFile\fP implies \fI\-\-auth\fP\&. See \fIinter\-process\-auth\fP for more information. .UNINDENT .INDENT 0.0 .TP .B \-\-setParameter Specifies one of the MongoDB parameters described in http://docs.mongodb.org/manual/reference/parameters\&. You can specify multiple \fBsetParameter\fP fields. .UNINDENT .INDENT 0.0 .TP .B \-\-httpinterface New in version 2.6. .sp Enables the HTTP interface. Enabling the interface can increase network exposure. .sp Leave the HTTP interface \fIdisabled\fP for production deployments. If you \fIdo\fP enable this interface, you should only allow trusted clients to access this port. See \fIsecurity\-firewalls\fP\&. .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 In MongoDB Enterprise, the HTTP Console does not support Kerberos Authentication. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \-\-nounixsocket Disables listening on the UNIX domain socket. 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 \fBbindIp\fP is not set .IP \(bu 2 \fBbindIp\fP does not specify \fB127.0.0.1\fP .UNINDENT .sp New in version 2.6: \fBmongos\fP installed from official \fB\&.deb\fP and \fB\&.rpm\fP packages have the \fBbind_ip\fP configuration set to \fB127.0.0.1\fP by default. .UNINDENT .INDENT 0.0 .TP .B \-\-unixSocketPrefix \fIDefault\fP: /tmp .sp The path for the UNIX socket. 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 \fI\%\-\-nounixsocket\fP is set .IP \(bu 2 \fBbindIp\fP is not set .IP \(bu 2 \fBbindIp\fP does not specify \fB127.0.0.1\fP .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \-\-fork Enables a \fIdaemon\fP 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 .SS Sharded Cluster Options .INDENT 0.0 .TP .B \-\-configdb ,, Specifies the \fIconfiguration database\fP for the \fIsharded cluster\fP\&. You must specify either 1 or 3 configuration servers, in a comma separated list. \fBAlways\fP use 3 config servers in production environments. .sp All \fBmongos\fP instances \fBmust\fP specify the exact same value for \fI\%\-\-configdb\fP .sp If your configuration databases reside in more that one data center, order the hosts so that first config sever in the list is the closest to the majority of your \fBmongos\fP instances. .sp \fBWARNING:\fP .INDENT 7.0 .INDENT 3.5 Never remove a config server from this setting, even if the config server is not available or offline. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \-\-localThreshold \fIDefault\fP: 15 .sp Affects the logic that \fBmongos\fP uses when selecting \fIreplica set\fP members to pass read operations from clients. Specify a value in milliseconds. The default value of \fB15\fP corresponds to the default value in all of the client \fBdrivers\fP\&. .sp When \fBmongos\fP receives a request that permits reads to \fIsecondary\fP members, the \fBmongos\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, \fBmongos\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 \fBmongos\fP recalculates the average. .sp See the \fIreplica\-set\-read\-preference\-behavior\-member\-selection\fP section of the \fBread preference\fP documentation for more information. .UNINDENT .INDENT 0.0 .TP .B \-\-upgrade Updates the meta data format used by the \fIconfig database\fP\&. .UNINDENT .INDENT 0.0 .TP .B \-\-chunkSize \fIDefault\fP: 64 .sp Determines the size in megabytes of each \fIchunk\fP in the \fIsharded cluster\fP\&. A size of 64 megabytes is ideal in most deployments: larger chunk size can lead to uneven data distribution; smaller chunk size can lead to inefficient movement of chunks between nodes. .sp This option affects chunk size \fIonly\fP when you initialize the cluster for the first time. If you later modify the option, the new value has no effect. See the http://docs.mongodb.org/manual/tutorial/modify\-chunk\-size\-in\-sharded\-cluster procedure if you need to change the chunk size on an existing sharded cluster. .UNINDENT .INDENT 0.0 .TP .B \-\-noAutoSplit Prevents \fBmongos\fP from automatically inserting metadata splits in a \fIsharded collection\fP\&. If set on all \fBmongos\fP instances, this prevents MongoDB from creating new chunks as the data in a collection grows. .sp Because any \fBmongos\fP in a cluster can create a split, to totally disable splitting in a cluster you must set \fI\%\-\-noAutoSplit\fP on all \fBmongos\fP\&. .sp \fBWARNING:\fP .INDENT 7.0 .INDENT 3.5 With \fI\%\-\-noAutoSplit\fP enabled, the data in your sharded cluster may become imbalanced over time. Enable with caution. .UNINDENT .UNINDENT .UNINDENT .SS SSL Options .INDENT 0.0 .INDENT 3.5 .SS See .sp http://docs.mongodb.org/manual/tutorial/configure\-ssl for full documentation of MongoDB\(aqs support. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \-\-sslOnNormalPorts Deprecated since version 2.6. .sp Enables SSL for \fBmongos\fP\&. .sp With \fI\%\-\-sslOnNormalPorts\fP, a \fBmongos\fP requires 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 The default distribution of MongoDB does not contain support for SSL. For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&. .UNINDENT .INDENT 0.0 .TP .B \-\-sslMode New in version 2.6. .sp Enables SSL or mixed 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 SSL. T} _ T{ \fBallowSSL\fP T} T{ Connections between servers do not use SSL. For incoming connections, the server accepts both SSL and non\-SSL. T} _ T{ \fBpreferSSL\fP T} T{ Connections between servers use SSL. For incoming connections, the server accepts both SSL and non\-SSL. T} _ T{ \fBrequireSSL\fP T} T{ The server uses and accepts only SSL encrypted connections. T} _ .TE .sp The default distribution of MongoDB does not contain support for SSL. For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&. .UNINDENT .INDENT 0.0 .TP .B \-\-sslPEMKeyFile New in version 2.2. .sp Specifies the \fB\&.pem\fP file that contains both the SSL certificate and key. Specify the file name of the \fB\&.pem\fP file using relative or absolute paths. .sp When SSL is enabled, you must specify \fI\-\-sslPEMKeyFile\fP\&. .sp The default distribution of MongoDB does not contain support for SSL. For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&. .UNINDENT .INDENT 0.0 .TP .B \-\-sslPEMKeyPassword New in version 2.2. .sp Specifies the password to de\-crypt the certificate\-key file (i.e. \fB\-\-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 \fIssl\-certificate\-password\fP\&. .sp The default distribution of MongoDB does not contain support for SSL. For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&. .UNINDENT .INDENT 0.0 .TP .B \-\-clusterAuthMode