Skip to content

Commit 3b95e86

Browse files
author
Ed Costello
committed
Merge branch 'master' of git://github.com/mongodb/docs into DOCS-396-minimum-glibc
2 parents 1b9d9b1 + 8048c19 commit 3b95e86

37 files changed

+1721
-591
lines changed

draft/administration/production-notes.txt

Lines changed: 632 additions & 0 deletions
Large diffs are not rendered by default.

source/administration/backups.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,8 @@ the local database instance (e.g. ``127.0.0.1`` or ``localhost``) and
426426
create a database backup in a in the current directory named
427427
``dump/``.
428428

429+
.. include:: /includes/note-mongodump-compatibility-2.2.rst
430+
429431
You can specify database and collection as options to the
430432
:program:`mongodump` command to limit the amount of data included in the
431433
database dump. For example:

source/administration/indexes.txt

Lines changed: 52 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,17 @@ resulting index.
6565
only creates an index if an index of the same specification does
6666
not already exist.
6767

68+
Special Creation Options
69+
~~~~~~~~~~~~~~~~~~~~~~~~
70+
71+
.. note::
72+
73+
TTL collections use a special ``expire`` index option. See
74+
:doc:`/tutorial/expire-data` for more information.
75+
76+
.. TODO: insert link here to the geospatial index documents when
77+
they're published.
78+
6879
Sparse Indexes
6980
``````````````
7081

@@ -135,6 +146,46 @@ You can also enforce a unique constraint on :ref:`compound indexes
135146
These indexes enforce uniqueness for the *combination* of index keys
136147
and *not* for either key individually.
137148

149+
Background
150+
``````````
151+
152+
To create an index in the background you can specify :ref:`background
153+
construction <index-creation-background>`. Consider the following
154+
prototype invocation of :method:`db.collection.ensureIndex()`:
155+
156+
.. code-block:: javascript
157+
158+
db.collection.ensureIndex( { a: 1 }, { background: true } )
159+
160+
Consider the section on :ref:`background index construction
161+
<index-creation-background>` for more information about these indexes
162+
and their implications.
163+
164+
Drop Duplicates
165+
```````````````
166+
167+
To force the creation of a :ref:`unique index <index-type-unique>`
168+
index on a collection with duplicate values in the field you are
169+
indexing you can use the ``dropDups`` option. This will force MongoDB
170+
to create a *unique* index by deleting documents with duplicate values
171+
when building the index. Consider the following prototype invocation
172+
of :method:`db.collection.ensureIndex()`:
173+
174+
.. code-block:: javascript
175+
176+
db.collection.ensureIndex( { a: 1 }, { dropDups: true } )
177+
178+
See the full documentation of :ref:`duplicate dropping
179+
<index-creation-duplicate-dropping>` for more information.
180+
181+
.. warning::
182+
183+
Specifying ``{ dropDups: true }`` may delete data from your
184+
database. Use with extreme caution.
185+
186+
Refer to the :method:`ensureIndex() <db.collection.ensureIndex()>`
187+
documentation for additional index creation options.
188+
138189
Removal
139190
~~~~~~~
140191

@@ -159,7 +210,7 @@ Where the value of ``nIndexesWas`` reflects the number of indexes
159210
for the :ref:`_id index <index-type-primary>` from a collection.
160211

