Blame SOURCES/mongooplog.1

334bcc
.\" Man page generated from reStructuredText.
334bcc
.
334bcc
.TH "MONGOOPLOG" "1" "January 30, 2015" "3.0" "mongodb-manual"
334bcc
.SH NAME
334bcc
mongooplog \- MongoDB Oplog Utility
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
.sp
334bcc
New in version 2.2.
334bcc
334bcc
.SH SYNOPSIS
334bcc
.sp
334bcc
\fBmongooplog\fP is a simple tool that polls operations from
334bcc
the \fIreplication\fP \fIoplog\fP of a remote server, and applies
334bcc
them to the local server. This capability supports certain classes of
334bcc
real\-time migrations that require that the source server remain online
334bcc
and in operation throughout the migration process.
334bcc
.sp
334bcc
Typically this command will take the following form:
334bcc
.INDENT 0.0
334bcc
.INDENT 3.5
334bcc
.sp
334bcc
.nf
334bcc
.ft C
334bcc
mongooplog  \-\-from mongodb0.example.net \-\-host mongodb1.example.net
334bcc
.ft P
334bcc
.fi
334bcc
.UNINDENT
334bcc
.UNINDENT
334bcc
.sp
334bcc
This command copies oplog entries from the \fBmongod\fP instance
334bcc
running on the host \fBmongodb0.example.net\fP and duplicates
334bcc
operations to the host \fBmongodb1.example.net\fP\&. If you do not need
334bcc
to keep the \fI\-\-from\fP host running during
334bcc
the migration, consider using \fBmongodump\fP and
334bcc
\fBmongorestore\fP or another \fBbackup\fP operation, which may be better suited to
334bcc
your operation.
334bcc
.sp
334bcc
\fBNOTE:\fP
334bcc
.INDENT 0.0
334bcc
.INDENT 3.5
334bcc
If the \fBmongod\fP instance specified by the \fI\-\-from\fP
334bcc
argument is running with \fBauthentication\fP, then
334bcc
\fBmongooplog\fP will not be able to copy oplog entries.
334bcc
.UNINDENT
334bcc
.UNINDENT
334bcc
.sp
334bcc
\fBSEE ALSO:\fP
334bcc
.INDENT 0.0
334bcc
.INDENT 3.5
334bcc
\fBmongodump\fP, \fBmongorestore\fP,
334bcc
http://docs.mongodb.org/manual/core/backups, http://docs.mongodb.org/manual/core/replica\-set\-oplog\&.
334bcc
.UNINDENT
334bcc
.UNINDENT
334bcc
.SH OPTIONS
334bcc
.sp
334bcc
Changed in version 3.0.0: \fBmongooplog\fP removed the \fB\-\-dbpath\fP as well as related
334bcc
\fB\-\-directoryperdb\fP and \fB\-\-journal\fP options. You must use
334bcc
\fBmongooplog\fP while connected to a \fBmongod\fP instance.
334bcc
334bcc
.INDENT 0.0
334bcc
.TP
334bcc
.B mongooplog
334bcc
.UNINDENT
334bcc
.INDENT 0.0
334bcc
.TP
334bcc
.B mongooplog
334bcc
.UNINDENT
334bcc
.INDENT 0.0
334bcc
.TP
334bcc
.B \-\-help
334bcc
Returns information on the options and use of \fBmongooplog\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 \-\-quiet
334bcc
Runs the \fBmongooplog\fP in a quiet mode that attempts to limit the amount
334bcc
of output.
334bcc
.sp
334bcc
This option suppresses:
334bcc
.INDENT 7.0
334bcc
.IP \(bu 2
334bcc
connection accepted events
334bcc
.IP \(bu 2
334bcc
connection closed events
334bcc
.UNINDENT
334bcc
.UNINDENT
334bcc
.INDENT 0.0
334bcc
.TP
334bcc
.B \-\-version
334bcc
Returns the \fBmongooplog\fP release number.
334bcc
.UNINDENT
334bcc
.INDENT 0.0
334bcc
.TP
334bcc
.B \-\-host <hostname><:port>, \-h <hostname><:port>
334bcc
Specifies a resolvable hostname for the \fBmongod\fP instance to
334bcc
which \fBmongooplog\fP will apply \fIoplog\fP operations
334bcc
retrieved from the server specified by the \fI\-\-from\fP option.
334bcc
.sp
334bcc
By default \fBmongooplog\fP attempts to connect to a MongoDB instance running
334bcc
on the localhost on port number \fB27017\fP\&.
334bcc
.sp
334bcc
To connect to a replica set, specify the \fBreplica set name\fP and a seed list of set members. Use the
334bcc
following form:
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
.UNINDENT
334bcc
.INDENT 0.0
334bcc
.TP
334bcc
.B \-\-port
334bcc
Specifies the port number of the \fBmongod\fP instance where
334bcc
\fBmongooplog\fP will apply \fIoplog\fP entries. Specify
334bcc
this option only if the MongoDB instance to connect to is not
334bcc
running on the standard port of \fB27017\fP\&. You may also specify a
334bcc
port number using the \fI\-\-host\fP command.
334bcc
.UNINDENT
334bcc
.INDENT 0.0
334bcc
.TP
334bcc
.B \-\-ipv6
334bcc
Enables IPv6 support and allows the \fBmongooplog\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 \fBmongooplog\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 \fBmongooplog\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
\fBmongooplog\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 \fBmongooplog\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, \fBmongooplog\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
.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 \fBmongooplog\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 \-\-db <database>, \-d <database>
334bcc
Specifies the name of the database on which to run the \fBmongooplog\fP\&.
334bcc
.UNINDENT
334bcc
.INDENT 0.0
334bcc
.TP
334bcc
.B \-\-collection <collection>, \-c <collection>
334bcc
Specifies the collection to export.
334bcc
.UNINDENT
334bcc
.INDENT 0.0
334bcc
.TP
334bcc
.B \-\-seconds <number>, \-s <number>
334bcc
Specify a number of seconds of operations for \fBmongooplog\fP to
334bcc
pull from the \fIremote host\fP\&. Unless
334bcc
specified the default value is \fB86400\fP seconds, or 24 hours.
334bcc
.UNINDENT
334bcc
.INDENT 0.0
334bcc
.TP
334bcc
.B \-\-from <host[:port]>
334bcc
Specify the host for \fBmongooplog\fP to retrieve \fIoplog\fP
334bcc
operations from. \fBmongooplog\fP \fIrequires\fP this option.
334bcc
.sp
334bcc
Unless you specify the \fI\-\-host\fP option,
334bcc
\fBmongooplog\fP will apply the operations collected with this
334bcc
option to the oplog of the \fBmongod\fP instance running on the
334bcc
localhost interface connected to port \fB27017\fP\&.
334bcc
.UNINDENT
334bcc
.INDENT 0.0
334bcc
.TP
334bcc
.B \-\-oplogns <namespace>
334bcc
Specify a namespace in the \fI\-\-from\fP host
334bcc
where the oplog resides. The default value is \fBlocal.oplog.rs\fP, which
334bcc
is the where \fIreplica set\fP members store their operation log.
334bcc
However, if you\(aqve copied \fIoplog\fP entries into another
334bcc
database or collection or are pulling oplog entries from a
334bcc
\fBmaster\-slave\fP deployment, use \fI\%\-\-oplogns\fP to
334bcc
apply oplog entries stored in another location. Namespaces take the
334bcc
form of \fB[database].[collection]\fP\&.
334bcc
.UNINDENT
334bcc
.SH USE
334bcc
.sp
334bcc
Consider the following prototype \fBmongooplog\fP command:
334bcc
.INDENT 0.0
334bcc
.INDENT 3.5
334bcc
.sp
334bcc
.nf
334bcc
.ft C
334bcc
mongooplog  \-\-from mongodb0.example.net \-\-host mongodb1.example.net
334bcc
.ft P
334bcc
.fi
334bcc
.UNINDENT
334bcc
.UNINDENT
334bcc
.sp
334bcc
Here, entries from the \fIoplog\fP of the \fBmongod\fP running
334bcc
on port \fB27017\fP\&. This only pull entries from the last 24 hours.
334bcc
.sp
334bcc
Use the \fI\-\-seconds\fP argument to capture
334bcc
a greater or smaller amount of time. Consider the following example:
334bcc
.INDENT 0.0
334bcc
.INDENT 3.5
334bcc
.sp
334bcc
.nf
334bcc
.ft C
334bcc
mongooplog  \-\-from mongodb0.example.net \-\-seconds 172800
334bcc
.ft P
334bcc
.fi
334bcc
.UNINDENT
334bcc
.UNINDENT
334bcc
.sp
334bcc
In this operation, \fBmongooplog\fP captures 2 full days of
334bcc
operations. To migrate 12 hours of \fIoplog\fP entries, use the
334bcc
following form:
334bcc
.INDENT 0.0
334bcc
.INDENT 3.5
334bcc
.sp
334bcc
.nf
334bcc
.ft C
334bcc
mongooplog  \-\-from mongodb0.example.net \-\-seconds 43200
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
.