1
.TH "MONGOOPLOG" "1" "March 14, 2013" "2.2.3" "mongodb-manual"
5
.nr rst2man-indent-level 0
9
level \\n[rst2man-indent-level]
10
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
17
.\" .rstReportMargin pre:
19
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
20
. nr rst2man-indent-level +1
21
.\" .rstReportMargin post:
25
.\" indent \\n[an-margin]
26
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
27
.nr rst2man-indent-level -1
28
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
29
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
31
.\" Man page generated from reStructuredText.
37
\fI\%mongooplog\fP is a simple tool that polls operations from
38
the \fIreplication\fP \fIoplog\fP of a remote server, and applies
39
them to the local server. This capability supports certain classes of
40
real\-time migrations that require that the source server remain online
41
and in operation throughout the migration process.
43
Typically this command will take the following form:
47
mongooplog \-\-from mongodb0.example.net \-\-host mongodb1.example.net
51
This command copies oplog entries from the \fBmongod\fP instance
52
running on the host \fBmongodb0.example.net\fP and duplicates
53
operations to the host \fBmongodb1.example.net\fP. If you do not need
54
to keep the \fI\%--from\fP host running during
55
the migration, consider using \fBmongodump\fP and
56
\fBmongorestore\fP or another \fBbackup\fP operation, which may be better suited to
59
If the \fBmongod\fP instance specified by the \fI\%--from\fP
60
argument is running with \fBauthentication\fP, then
61
\fI\%mongooplog\fP will not be able to copy oplog entries.
65
\fBmongodump\fP, \fBmongorestore\fP,
66
"\fB/administration/backups\fP", "\fIOplog Internals Overview\fP", and "\fIReplica Set Oplog Sizing\fP".
76
Returns a basic help and usage text.
81
Increases the amount of internal reporting returned on the command
82
line. Increase the verbosity with the \fB\-v\fP form by including the
83
option multiple times, (e.g. \fB\-vvvvv\fP.)
88
Returns the version of the \fI\%mongooplog\fP utility.
92
.B \-\-host <hostname><:port>, \-h
93
Specifies a resolvable hostname for the \fBmongod\fP instance
94
to which \fI\%mongooplog\fP will apply \fIoplog\fP operations
95
retrieved from the serve specified by the \fI\%--from\fP
98
\fI\%mongooplog\fP assumes that all target \fBmongod\fP
99
instances are accessible by way of port \fB27017\fP. You may,
100
optionally, declare an alternate port number as part of the
103
You can always connect directly to a single \fBmongod\fP
104
instance by specifying the host and port number directly.
106
To connect to a replica set, you can specify the replica set seed
107
name, and a seed list of set members, in the following format:
111
<replica_set_name>/<hostname1><:port>,<hostname2:<port>,...
118
Specifies the port number of the \fBmongod\fP instance where
119
\fI\%mongooplog\fP will apply \fIoplog\fP entries. Only
120
specify this option if the MongoDB instance that you wish to
121
connect to is not running on the standard port. (i.e. \fB27017\fP)
122
You may also specify a port number using the \fI\%--host\fP command.
127
Enables IPv6 support that allows \fI\%mongooplog\fP to connect
128
to the MongoDB instance using an IPv6 network. All MongoDB programs
129
and processes, including \fI\%mongooplog\fP, disable IPv6
135
New in version 2.4: MongoDB added support for SSL connections to \fBmongod\fP
136
instances in mongooplog.
138
SSL support in mongooplog is not compiled into the default
139
distribution of MongoDB. See \fB/administration/ssl\fP for more
140
information on SSL and MongoDB.
142
Additionally, mongooplog does not support connections to
143
\fBmongod\fP instances that require client certificate
147
Allows \fI\%mongooplog\fP to connect to \fBmongod\fP
148
instance over an SSL connection.
152
.B \-\-username <username>, \-u <username>
153
Specifies a username to authenticate to the MongoDB instance, if
154
your database requires authentication. Use in conjunction with the
155
\fI\%--password\fP option to supply a
160
.B \-\-password <password>, \-p <password>
161
Specifies a password to authenticate to the MongoDB instance. Use
162
in conjunction with the \fI\%--username\fP
163
option to supply a username.
165
If you specify a \fI\%--username\fP
166
without the \fI\%--password\fP option, \fI\%mongooplog\fP will
167
prompt for a password interactively.
171
.B \-\-authenticationDatabase <dbname>
174
Specifies the database that holds the user\(aqs (e.g
175
\fI\%--username\fP) credentials.
177
By default, \fI\%mongooplog\fP assumes that the database specified to the
178
\fI\-\-db\fP argument holds the user\(aqs credentials, unless you
179
specify \fI\%--authenticationDatabase\fP.
181
See \fBuserSource\fP,
182
\fB/reference/privilege\-documents\fP and
183
\fB/reference/user\-privileges\fP for more information about
184
delegated authentication in MongoDB.
188
.B \-\-authenticationMechanism <name>
191
Specifies the authentication mechanism. By default, the
192
authentication mechanism is \fBMONGODB\-CR\fP, which is the MongoDB
193
challenge/response authentication mechanism. In the MongoDB Subscriber Edition,
194
\fI\%mongooplog\fP also includes support for \fBGSSAPI\fP to handle
195
Kerberos authentication.
197
See \fB/tutorial/control\-access\-to\-mongodb\-with\-kerberos\-authentication\fP
198
for more information about Kerberos authentication.
203
Specifies a directory, containing MongoDB data files, to which
204
\fI\%mongooplog\fP will apply operations from the \fIoplog\fP
205
of the database specified with the \fI\%--from\fP
206
option. When used, the \fI\%--dbpath\fP option enables
207
\fBmongo\fP to attach directly to local data files and write
208
data without a running \fBmongod\fP instance. To run with
209
\fI\%--dbpath\fP, \fI\%mongooplog\fP needs to restrict access
210
to the data directory: as a result, no \fBmongod\fP can be
211
access the same path while the process runs.
215
.B \-\-directoryperdb
216
Use the \fI\%--directoryperdb\fP in conjunction with the
217
corresponding option to \fBmongod\fP. This option allows
218
\fI\%mongooplog\fP to write to data files organized with each
219
database located in a distinct directory. This option is only
220
relevant when specifying the \fI\%--dbpath\fP option.
225
Allows \fI\%mongooplog\fP operations to use the durability
226
\fIjournal\fP to ensure that the data files will
227
remain in a consistent state during the writing process. This
228
option is only relevant when specifying the \fI\%--dbpath\fP
233
.B \-\-fields [field1[,field2]], \-f [field1[,field2]]
234
Specify a field or number fields to constrain which data
235
\fI\%mongooplog\fP will migrate. All other fields will be
236
\fIexcluded\fP from the migration. Comma separate a list of fields to
237
limit the applied fields.
241
.B \-\-fieldFile <file>
242
As an alternative to "\fI\%--fields\fP" the
243
\fI\%--fieldFile\fP option allows you to specify a file
244
(e.g. \fB<file>\fP) that holds a list of field names to \fIinclude\fP in
245
the migration. All other fields will be \fIexcluded\fP from the
246
migration. Place one field per line.
250
.B \-\-seconds <number>, \-s <number>
251
Specify a number of seconds of operations for \fI\%mongooplog\fP
252
to pull from the \fI\%remote host\fP. Unless
253
specified the default value is \fB86400\fP seconds, or 24 hours.
257
.B \-\-from <host[:port]>
258
Specify the host for \fI\%mongooplog\fP to retrieve \fIoplog\fP
259
operations from. \fI\%mongooplog\fP \fIrequires\fP this
262
Unless you specify the \fI\%--host\fP option,
263
\fI\%mongooplog\fP will apply the operations collected with this
264
option to the oplog of the \fBmongod\fP instance running on
265
the localhost interface connected to port \fB27017\fP.
269
.B \-\-oplogns <namespace>
270
Specify a namespace in the \fI\%--from\fP
271
host where the oplog resides. The default value is
272
\fBlocal.oplog.rs\fP, which is the where \fIreplica set\fP members
273
store their operation log. However, if you\(aqve copied \fIoplog\fP
274
entries into another database or collection, use this option to
275
copy oplog entries stored in another location.
277
\fINamespaces\fP take the form of
278
\fB[database].[collection]\fP.
282
Consider the following prototype \fI\%mongooplog\fP command:
286
mongooplog \-\-from mongodb0.example.net \-\-host mongodb1.example.net
290
Here, entries from the \fIoplog\fP of the \fBmongod\fP running
291
on port \fB27017\fP. This only pull entries from the last 24 hours.
293
In the next command, the parameters limit this operation to only apply
294
operations to the database \fBpeople\fP in the collection \fBusage\fP on
295
the target host (i.e. \fBmongodb1.example.net\fP):
299
mongooplog \-\-from mongodb0.example.net \-\-host mongodb1.example.net \-\-database people \-\-collection usage
303
This operation only applies oplog entries from the last 24 hours. Use
304
the \fI\%--seconds\fP argument to capture a
305
greater or smaller amount of time. Consider the following example:
309
mongooplog \-\-from mongodb0.example.net \-\-seconds 172800
313
In this operation, \fI\%mongooplog\fP captures 2 full days of
314
operations. To migrate 12 hours of \fIoplog\fP entries, use the
319
mongooplog \-\-from mongodb0.example.net \-\-seconds 43200
323
For the previous two examples, \fI\%mongooplog\fP migrates entries
324
to the \fBmongod\fP process running on the localhost interface
325
connected to the \fB27017\fP port. \fI\%mongooplog\fP can also
326
operate directly on MongoDB\(aqs data files if no \fBmongod\fP is
327
running on the \fItarget\fP host. Consider the following example:
331
mongooplog \-\-from mongodb0.example.net \-\-dbpath /srv/mongodb \-\-journal
335
Here, \fI\%mongooplog\fP imports \fIoplog\fP operations from the
336
\fBmongod\fP host connected to port \fB27017\fP. This migrates
337
operations to the MongoDB data files stored in the \fB/srv/mongodb\fP
338
directory. Additionally \fI\%mongooplog\fP will use the durability
339
\fIjournal\fP to ensure that the data files remain in a consistent
342
MongoDB Documentation Project
344
2011-2013, 10gen, Inc.
345
.\" Generated by docutils manpage writer.