161212
These shell helpers provide wrappers around the
162-
:dbcommand:`deleteIndexes` :term:`database command`. Your :doc:`client
213+
:dbcommand:`dropIndexes` :term:`database command`. Your :doc:`client
163214
library </applications/drivers>` may have a different or additional
164215
interface for these operations.
165216

@@ -203,54 +254,6 @@ may have a different or additional interface for this operation.
203254

204255
.. include:: /includes/note-build-indexes-on-replica-sets.rst
205256

206-
Special Creation Options
207-
~~~~~~~~~~~~~~~~~~~~~~~~
208-
209-
.. note::
210-
211-
TTL collections use a special ``expire`` index option. See
212-
:doc:`/tutorial/expire-data` for more information.
213-
214-
.. TODO: insert link here to the geospatial index documents when
215-
they're published.
216-
217-
Background
218-
``````````
219-
220-
To create an index in the background you can specify :ref:`background
221-
construction <index-creation-background>`. Consider the following
222-
prototype invocation of :method:`db.collection.ensureIndex()`:
223-
224-
.. code-block:: javascript
225-
226-
db.collection.ensureIndex( { a: 1 }, { background: true } )
227-
228-
Consider the section on :ref:`background index construction
229-
<index-creation-background>` for more information about these indexes
230-
and their implications.
231-
232-
Drop Duplicates
233-
```````````````
234-
235-
To force the creation of a :ref:`unique index <index-type-unique>`
236-
index on a collection with duplicate values in the field you are
237-
indexing you can use the ``dropDups`` option. This will force MongoDB
238-
to create a *unique* index by deleting documents with duplicate values
239-
when building the index. Consider the following prototype invocation
240-
of :method:`db.collection.ensureIndex()`:
241-
242-
.. code-block:: javascript
243-
244-
db.collection.ensureIndex( { a: 1 }, { dropDups: true } )
245-
246-
See the full documentation of :ref:`duplicate dropping
247-
<index-creation-duplicate-dropping>` for more information.
248-
249-
.. warning::
250-
251-
Specifying ``{ dropDups: true }`` may delete data from your
252-
database. Use with extreme caution.
253-
254257
.. _index-building-replica-sets:
255258

256259
Building Indexes on Replica Sets

source/administration/replica-sets.txt

Lines changed: 25 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@ suggestions for administers of replica sets.
2121
The following tutorials provide task-oriented instructions for
2222
specific administrative tasks related to replica set operation.
2323

24-
- :doc:`/tutorial/deploy-replica-set`
25-
- :doc:`/tutorial/expand-replica-set`
24+
- :doc:`/tutorial/change-hostnames-in-a-replica-set`
25+
- :doc:`/tutorial/change-oplog-size`
2626
- :doc:`/tutorial/convert-replica-set-to-replicated-shard-cluster`
27+
- :doc:`/tutorial/convert-secondary-into-arbiter`
2728
- :doc:`/tutorial/deploy-geographically-distributed-replica-set`
29+
- :doc:`/tutorial/deploy-replica-set`
30+
- :doc:`/tutorial/expand-replica-set`
2831

2932
.. _replica-set-node-configurations:
3033
.. _replica-set-member-configurations:
@@ -57,8 +60,8 @@ configurations.
5760
.. _replica-set-secondary-only-members:
5861
.. _replica-set-secondary-only-configuration:
5962

60-
Secondary-Only
61-
~~~~~~~~~~~~~~
63+
Secondary-Only Members
64+
~~~~~~~~~~~~~~~~~~~~~~
6265

6366
The secondary-only configuration prevents a :term:`secondary` member in a
6467
:term:`replica set` from ever becoming a :term:`primary` in a
@@ -119,8 +122,8 @@ This sets the following:
119122
.. _replica-set-hidden-members:
120123
.. _replica-set-hidden-configuration:
121124

122-
Hidden
123-
~~~~~~
125+
Hidden Members
126+
~~~~~~~~~~~~~~
124127

125128
Hidden members are part of a replica set but cannot become
126129
primary and are invisible to client applications. *However,*
@@ -164,8 +167,8 @@ other members in the set will not advertise the hidden member in the
164167
.. _replica-set-delayed-members:
165168
.. _replica-set-delayed-configuration:
166169

167-
Delayed
168-
~~~~~~~
170+
Delayed Members
171+
~~~~~~~~~~~~~~~
169172

