|
|
334bcc |
.\" Man page generated from reStructuredText.
|
|
|
334bcc |
.
|
|
|
334bcc |
.TH "MONGOSTAT" "1" "January 30, 2015" "3.0" "mongodb-manual"
|
|
|
334bcc |
.SH NAME
|
|
|
334bcc |
mongostat \- MongoDB Use Statistics
|
|
|
334bcc |
.
|
|
|
334bcc |
.nr rst2man-indent-level 0
|
|
|
334bcc |
.
|
|
|
334bcc |
.de1 rstReportMargin
|
|
|
334bcc |
\\$1 \\n[an-margin]
|
|
|
334bcc |
level \\n[rst2man-indent-level]
|
|
|
334bcc |
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
|
|
334bcc |
-
|
|
|
334bcc |
\\n[rst2man-indent0]
|
|
|
334bcc |
\\n[rst2man-indent1]
|
|
|
334bcc |
\\n[rst2man-indent2]
|
|
|
334bcc |
..
|
|
|
334bcc |
.de1 INDENT
|
|
|
334bcc |
.\" .rstReportMargin pre:
|
|
|
334bcc |
. RS \\$1
|
|
|
334bcc |
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
|
|
|
334bcc |
. nr rst2man-indent-level +1
|
|
|
334bcc |
.\" .rstReportMargin post:
|
|
|
334bcc |
..
|
|
|
334bcc |
.de UNINDENT
|
|
|
334bcc |
. RE
|
|
|
334bcc |
.\" indent \\n[an-margin]
|
|
|
334bcc |
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
|
|
334bcc |
.nr rst2man-indent-level -1
|
|
|
334bcc |
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
|
|
334bcc |
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
|
|
|
334bcc |
..
|
|
|
334bcc |
.SH SYNOPSIS
|
|
|
334bcc |
.sp
|
|
|
334bcc |
The \fBmongostat\fP utility provides a quick overview of the
|
|
|
334bcc |
status of a currently running \fBmongod\fP
|
|
|
334bcc |
or \fBmongos\fP
|
|
|
334bcc |
instance. \fBmongostat\fP is functionally similar to the
|
|
|
334bcc |
UNIX/Linux file system utility \fBvmstat\fP, but provides data regarding
|
|
|
334bcc |
\fBmongod\fP and \fBmongos\fP instances.
|
|
|
334bcc |
.sp
|
|
|
334bcc |
\fBSEE ALSO:\fP
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.INDENT 3.5
|
|
|
334bcc |
For more information about monitoring MongoDB, see
|
|
|
334bcc |
http://docs.mongodb.org/manual/administration/monitoring\&.
|
|
|
334bcc |
.sp
|
|
|
334bcc |
For more background on various other MongoDB status outputs see:
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.IP \(bu 2
|
|
|
334bcc |
http://docs.mongodb.org/manual/reference/command/serverStatus
|
|
|
334bcc |
.IP \(bu 2
|
|
|
334bcc |
http://docs.mongodb.org/manual/reference/command/replSetGetStatus
|
|
|
334bcc |
.IP \(bu 2
|
|
|
334bcc |
http://docs.mongodb.org/manual/reference/command/dbStats
|
|
|
334bcc |
.IP \(bu 2
|
|
|
334bcc |
http://docs.mongodb.org/manual/reference/command/collStats
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.sp
|
|
|
334bcc |
For an additional utility that provides MongoDB metrics see
|
|
|
334bcc |
\fBmongotop\fP\&.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.SH ACCESS CONTROL REQUIREMENTS
|
|
|
334bcc |
.sp
|
|
|
334bcc |
In order to connect to a \fBmongod\fP that enforces authorization
|
|
|
334bcc |
with the \fI\-\-auth\fP option, specify the
|
|
|
334bcc |
\fI\-\-username\fP and \fI\-\-password\fP options, and the user specified must have the
|
|
|
334bcc |
\fBserverStatus\fP privilege action on the cluster resources.
|
|
|
334bcc |
.sp
|
|
|
334bcc |
The built\-in role \fBclusterMonitor\fP provides this privilege as
|
|
|
334bcc |
well as other privileges. To create a role with just the privilege to
|
|
|
334bcc |
run \fBmongostat\fP, see \fIcreate\-role\-for\-mongostat\fP\&.
|
|
|
334bcc |
.SH OPTIONS
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B mongostat
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B mongostat
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B \-\-help
|
|
|
334bcc |
Returns information on the options and use of \fBmongostat\fP\&.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B \-\-verbose, \-v
|
|
|
334bcc |
Increases the amount of internal reporting returned on standard output
|
|
|
334bcc |
or in log files. Increase the verbosity with the \fB\-v\fP form by
|
|
|
334bcc |
including the option multiple times, (e.g. \fB\-vvvvv\fP\&.)
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B \-\-version
|
|
|
334bcc |
Returns the \fBmongostat\fP release number.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B \-\-host <hostname><:port>, \-h <hostname><:port>
|
|
|
334bcc |
\fIDefault\fP: localhost:27017
|
|
|
334bcc |
.sp
|
|
|
334bcc |
Specifies a resolvable hostname for the \fBmongod\fP to which to
|
|
|
334bcc |
connect. By default, the \fBmongostat\fP attempts to connect to a MongoDB
|
|
|
334bcc |
instance running on the localhost on port number \fB27017\fP\&.
|
|
|
334bcc |
.sp
|
|
|
334bcc |
To connect to a replica set, specify the
|
|
|
334bcc |
\fBreplSetName\fP and a seed list of set members, as in
|
|
|
334bcc |
the following:
|
|
|
334bcc |
.INDENT 7.0
|
|
|
334bcc |
.INDENT 3.5
|
|
|
334bcc |
.sp
|
|
|
334bcc |
.nf
|
|
|
334bcc |
.ft C
|
|
|
334bcc |
<replSetName>/<hostname1><:port>,<hostname2><:port>,<...>
|
|
|
334bcc |
.ft P
|
|
|
334bcc |
.fi
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.sp
|
|
|
334bcc |
You can always connect directly to a single MongoDB instance by
|
|
|
334bcc |
specifying the host and port number directly.
|
|
|
334bcc |
.sp
|
|
|
334bcc |
Changed in version 3.0.0: If you use IPv6 and use the \fB<address>:<port>\fP format, you must
|
|
|
334bcc |
enclose the portion of an address and port combination in
|
|
|
334bcc |
brackets (e.g. \fB[<address>]\fP).
|
|
|
334bcc |
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B \-\-port <port>
|
|
|
334bcc |
\fIDefault\fP: 27017
|
|
|
334bcc |
.sp
|
|
|
334bcc |
Specifies the TCP port on which the MongoDB instance listens for
|
|
|
334bcc |
client connections.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B \-\-ipv6
|
|
|
334bcc |
Enables IPv6 support and allows the \fBmongostat\fP to connect to the
|
|
|
334bcc |
MongoDB instance using an IPv6 network. All MongoDB programs and
|
|
|
334bcc |
processes disable IPv6 support by default.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B \-\-ssl
|
|
|
334bcc |
New in version 2.6.
|
|
|
334bcc |
|
|
|
334bcc |
.sp
|
|
|
334bcc |
Enables connection to a \fBmongod\fP or \fBmongos\fP that has
|
|
|
334bcc |
SSL support enabled.
|
|
|
334bcc |
.sp
|
|
|
334bcc |
The default distribution of MongoDB does not contain support for SSL.
|
|
|
334bcc |
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B \-\-sslCAFile <filename>
|
|
|
334bcc |
New in version 2.6.
|
|
|
334bcc |
|
|
|
334bcc |
.sp
|
|
|
334bcc |
Specifies the \fB\&.pem\fP file that contains the root certificate chain
|
|
|
334bcc |
from the Certificate Authority. Specify the file name of the
|
|
|
334bcc |
\fB\&.pem\fP file using relative or absolute paths.
|
|
|
334bcc |
.sp
|
|
|
334bcc |
The default distribution of MongoDB does not contain support for SSL.
|
|
|
334bcc |
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
|
|
334bcc |
.sp
|
|
|
334bcc |
\fBWARNING:\fP
|
|
|
334bcc |
.INDENT 7.0
|
|
|
334bcc |
.INDENT 3.5
|
|
|
334bcc |
If the \fBmongo\fP shell or any other tool that connects to
|
|
|
334bcc |
\fBmongos\fP or \fBmongod\fP is run without
|
|
|
334bcc |
\fI\-\-sslCAFile\fP, it will not attempt to validate
|
|
|
334bcc |
server certificates. This results in vulnerability to expired
|
|
|
334bcc |
\fBmongod\fP and \fBmongos\fP certificates as well as to foreign
|
|
|
334bcc |
processes posing as valid \fBmongod\fP or \fBmongos\fP
|
|
|
334bcc |
instances. Ensure that you \fIalways\fP specify the CA file against which
|
|
|
334bcc |
server certificates should be validated in cases where intrusion is a
|
|
|
334bcc |
possibility.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B \-\-sslPEMKeyFile <filename>
|
|
|
334bcc |
New in version 2.6.
|
|
|
334bcc |
|
|
|
334bcc |
.sp
|
|
|
334bcc |
Specifies the \fB\&.pem\fP file that contains both the SSL certificate
|
|
|
334bcc |
and key. Specify the file name of the \fB\&.pem\fP file using relative
|
|
|
334bcc |
or absolute paths.
|
|
|
334bcc |
.sp
|
|
|
334bcc |
This option is required when using the \fI\-\-ssl\fP option to connect
|
|
|
334bcc |
to a \fBmongod\fP or \fBmongos\fP that has
|
|
|
334bcc |
\fBCAFile\fP enabled \fIwithout\fP
|
|
|
334bcc |
\fBallowConnectionsWithoutCertificates\fP\&.
|
|
|
334bcc |
.sp
|
|
|
334bcc |
The default distribution of MongoDB does not contain support for SSL.
|
|
|
334bcc |
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B \-\-sslPEMKeyPassword <value>
|
|
|
334bcc |
New in version 2.6.
|
|
|
334bcc |
|
|
|
334bcc |
.sp
|
|
|
334bcc |
Specifies the password to de\-crypt the certificate\-key file (i.e.
|
|
|
334bcc |
\fI\-\-sslPEMKeyFile\fP). Use the \fI\-\-sslPEMKeyPassword\fP option only if the
|
|
|
334bcc |
certificate\-key file is encrypted. In all cases, the \fBmongostat\fP will
|
|
|
334bcc |
redact the password from all logging and reporting output.
|
|
|
334bcc |
.sp
|
|
|
334bcc |
If the private key in the PEM file is encrypted and you do not specify
|
|
|
334bcc |
the \fI\-\-sslPEMKeyPassword\fP option, the \fBmongostat\fP will prompt for a passphrase. See
|
|
|
334bcc |
\fIssl\-certificate\-password\fP\&.
|
|
|
334bcc |
.sp
|
|
|
334bcc |
The default distribution of MongoDB does not contain support for SSL.
|
|
|
334bcc |
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B \-\-sslCRLFile <filename>
|
|
|
334bcc |
New in version 2.6.
|
|
|
334bcc |
|
|
|
334bcc |
.sp
|
|
|
334bcc |
Specifies the \fB\&.pem\fP file that contains the Certificate Revocation
|
|
|
334bcc |
List. Specify the file name of the \fB\&.pem\fP file using relative or
|
|
|
334bcc |
absolute paths.
|
|
|
334bcc |
.sp
|
|
|
334bcc |
The default distribution of MongoDB does not contain support for SSL.
|
|
|
334bcc |
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B \-\-sslAllowInvalidCertificates
|
|
|
334bcc |
New in version 2.6.
|
|
|
334bcc |
|
|
|
334bcc |
.sp
|
|
|
334bcc |
Bypasses the validation checks for server certificates and allows
|
|
|
334bcc |
the use of invalid certificates. When using the
|
|
|
334bcc |
\fBallowInvalidCertificates\fP setting, MongoDB logs as a
|
|
|
334bcc |
warning the use of the invalid certificate.
|
|
|
334bcc |
.sp
|
|
|
334bcc |
The default distribution of MongoDB does not contain support for SSL.
|
|
|
334bcc |
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B \-\-sslAllowInvalidHostnames
|
|
|
334bcc |
New in version 3.0.
|
|
|
334bcc |
|
|
|
334bcc |
.sp
|
|
|
334bcc |
Disables the validation of the hostnames in SSL certificates. Allows
|
|
|
334bcc |
\fBmongostat\fP to connect to MongoDB instances if the hostname their
|
|
|
334bcc |
certificates do not match the specified hostname.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B \-\-sslFIPSMode
|
|
|
334bcc |
New in version 2.6.
|
|
|
334bcc |
|
|
|
334bcc |
.sp
|
|
|
334bcc |
Directs the \fBmongostat\fP to use the FIPS mode of the installed OpenSSL
|
|
|
334bcc |
library. Your system must have a FIPS compliant OpenSSL library to use
|
|
|
334bcc |
the \fI\-\-sslFIPSMode\fP option.
|
|
|
334bcc |
.sp
|
|
|
334bcc |
\fBNOTE:\fP
|
|
|
334bcc |
.INDENT 7.0
|
|
|
334bcc |
.INDENT 3.5
|
|
|
334bcc |
FIPS Compatible SSL is
|
|
|
334bcc |
available only in \fI\%MongoDB Enterprise\fP\&. See
|
|
|
334bcc |
http://docs.mongodb.org/manual/tutorial/configure\-fips for more information.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B \-\-username <username>, \-u <username>
|
|
|
334bcc |
Specifies a username with which to authenticate to a MongoDB database
|
|
|
334bcc |
that uses authentication. Use in conjunction with the \fB\-\-password\fP and
|
|
|
334bcc |
\fB\-\-authenticationDatabase\fP options.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B \-\-password <password>, \-p <password>
|
|
|
334bcc |
Specifies a password with which to authenticate to a MongoDB database
|
|
|
334bcc |
that uses authentication. Use in conjunction with the \fB\-\-username\fP and
|
|
|
334bcc |
\fB\-\-authenticationDatabase\fP options.
|
|
|
334bcc |
.sp
|
|
|
334bcc |
If you do not specify an argument for \fI\-\-password\fP, \fBmongostat\fP will
|
|
|
334bcc |
prompt interactively for a password on the console.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B \-\-authenticationDatabase <dbname>
|
|
|
334bcc |
New in version 2.4.
|
|
|
334bcc |
|
|
|
334bcc |
.sp
|
|
|
334bcc |
Specifies the database that holds the user\(aqs credentials.
|
|
|
334bcc |
.sp
|
|
|
334bcc |
\fI\-\-authenticationDatabase\fP is required for \fBmongod\fP
|
|
|
334bcc |
and \fBmongos\fP instances that use \fIauthentication\fP\&.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B \-\-authenticationMechanism <name>
|
|
|
334bcc |
\fIDefault\fP: MONGODB\-CR
|
|
|
334bcc |
.sp
|
|
|
334bcc |
New in version 2.4.
|
|
|
334bcc |
|
|
|
334bcc |
.sp
|
|
|
334bcc |
Changed in version 2.6: Added support for the \fBPLAIN\fP and \fBMONGODB\-X509\fP authentication
|
|
|
334bcc |
mechanisms.
|
|
|
334bcc |
|
|
|
334bcc |
.sp
|
|
|
334bcc |
Specifies the authentication mechanism the \fBmongostat\fP instance uses to
|
|
|
334bcc |
authenticate to the \fBmongod\fP or \fBmongos\fP\&.
|
|
|
334bcc |
.TS
|
|
|
334bcc |
center;
|
|
|
334bcc |
|l|l|.
|
|
|
334bcc |
_
|
|
|
334bcc |
T{
|
|
|
334bcc |
Value
|
|
|
334bcc |
T} T{
|
|
|
334bcc |
Description
|
|
|
334bcc |
T}
|
|
|
334bcc |
_
|
|
|
334bcc |
T{
|
|
|
334bcc |
MONGODB\-CR
|
|
|
334bcc |
T} T{
|
|
|
334bcc |
MongoDB challenge/response authentication.
|
|
|
334bcc |
T}
|
|
|
334bcc |
_
|
|
|
334bcc |
T{
|
|
|
334bcc |
MONGODB\-X509
|
|
|
334bcc |
T} T{
|
|
|
334bcc |
MongoDB SSL certificate authentication.
|
|
|
334bcc |
T}
|
|
|
334bcc |
_
|
|
|
334bcc |
T{
|
|
|
334bcc |
PLAIN
|
|
|
334bcc |
T} T{
|
|
|
334bcc |
External authentication using LDAP. You can also use \fBPLAIN\fP
|
|
|
334bcc |
for authenticating in\-database users. \fBPLAIN\fP transmits
|
|
|
334bcc |
passwords in plain text. This mechanism is available only in
|
|
|
334bcc |
\fI\%MongoDB Enterprise\fP\&.
|
|
|
334bcc |
T}
|
|
|
334bcc |
_
|
|
|
334bcc |
T{
|
|
|
334bcc |
GSSAPI
|
|
|
334bcc |
T} T{
|
|
|
334bcc |
External authentication using Kerberos. This mechanism is
|
|
|
334bcc |
available only in \fI\%MongoDB Enterprise\fP\&.
|
|
|
334bcc |
T}
|
|
|
334bcc |
_
|
|
|
334bcc |
.TE
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B \-\-gssapiServiceName
|
|
|
334bcc |
New in version 2.6.
|
|
|
334bcc |
|
|
|
334bcc |
.sp
|
|
|
334bcc |
Specify the name of the service using \fBGSSAPI/Kerberos\fP\&. Only required if the service does not use the
|
|
|
334bcc |
default name of \fBmongodb\fP\&.
|
|
|
334bcc |
.sp
|
|
|
334bcc |
This option is available only in MongoDB Enterprise.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B \-\-gssapiHostName
|
|
|
334bcc |
New in version 2.6.
|
|
|
334bcc |
|
|
|
334bcc |
.sp
|
|
|
334bcc |
Specify the hostname of a service using \fBGSSAPI/Kerberos\fP\&. \fIOnly\fP required if the hostname of a machine does
|
|
|
334bcc |
not match the hostname resolved by DNS.
|
|
|
334bcc |
.sp
|
|
|
334bcc |
This option is available only in MongoDB Enterprise.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B \-\-noheaders
|
|
|
334bcc |
Disables the output of column or field names.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B \-\-rowcount <number>, \-n <number>
|
|
|
334bcc |
Controls the number of rows to output. Use in conjunction with
|
|
|
334bcc |
the \fBsleeptime\fP argument to control the duration of a
|
|
|
334bcc |
\fBmongostat\fP operation.
|
|
|
334bcc |
.sp
|
|
|
334bcc |
Unless \fI\-\-rowcount\fP is specified, \fBmongostat\fP
|
|
|
334bcc |
will return an infinite number of rows (e.g. value of \fB0\fP\&.)
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B \-\-http
|
|
|
334bcc |
Configures \fBmongostat\fP to collect data using the HTTP interface
|
|
|
334bcc |
rather than a raw database connection.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B \-\-discover
|
|
|
334bcc |
Discovers and reports on statistics from all members of a \fIreplica
|
|
|
334bcc |
set\fP or \fIsharded cluster\fP\&. When connected to any member of a
|
|
|
334bcc |
replica set, \fI\%\-\-discover\fP all non\-\fIhidden members\fP of the replica set. When connected to a \fBmongos\fP,
|
|
|
334bcc |
\fBmongostat\fP will return data from all \fIshards\fP in
|
|
|
334bcc |
the cluster. If a replica set provides a shard in the sharded cluster,
|
|
|
334bcc |
\fBmongostat\fP will report on non\-hidden members of that replica
|
|
|
334bcc |
set.
|
|
|
334bcc |
.sp
|
|
|
334bcc |
The \fImongostat \-\-host\fP option is not required but
|
|
|
334bcc |
potentially useful in this case.
|
|
|
334bcc |
.sp
|
|
|
334bcc |
Changed in version 2.6: When running with \fI\%\-\-discover\fP, \fBmongostat\fP now
|
|
|
334bcc |
respects :option:\-\-rowcount\(ga.
|
|
|
334bcc |
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B \-\-all
|
|
|
334bcc |
Configures \fBmongostat\fP to return all optional \fI\%fields\fP\&.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B \-\-json
|
|
|
334bcc |
New in version 3.0.0.
|
|
|
334bcc |
|
|
|
334bcc |
.sp
|
|
|
334bcc |
Returns output for \fBmongostat\fP in \fIJSON\fP format.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B <sleeptime>
|
|
|
334bcc |
The final argument is the length of time, in seconds, that
|
|
|
334bcc |
\fBmongostat\fP waits in between calls. By default \fBmongostat\fP
|
|
|
334bcc |
returns one call every second.
|
|
|
334bcc |
.sp
|
|
|
334bcc |
\fBmongostat\fP returns values that reflect the operations
|
|
|
334bcc |
over a 1 second period. For values of \fB<sleeptime>\fP greater
|
|
|
334bcc |
than 1, \fBmongostat\fP averages data to reflect average
|
|
|
334bcc |
operations per second.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.SH FIELDS
|
|
|
334bcc |
.sp
|
|
|
334bcc |
\fBmongostat\fP returns values that reflect the operations over a
|
|
|
334bcc |
1 second period. When \fBmongostat <sleeptime>\fP has a value
|
|
|
334bcc |
greater than 1, \fBmongostat\fP averages the statistics to reflect
|
|
|
334bcc |
average operations per second.
|
|
|
334bcc |
.sp
|
|
|
334bcc |
\fBmongostat\fP outputs the following fields:
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B inserts
|
|
|
334bcc |
The number of objects inserted into the database per second. If
|
|
|
334bcc |
followed by an asterisk (e.g. \fB*\fP), the datum refers to a
|
|
|
334bcc |
replicated operation.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B query
|
|
|
334bcc |
The number of query operations per second.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B update
|
|
|
334bcc |
The number of update operations per second.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B delete
|
|
|
334bcc |
The number of delete operations per second.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B getmore
|
|
|
334bcc |
The number of get more (i.e. cursor batch) operations per second.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B command
|
|
|
334bcc |
The number of commands per second. On \fIslave\fP and
|
|
|
334bcc |
\fIsecondary\fP systems, \fBmongostat\fP presents two values
|
|
|
334bcc |
separated by a pipe character (e.g. \fB|\fP), in the form of
|
|
|
334bcc |
\fBlocal|replicated\fP commands.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B flushes
|
|
|
334bcc |
The number of \fIfsync\fP operations per second.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B mapped
|
|
|
334bcc |
The total amount of data mapped in megabytes. This is the total
|
|
|
334bcc |
data size at the time of the last \fBmongostat\fP call.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B size
|
|
|
334bcc |
The amount of virtual memory in megabytes used by the process at
|
|
|
334bcc |
the time of the last \fBmongostat\fP call.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B non\-mapped
|
|
|
334bcc |
The total amount of virtual memory excluding all mapped memory at
|
|
|
334bcc |
the time of the last \fBmongostat\fP call.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B res
|
|
|
334bcc |
The amount of resident memory in megabytes used by the process at
|
|
|
334bcc |
the time of the last \fBmongostat\fP call.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B faults
|
|
|
334bcc |
Changed in version 2.1.
|
|
|
334bcc |
|
|
|
334bcc |
.sp
|
|
|
334bcc |
The number of page faults per second.
|
|
|
334bcc |
.sp
|
|
|
334bcc |
Before version 2.1 this value was only provided for MongoDB
|
|
|
334bcc |
instances running on Linux hosts.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B locked
|
|
|
334bcc |
The percent of time in a global write lock.
|
|
|
334bcc |
.sp
|
|
|
334bcc |
Changed in version 2.2: The \fBlocked db\fP field replaces the \fBlocked %\fP field to
|
|
|
334bcc |
more appropriate data regarding the database specific locks in
|
|
|
334bcc |
version 2.2.
|
|
|
334bcc |
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B locked db
|
|
|
334bcc |
New in version 2.2.
|
|
|
334bcc |
|
|
|
334bcc |
.sp
|
|
|
334bcc |
The percent of time in the per\-database context\-specific
|
|
|
334bcc |
lock. \fBmongostat\fP will report the database that has spent
|
|
|
334bcc |
the most time since the last \fBmongostat\fP call with a write
|
|
|
334bcc |
lock.
|
|
|
334bcc |
.sp
|
|
|
334bcc |
This value represents the amount of time that the listed database
|
|
|
334bcc |
spent in a locked state \fIcombined\fP with the time that the
|
|
|
334bcc |
\fBmongod\fP spent in the global lock. Because of this, and
|
|
|
334bcc |
the sampling method, you may see some values greater than 100%.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B idx miss
|
|
|
334bcc |
The percent of index access attempts that required a page fault
|
|
|
334bcc |
to load a btree node. This is a sampled value.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B qr
|
|
|
334bcc |
The length of the queue of clients waiting to read data from the
|
|
|
334bcc |
MongoDB instance.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B qw
|
|
|
334bcc |
The length of the queue of clients waiting to write data from the
|
|
|
334bcc |
MongoDB instance.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B ar
|
|
|
334bcc |
The number of active clients performing read operations.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B aw
|
|
|
334bcc |
The number of active clients performing write operations.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B netIn
|
|
|
334bcc |
The amount of network traffic, in \fIbytes\fP, received by the MongoDB instance.
|
|
|
334bcc |
.sp
|
|
|
334bcc |
This includes traffic from \fBmongostat\fP itself.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B netOut
|
|
|
334bcc |
The amount of network traffic, in \fIbytes\fP, sent by the MongoDB instance.
|
|
|
334bcc |
.sp
|
|
|
334bcc |
This includes traffic from \fBmongostat\fP itself.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B conn
|
|
|
334bcc |
The total number of open connections.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B set
|
|
|
334bcc |
The name, if applicable, of the replica set.
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.TP
|
|
|
334bcc |
.B repl
|
|
|
334bcc |
The replication status of the member.
|
|
|
334bcc |
.TS
|
|
|
334bcc |
center;
|
|
|
334bcc |
|l|l|.
|
|
|
334bcc |
_
|
|
|
334bcc |
T{
|
|
|
334bcc |
\fBValue\fP
|
|
|
334bcc |
T} T{
|
|
|
334bcc |
\fBReplication Type\fP
|
|
|
334bcc |
T}
|
|
|
334bcc |
_
|
|
|
334bcc |
T{
|
|
|
334bcc |
M
|
|
|
334bcc |
T} T{
|
|
|
334bcc |
\fImaster\fP
|
|
|
334bcc |
T}
|
|
|
334bcc |
_
|
|
|
334bcc |
T{
|
|
|
334bcc |
SEC
|
|
|
334bcc |
T} T{
|
|
|
334bcc |
\fIsecondary\fP
|
|
|
334bcc |
T}
|
|
|
334bcc |
_
|
|
|
334bcc |
T{
|
|
|
334bcc |
REC
|
|
|
334bcc |
T} T{
|
|
|
334bcc |
recovering
|
|
|
334bcc |
T}
|
|
|
334bcc |
_
|
|
|
334bcc |
T{
|
|
|
334bcc |
UNK
|
|
|
334bcc |
T} T{
|
|
|
334bcc |
unknown
|
|
|
334bcc |
T}
|
|
|
334bcc |
_
|
|
|
334bcc |
T{
|
|
|
334bcc |
SLV
|
|
|
334bcc |
T} T{
|
|
|
334bcc |
\fIslave\fP
|
|
|
334bcc |
T}
|
|
|
334bcc |
_
|
|
|
334bcc |
T{
|
|
|
334bcc |
RTR
|
|
|
334bcc |
T} T{
|
|
|
334bcc |
mongos process ("router")
|
|
|
334bcc |
T}
|
|
|
334bcc |
_
|
|
|
334bcc |
.TE
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.SH USAGE
|
|
|
334bcc |
.sp
|
|
|
334bcc |
In the first example, \fBmongostat\fP will return data every
|
|
|
334bcc |
second for 20 seconds. \fBmongostat\fP collects data from the
|
|
|
334bcc |
\fBmongod\fP instance running on the localhost interface on
|
|
|
334bcc |
port 27017. All of the following invocations produce identical
|
|
|
334bcc |
behavior:
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.INDENT 3.5
|
|
|
334bcc |
.sp
|
|
|
334bcc |
.nf
|
|
|
334bcc |
.ft C
|
|
|
334bcc |
mongostat \-\-rowcount 20 1
|
|
|
334bcc |
mongostat \-\-rowcount 20
|
|
|
334bcc |
mongostat \-n 20 1
|
|
|
334bcc |
mongostat \-n 20
|
|
|
334bcc |
.ft P
|
|
|
334bcc |
.fi
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.sp
|
|
|
334bcc |
In the next example, \fBmongostat\fP returns data every 5 minutes
|
|
|
334bcc |
(or 300 seconds) for as long as the program runs. \fBmongostat\fP
|
|
|
334bcc |
collects data from the \fBmongod\fP instance running on the
|
|
|
334bcc |
localhost interface on port \fB27017\fP\&. Both of the following
|
|
|
334bcc |
invocations produce identical behavior.
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.INDENT 3.5
|
|
|
334bcc |
.sp
|
|
|
334bcc |
.nf
|
|
|
334bcc |
.ft C
|
|
|
334bcc |
mongostat \-\-rowcount 0 300
|
|
|
334bcc |
mongostat \-n 0 300
|
|
|
334bcc |
mongostat 300
|
|
|
334bcc |
.ft P
|
|
|
334bcc |
.fi
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.sp
|
|
|
334bcc |
In the following example, \fBmongostat\fP returns data every 5
|
|
|
334bcc |
minutes for an hour (12 times.) \fBmongostat\fP collects data
|
|
|
334bcc |
from the \fBmongod\fP instance running on the localhost interface
|
|
|
334bcc |
on port 27017. Both of the following invocations produce identical
|
|
|
334bcc |
behavior.
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.INDENT 3.5
|
|
|
334bcc |
.sp
|
|
|
334bcc |
.nf
|
|
|
334bcc |
.ft C
|
|
|
334bcc |
mongostat \-\-rowcount 12 300
|
|
|
334bcc |
mongostat \-n 12 300
|
|
|
334bcc |
.ft P
|
|
|
334bcc |
.fi
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.sp
|
|
|
334bcc |
In many cases, using the \fI\-\-discover\fP
|
|
|
334bcc |
will help provide a more complete snapshot of the state of an entire
|
|
|
334bcc |
group of machines. If a \fBmongos\fP process connected to a
|
|
|
334bcc |
\fIsharded cluster\fP is running on port \fB27017\fP of the local
|
|
|
334bcc |
machine, you can use the following form to return statistics from all
|
|
|
334bcc |
members of the cluster:
|
|
|
334bcc |
.INDENT 0.0
|
|
|
334bcc |
.INDENT 3.5
|
|
|
334bcc |
.sp
|
|
|
334bcc |
.nf
|
|
|
334bcc |
.ft C
|
|
|
334bcc |
mongostat \-\-discover
|
|
|
334bcc |
.ft P
|
|
|
334bcc |
.fi
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.UNINDENT
|
|
|
334bcc |
.SH AUTHOR
|
|
|
334bcc |
MongoDB Documentation Project
|
|
|
334bcc |
.SH COPYRIGHT
|
|
|
334bcc |
2011-2015
|
|
|
334bcc |
.\" Generated by docutils manpage writer.
|
|
|
334bcc |
.
|