Blame SOURCES/mongooplog.1

7fe184
.\" Man page generated from reStructuredText.
7fe184
.
7fe184
.TH "MONGOOPLOG" "1" "January 30, 2015" "3.0" "mongodb-manual"
7fe184
.SH NAME
7fe184
mongooplog \- MongoDB Oplog Utility
7fe184
.
7fe184
.nr rst2man-indent-level 0
7fe184
.
7fe184
.de1 rstReportMargin
7fe184
\\$1 \\n[an-margin]
7fe184
level \\n[rst2man-indent-level]
7fe184
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
7fe184
-
7fe184
\\n[rst2man-indent0]
7fe184
\\n[rst2man-indent1]
7fe184
\\n[rst2man-indent2]
7fe184
..
7fe184
.de1 INDENT
7fe184
.\" .rstReportMargin pre:
7fe184
. RS \\$1
7fe184
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
7fe184
. nr rst2man-indent-level +1
7fe184
.\" .rstReportMargin post:
7fe184
..
7fe184
.de UNINDENT
7fe184
. RE
7fe184
.\" indent \\n[an-margin]
7fe184
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
7fe184
.nr rst2man-indent-level -1
7fe184
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
7fe184
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
7fe184
..
7fe184
.sp
7fe184
New in version 2.2.
7fe184
7fe184
.SH SYNOPSIS
7fe184
.sp
7fe184
\fBmongooplog\fP is a simple tool that polls operations from
7fe184
the \fIreplication\fP \fIoplog\fP of a remote server, and applies
7fe184
them to the local server. This capability supports certain classes of
7fe184
real\-time migrations that require that the source server remain online
7fe184
and in operation throughout the migration process.
7fe184
.sp
7fe184
Typically this command will take the following form:
7fe184
.INDENT 0.0
7fe184
.INDENT 3.5
7fe184
.sp
7fe184
.nf
7fe184
.ft C
7fe184
mongooplog  \-\-from mongodb0.example.net \-\-host mongodb1.example.net
7fe184
.ft P
7fe184
.fi
7fe184
.UNINDENT
7fe184
.UNINDENT
7fe184
.sp
7fe184
This command copies oplog entries from the \fBmongod\fP instance
7fe184
running on the host \fBmongodb0.example.net\fP and duplicates
7fe184
operations to the host \fBmongodb1.example.net\fP\&. If you do not need
7fe184
to keep the \fI\-\-from\fP host running during
7fe184
the migration, consider using \fBmongodump\fP and
7fe184
\fBmongorestore\fP or another \fBbackup\fP operation, which may be better suited to
7fe184
your operation.
7fe184
.sp
7fe184
\fBNOTE:\fP
7fe184
.INDENT 0.0
7fe184
.INDENT 3.5
7fe184
If the \fBmongod\fP instance specified by the \fI\-\-from\fP
7fe184
argument is running with \fBauthentication\fP, then
7fe184
\fBmongooplog\fP will not be able to copy oplog entries.
7fe184
.UNINDENT
7fe184
.UNINDENT
7fe184
.sp
7fe184
\fBSEE ALSO:\fP
7fe184
.INDENT 0.0
7fe184
.INDENT 3.5
7fe184
\fBmongodump\fP, \fBmongorestore\fP,
7fe184
http://docs.mongodb.org/manual/core/backups, http://docs.mongodb.org/manual/core/replica\-set\-oplog\&.
7fe184
.UNINDENT
7fe184
.UNINDENT
7fe184
.SH OPTIONS
7fe184
.sp
7fe184
Changed in version 3.0.0: \fBmongooplog\fP removed the \fB\-\-dbpath\fP as well as related
7fe184
\fB\-\-directoryperdb\fP and \fB\-\-journal\fP options. You must use
7fe184
\fBmongooplog\fP while connected to a \fBmongod\fP instance.
7fe184
7fe184
.INDENT 0.0
7fe184
.TP
7fe184
.B mongooplog
7fe184
.UNINDENT
7fe184
.INDENT 0.0
7fe184
.TP
7fe184
.B mongooplog
7fe184
.UNINDENT
7fe184
.INDENT 0.0
7fe184
.TP
7fe184
.B \-\-help
7fe184
Returns information on the options and use of \fBmongooplog\fP\&.
7fe184
.UNINDENT
7fe184
.INDENT 0.0
7fe184
.TP
7fe184
.B \-\-verbose, \-v
7fe184
Increases the amount of internal reporting returned on standard output
7fe184
or in log files. Increase the verbosity with the \fB\-v\fP form by
7fe184
including the option multiple times, (e.g. \fB\-vvvvv\fP\&.)
7fe184
.UNINDENT
7fe184
.INDENT 0.0
7fe184
.TP
7fe184
.B \-\-quiet
7fe184
Runs the \fBmongooplog\fP in a quiet mode that attempts to limit the amount
7fe184
of output.
7fe184
.sp
7fe184
This option suppresses:
7fe184
.INDENT 7.0
7fe184
.IP \(bu 2
7fe184
connection accepted events
7fe184
.IP \(bu 2
7fe184
connection closed events
7fe184
.UNINDENT
7fe184
.UNINDENT
7fe184
.INDENT 0.0
7fe184
.TP
7fe184
.B \-\-version
7fe184
Returns the \fBmongooplog\fP release number.
7fe184
.UNINDENT
7fe184
.INDENT 0.0
7fe184
.TP
7fe184
.B \-\-host <hostname><:port>, \-h <hostname><:port>
7fe184
Specifies a resolvable hostname for the \fBmongod\fP instance to
7fe184
which \fBmongooplog\fP will apply \fIoplog\fP operations
7fe184
retrieved from the server specified by the \fI\-\-from\fP option.
7fe184
.sp
7fe184
By default \fBmongooplog\fP attempts to connect to a MongoDB instance running
7fe184
on the localhost on port number \fB27017\fP\&.
7fe184
.sp
7fe184
To connect to a replica set, specify the \fBreplica set name\fP and a seed list of set members. Use the
7fe184
following form:
7fe184
.INDENT 7.0
7fe184
.INDENT 3.5
7fe184
.sp
7fe184
.nf
7fe184
.ft C
7fe184
<replSetName>/<hostname1><:port>,<hostname2><:port>,<...>
7fe184
.ft P
7fe184
.fi
7fe184
.UNINDENT
7fe184
.UNINDENT
7fe184
.sp
7fe184
You can always connect directly to a single MongoDB instance by
7fe184
specifying the host and port number directly.
7fe184
.UNINDENT
7fe184
.INDENT 0.0
7fe184
.TP
7fe184
.B \-\-port
7fe184
Specifies the port number of the \fBmongod\fP instance where
7fe184
\fBmongooplog\fP will apply \fIoplog\fP entries. Specify
7fe184
this option only if the MongoDB instance to connect to is not
7fe184
running on the standard port of \fB27017\fP\&. You may also specify a
7fe184
port number using the \fI\-\-host\fP command.
7fe184
.UNINDENT
7fe184
.INDENT 0.0
7fe184
.TP
7fe184
.B \-\-ipv6
7fe184
Enables IPv6 support and allows the \fBmongooplog\fP to connect to the
7fe184
MongoDB instance using an IPv6 network. All MongoDB programs and
7fe184
processes disable IPv6 support by default.
7fe184
.UNINDENT
7fe184
.INDENT 0.0
7fe184
.TP
7fe184
.B \-\-ssl
7fe184
New in version 2.6.
7fe184
7fe184
.sp
7fe184
Enables connection to a \fBmongod\fP or \fBmongos\fP that has
7fe184
SSL support enabled.
7fe184
.sp
7fe184
The default distribution of MongoDB does not contain support for SSL.
7fe184
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
7fe184
.UNINDENT
7fe184
.INDENT 0.0
7fe184
.TP
7fe184
.B \-\-sslCAFile <filename>
7fe184
New in version 2.6.
7fe184
7fe184
.sp
7fe184
Specifies the \fB\&.pem\fP file that contains the root certificate chain
7fe184
from the Certificate Authority. Specify the file name of the
7fe184
\fB\&.pem\fP file using relative or absolute paths.
7fe184
.sp
7fe184
The default distribution of MongoDB does not contain support for SSL.
7fe184
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
7fe184
.sp
7fe184
\fBWARNING:\fP
7fe184
.INDENT 7.0
7fe184
.INDENT 3.5
7fe184
If the \fBmongo\fP shell or any other tool that connects to
7fe184
\fBmongos\fP or \fBmongod\fP is run without
7fe184
\fI\-\-sslCAFile\fP, it will not attempt to validate
7fe184
server certificates. This results in vulnerability to expired
7fe184
\fBmongod\fP and \fBmongos\fP certificates as well as to foreign
7fe184
processes posing as valid \fBmongod\fP or \fBmongos\fP
7fe184
instances. Ensure that you \fIalways\fP specify the CA file against which
7fe184
server certificates should be validated in cases where intrusion is a
7fe184
possibility.
7fe184
.UNINDENT
7fe184
.UNINDENT
7fe184
.UNINDENT
7fe184
.INDENT 0.0
7fe184
.TP
7fe184
.B \-\-sslPEMKeyFile <filename>
7fe184
New in version 2.6.
7fe184
7fe184
.sp
7fe184
Specifies the \fB\&.pem\fP file that contains both the SSL certificate
7fe184
and key. Specify the file name of the \fB\&.pem\fP file using relative
7fe184
or absolute paths.
7fe184
.sp
7fe184
This option is required when using the \fI\-\-ssl\fP option to connect
7fe184
to a \fBmongod\fP or \fBmongos\fP that has
7fe184
\fBCAFile\fP enabled \fIwithout\fP
7fe184
\fBallowConnectionsWithoutCertificates\fP\&.
7fe184
.sp
7fe184
The default distribution of MongoDB does not contain support for SSL.
7fe184
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
7fe184
.UNINDENT
7fe184
.INDENT 0.0
7fe184
.TP
7fe184
.B \-\-sslPEMKeyPassword <value>
7fe184
New in version 2.6.
7fe184
7fe184
.sp
7fe184
Specifies the password to de\-crypt the certificate\-key file (i.e.
7fe184
\fI\-\-sslPEMKeyFile\fP). Use the \fI\-\-sslPEMKeyPassword\fP option only if the
7fe184
certificate\-key file is encrypted. In all cases, the \fBmongooplog\fP will
7fe184
redact the password from all logging and reporting output.
7fe184
.sp
7fe184
If the private key in the PEM file is encrypted and you do not specify
7fe184
the \fI\-\-sslPEMKeyPassword\fP option, the \fBmongooplog\fP will prompt for a passphrase. See
7fe184
\fIssl\-certificate\-password\fP\&.
7fe184
.sp
7fe184
The default distribution of MongoDB does not contain support for SSL.
7fe184
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
7fe184
.UNINDENT
7fe184
.INDENT 0.0
7fe184
.TP
7fe184
.B \-\-sslCRLFile <filename>
7fe184
New in version 2.6.
7fe184
7fe184
.sp
7fe184
Specifies the \fB\&.pem\fP file that contains the Certificate Revocation
7fe184
List. Specify the file name of the \fB\&.pem\fP file using relative or
7fe184
absolute paths.
7fe184
.sp
7fe184
The default distribution of MongoDB does not contain support for SSL.
7fe184
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
7fe184
.UNINDENT
7fe184
.INDENT 0.0
7fe184
.TP
7fe184
.B \-\-sslAllowInvalidCertificates
7fe184
New in version 2.6.
7fe184
7fe184
.sp
7fe184
Bypasses the validation checks for server certificates and allows
7fe184
the use of invalid certificates. When using the
7fe184
\fBallowInvalidCertificates\fP setting, MongoDB logs as a
7fe184
warning the use of the invalid certificate.
7fe184
.sp
7fe184
The default distribution of MongoDB does not contain support for SSL.
7fe184
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
7fe184
.UNINDENT
7fe184
.INDENT 0.0
7fe184
.TP
7fe184
.B \-\-sslAllowInvalidHostnames
7fe184
New in version 3.0.
7fe184
7fe184
.sp
7fe184
Disables the validation of the hostnames in SSL certificates. Allows
7fe184
\fBmongooplog\fP to connect to MongoDB instances if the hostname their
7fe184
certificates do not match the specified hostname.
7fe184
.UNINDENT
7fe184
.INDENT 0.0
7fe184
.TP
7fe184
.B \-\-sslFIPSMode
7fe184
New in version 2.6.
7fe184
7fe184
.sp
7fe184
Directs the \fBmongooplog\fP to use the FIPS mode of the installed OpenSSL
7fe184
library. Your system must have a FIPS compliant OpenSSL library to use
7fe184
the \fI\-\-sslFIPSMode\fP option.
7fe184
.sp
7fe184
\fBNOTE:\fP
7fe184
.INDENT 7.0
7fe184
.INDENT 3.5
7fe184
FIPS Compatible SSL is
7fe184
available only in \fI\%MongoDB Enterprise\fP\&. See
7fe184
http://docs.mongodb.org/manual/tutorial/configure\-fips for more information.
7fe184
.UNINDENT
7fe184
.UNINDENT
7fe184
.UNINDENT
7fe184
.INDENT 0.0
7fe184
.TP
7fe184
.B \-\-username <username>, \-u <username>
7fe184
Specifies a username with which to authenticate to a MongoDB database
7fe184
that uses authentication. Use in conjunction with the \fB\-\-password\fP and
7fe184
\fB\-\-authenticationDatabase\fP options.
7fe184
.UNINDENT
7fe184
.INDENT 0.0
7fe184
.TP
7fe184
.B \-\-password <password>, \-p <password>
7fe184
Specifies a password with which to authenticate to a MongoDB database
7fe184
that uses authentication. Use in conjunction with the \fB\-\-username\fP and
7fe184
\fB\-\-authenticationDatabase\fP options.
7fe184
.sp
7fe184
If you do not specify an argument for \fI\-\-password\fP, \fBmongooplog\fP will
7fe184
prompt interactively for a password on the console.
7fe184
.UNINDENT
7fe184
.INDENT 0.0
7fe184
.TP
7fe184
.B \-\-authenticationDatabase <dbname>
7fe184
New in version 2.4.
7fe184
7fe184
.sp
7fe184
Specifies the database that holds the user\(aqs credentials.
7fe184
.UNINDENT
7fe184
.INDENT 0.0
7fe184
.TP
7fe184
.B \-\-authenticationMechanism <name>
7fe184
\fIDefault\fP: MONGODB\-CR
7fe184
.sp
7fe184
New in version 2.4.
7fe184
7fe184
.sp
7fe184
Changed in version 2.6: Added support for the \fBPLAIN\fP and \fBMONGODB\-X509\fP authentication
7fe184
mechanisms.
7fe184
7fe184
.sp
7fe184
Specifies the authentication mechanism the \fBmongooplog\fP instance uses to
7fe184
authenticate to the \fBmongod\fP or \fBmongos\fP\&.
7fe184
.TS
7fe184
center;
7fe184
|l|l|.
7fe184
_
7fe184
T{
7fe184
Value
7fe184
T}	T{
7fe184
Description
7fe184
T}
7fe184
_
7fe184
T{
7fe184
MONGODB\-CR
7fe184
T}	T{
7fe184
MongoDB challenge/response authentication.
7fe184
T}
7fe184
_
7fe184
T{
7fe184
MONGODB\-X509
7fe184
T}	T{
7fe184
MongoDB SSL certificate authentication.
7fe184
T}
7fe184
_
7fe184
T{
7fe184
PLAIN
7fe184
T}	T{
7fe184
External authentication using LDAP. You can also use \fBPLAIN\fP
7fe184
for authenticating in\-database users. \fBPLAIN\fP transmits
7fe184
passwords in plain text. This mechanism is available only in
7fe184
\fI\%MongoDB Enterprise\fP\&.
7fe184
T}
7fe184
_
7fe184
T{
7fe184
GSSAPI
7fe184
T}	T{
7fe184
External authentication using Kerberos. This mechanism is
7fe184
available only in \fI\%MongoDB Enterprise\fP\&.
7fe184
T}
7fe184
_
7fe184
.TE
7fe184
.UNINDENT
7fe184
.INDENT 0.0
7fe184
.TP
7fe184
.B \-\-gssapiServiceName
7fe184
New in version 2.6.
7fe184
7fe184
.sp
7fe184
Specify the name of the service using \fBGSSAPI/Kerberos\fP\&. Only required if the service does not use the
7fe184
default name of \fBmongodb\fP\&.
7fe184
.sp
7fe184
This option is available only in MongoDB Enterprise.
7fe184
.UNINDENT
7fe184
.INDENT 0.0
7fe184
.TP
7fe184
.B \-\-gssapiHostName
7fe184
New in version 2.6.
7fe184
7fe184
.sp
7fe184
Specify the hostname of a service using \fBGSSAPI/Kerberos\fP\&. \fIOnly\fP required if the hostname of a machine does
7fe184
not match the hostname resolved by DNS.
7fe184
.sp
7fe184
This option is available only in MongoDB Enterprise.
7fe184
.UNINDENT
7fe184
.INDENT 0.0
7fe184
.TP
7fe184
.B \-\-db <database>, \-d <database>
7fe184
Specifies the name of the database on which to run the \fBmongooplog\fP\&.
7fe184
.UNINDENT
7fe184
.INDENT 0.0
7fe184
.TP
7fe184
.B \-\-collection <collection>, \-c <collection>
7fe184
Specifies the collection to export.
7fe184
.UNINDENT
7fe184
.INDENT 0.0
7fe184
.TP
7fe184
.B \-\-seconds <number>, \-s <number>
7fe184
Specify a number of seconds of operations for \fBmongooplog\fP to
7fe184
pull from the \fIremote host\fP\&. Unless
7fe184
specified the default value is \fB86400\fP seconds, or 24 hours.
7fe184
.UNINDENT
7fe184
.INDENT 0.0
7fe184
.TP
7fe184
.B \-\-from <host[:port]>
7fe184
Specify the host for \fBmongooplog\fP to retrieve \fIoplog\fP
7fe184
operations from. \fBmongooplog\fP \fIrequires\fP this option.
7fe184
.sp
7fe184
Unless you specify the \fI\-\-host\fP option,
7fe184
\fBmongooplog\fP will apply the operations collected with this
7fe184
option to the oplog of the \fBmongod\fP instance running on the
7fe184
localhost interface connected to port \fB27017\fP\&.
7fe184
.UNINDENT
7fe184
.INDENT 0.0
7fe184
.TP
7fe184
.B \-\-oplogns <namespace>
7fe184
Specify a namespace in the \fI\-\-from\fP host
7fe184
where the oplog resides. The default value is \fBlocal.oplog.rs\fP, which
7fe184
is the where \fIreplica set\fP members store their operation log.
7fe184
However, if you\(aqve copied \fIoplog\fP entries into another
7fe184
database or collection or are pulling oplog entries from a
7fe184
\fBmaster\-slave\fP deployment, use \fI\%\-\-oplogns\fP to
7fe184
apply oplog entries stored in another location. Namespaces take the
7fe184
form of \fB[database].[collection]\fP\&.
7fe184
.UNINDENT
7fe184
.SH USE
7fe184
.sp
7fe184
Consider the following prototype \fBmongooplog\fP command:
7fe184
.INDENT 0.0
7fe184
.INDENT 3.5
7fe184
.sp
7fe184
.nf
7fe184
.ft C
7fe184
mongooplog  \-\-from mongodb0.example.net \-\-host mongodb1.example.net
7fe184
.ft P
7fe184
.fi
7fe184
.UNINDENT
7fe184
.UNINDENT
7fe184
.sp
7fe184
Here, entries from the \fIoplog\fP of the \fBmongod\fP running
7fe184
on port \fB27017\fP\&. This only pull entries from the last 24 hours.
7fe184
.sp
7fe184
Use the \fI\-\-seconds\fP argument to capture
7fe184
a greater or smaller amount of time. Consider the following example:
7fe184
.INDENT 0.0
7fe184
.INDENT 3.5
7fe184
.sp
7fe184
.nf
7fe184
.ft C
7fe184
mongooplog  \-\-from mongodb0.example.net \-\-seconds 172800
7fe184
.ft P
7fe184
.fi
7fe184
.UNINDENT
7fe184
.UNINDENT
7fe184
.sp
7fe184
In this operation, \fBmongooplog\fP captures 2 full days of
7fe184
operations. To migrate 12 hours of \fIoplog\fP entries, use the
7fe184
following form:
7fe184
.INDENT 0.0
7fe184
.INDENT 3.5
7fe184
.sp
7fe184
.nf
7fe184
.ft C
7fe184
mongooplog  \-\-from mongodb0.example.net \-\-seconds 43200
7fe184
.ft P
7fe184
.fi
7fe184
.UNINDENT
7fe184
.UNINDENT
7fe184
.SH AUTHOR
7fe184
MongoDB Documentation Project
7fe184
.SH COPYRIGHT
7fe184
2011-2015
7fe184
.\" Generated by docutils manpage writer.
7fe184
.