170173
Delayed members copy and apply operations from the primary's :term:`oplog` with
171174
a specified delay. If a member has a delay of one hour, then
@@ -220,12 +223,10 @@ queries in normal operations.
220223
<members[n].slaveDelay>` window, the delayed member cannot
221224
successfully replicate operations.
222225

223-
.. see:: For more information about delayed members, see the
224-
section on :ref:`Delayed Replication <replica-set-delayed-members>`.
225-
Additionally consider the following resources:
226-
:data:`members[n].slaveDelay`, :ref:`Replica Set Reconfiguration
227-
<replica-set-reconfiguration-usage>`, :ref:`Oplog Sizing
228-
<replica-set-oplog-sizing>`, and :doc:`/tutorial/change-oplog-size`.
226+
.. seealso:: :data:`members[n].slaveDelay`, :ref:`Replica Set Reconfiguration
227+
<replica-set-reconfiguration-usage>`, :ref:`replica-set-oplog-sizing`,
228+
:ref:`replica-set-procedure-change-oplog-size` in this document,
229+
and the :doc:`/tutorial/change-oplog-size` tutorial.
229230

230231
.. index:: replica set members; arbiters
231232
.. _replica-set-arbiters:
@@ -289,8 +290,8 @@ hostname and the port.
289290
.. _replica-set-non-voting-members:
290291
.. _replica-set-non-voting-configuration:
291292

292-
Non-Voting
293-
~~~~~~~~~~
293+
Non-Voting Members
294+
~~~~~~~~~~~~~~~~~~
294295

295296
You may choose to change the number of votes that each member has in
296297
:ref:`elections <replica-set-elections>` for :term:`primary`. In general, all
@@ -492,30 +493,11 @@ of the member with the highest :data:`members[n].priority` setting.
492493
Changing Oplog Size
493494
~~~~~~~~~~~~~~~~~~~
494495

495-
The :term:`oplog` exists internally as a :term:`capped collection`, so
496-
you cannot modify its size in the course of normal operations. In most
497-
cases the :ref:`default oplog size <replica-set-oplog-sizing>` is an
498-
acceptable size; however, in some situations you may need a larger or
499-
smaller oplog. To resize the oplog, follow these steps:
500-
501-
#. Restart the current :term:`primary` instance in the :term:`replica set` in
502-
"standalone" mode, running on a different port.
503-
504-
#. Save the last entry from the old (current) oplog and create a
505-
backup of the oplog.
506-
507-
#. Drop the existing oplog and create a new oplog of a different size.
508-
509-
#. Insert the previously saved last entry from the old oplog into the
510-
new oplog.
511-
512-
#. Restart the server as a member of the replica set on its usual
513-
port.
496+
The following is an overview of the procedure for changing the size of the oplog:
514497

515-
#. Apply this procedure to any other member of the replica set that
516-
*could become* primary.
498+
.. include:: /includes/procedure-change-oplog-size.rst
517499

518-
.. seealso:: The :doc:`/tutorial/change-oplog-size` tutorial.
500+
For a detailed procedure, see :doc:`/tutorial/change-oplog-size`.
519501

520502
.. _replica-set-security:
521503

@@ -657,10 +639,11 @@ Possible causes of replication lag include:
657639

658640
For more information see:
659641

660-
- the :ref:`Replication Write Concern <replica-set-write-concern>` section,
661-
- the :ref:`replica-set-oplog` documentation,
662-
- the :ref:`Oplog Sizing <replica-set-oplog-sizing>` section, and
663-
- the :doc:`/tutorial/change-oplog-size` tutorial.
642+
- :ref:`replica-set-write-concern`.
643+
- The :ref:`replica-set-oplog-sizing` topic in the :doc:`/core/replication` document.
644+
- The :ref:`replica-set-oplog` topic in the :doc:`/core/replication-internals` document.
645+
- The :ref:`replica-set-procedure-change-oplog-size` topic this document.
646+
- The :doc:`/tutorial/change-oplog-size` tutorial.
664647

665648
.. index:: pair: replica set; failover
666649
.. _replica-set-failover-administration:

source/administration/ssl.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ and the ``.pem`` certificate, use the following command:
6060

6161
.. code-block:: sh
6262

63-
cat mongodb-cert.crt mongodb-cert.pem > mongodb.pem
63+
cat mongodb-cert.key mongodb-cert.pem > mongodb.pem
6464

6565
Clients
6666
-------
@@ -89,7 +89,7 @@ stats. Because the agent already utilizes SSL for its communications
8989
to the MMS servers, this is just a matter of enabling SSL support in
9090
MMS itself on a per host basis.
9191

92-
Use the Edit host button (i.e. the pencil) on the Hosts page in the
92+
Use the "Edit" host button (i.e. the pencil) on the Hosts page in the
9393
MMS console and is currently enabled on a group by group basis by
9494
10gen.
9595

@@ -164,18 +164,18 @@ Then connect to a standalone instance, using the following form:
164164

165165
.. code-block:: javascript
166166

167-
require rubygems
168-
require mongo
167+
require 'rubygems'
168+
require 'mongo'
169169

170-
connection = Mongo::Connection.new(localhost, 27017, :ssl => true)
170+
connection = Mongo::Connection.new('localhost', 27017, :ssl => true)
171171

172172
Replace ``connection`` with the following if you're connecting to a
173173
replica set:
174174

175175
.. code-block:: ruby
176176

177-
connection = Mongo::ReplSetConnection.new([localhost, 27017],
178-
[localhost’, 27018],
177+
connection = Mongo::ReplSetConnection.new(['localhost:27017'],
178+
['localhost:27018'],
179179
:ssl => true)
180180

181181
Here, :program:`mongod` instance run on "``localhost:27017``" and

source/applications/aggregation.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,14 @@ using the following format:
120120
.. code-block:: javascript
121121

122122
{
123-
title : this is my title ,
124-
author : bob ,
123+
title : "this is my title" ,
124+
author : "bob" ,
125125
posted : new Date () ,
126126
pageViews : 5 ,
127-
tags : [ fun , good , fun ] ,
127+
tags : [ "fun" , "good" , "fun" ] ,
128128
comments : [
129-
{ author :joe , text : this is cool } ,
130-
{ author :sam , text : this is bad }
129+
{ author :"joe" , text : "this is cool" } ,
130+
{ author :"sam" , text : "this is bad" }
131131
],
132132
other : { foo : 5 }
133133
}
@@ -144,10 +144,10 @@ command:
144144
author : 1,
145145
tags : 1,
146146
} },
147-
{ $unwind : $tags },
147+
{ $unwind : "$tags" },
148148
{ $group : {
149149
_id : { tags : "$tags" },
150-
authors : { $addToSet : $author }
150+
authors : { $addToSet : "$author" }
151151
} }
152152
);
153153

source/core/replication-internals.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ troubleshooting and for further understanding MongoDB's behavior and approach.
1818
Oplog
1919
-----
2020

21-
For an explanation of the oplog, see the :ref:`oplog <replica-set-oplog-sizing>`
21+
For an explanation of the oplog, see the :ref:`replica-set-oplog-sizing`
2222
topic in the :doc:`/core/replication` document.
2323

2424
Under various exceptional

source/core/replication.txt

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ on the :term:`primary` and then records the operations on the primary's
279279
oplog. The :term:`secondary` members then replicate this log and apply
280280
the operations to themselves in an asynchronous process. All replica set
281281
members contain a copy of the oplog, allowing them to maintain the
282-
current state of the database.
282+
current state of the database. Operations in the oplog are :term:`idempotent`.
283283

284284
By default, the size of the oplog is as follows:
285285

@@ -296,17 +296,16 @@ By default, the size of the oplog is as follows:
296296
the oplog.
297297

298298
Before oplog creation, you can specify the size of your oplog with the
299-
:setting:`oplogSize` option. Once the oplog is created, you can only
300-
change the size of the oplog by using the :ref:`oplog resizing procedure
301-
<replica-set-procedure-change-oplog-size>`.
302-
303-
.. QUESTION: SK, Can the next graph be rewritten? It's unclear to me. BG
304-
305-
For example, if an oplog fits 24 hours of operations, then members can
306-
stop copying entries from the oplog for 24 hours before they require
307-
full resyncing *and* the disk will be full in 19 days. If this were
308-
the case, you would have a very high-volume member. In many
309-
circumstances, the default oplog can hold days of operations.
299+
:setting:`oplogSize` option. After you start a replica set member for
300+
the first time, you can only change the size of the oplog by using the
301+
:doc:`/tutorial/change-oplog-size` tutorial.
302+
303+
In most cases, the default oplog size is sufficient. For example, if an
304+
oplog that is 5% of free disk space fills up in 24 hours of operations, then
305+
secondaries can stop copying entries from the oplog for 24 hours before
306+
they require full resyncing. However, most replica sets have much
307+
lower operation volumes, and their oplogs can hold a much larger
308+
number of operations.
310309

311310
The following factors affect how MongoDB uses space in the oplog:
312311

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.. note::
2+
3+
If you use the :program:`mongodump` tool from the 2.2 distribution to
4+
create a dump of a database, you can restore that dump only to a 2.2
5+
database.

0 commit comments

Comments
 (0)