Skip to content

Commit 1adb540

Browse files
author
Bob Grabar
committed
DOCS-298 DOCS-299 initial edits
1 parent 8ee109e commit 1adb540

File tree

5 files changed

+85
-52
lines changed

5 files changed

+85
-52
lines changed

source/administration/sharding.txt

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ Shard Cluster Administration
77

88
.. default-domain:: mongodb
99

10-
This document provides a collection of basic operations and procedures
11-
for administering :term:`shard clusters <shard cluster>`.
12-
10+
This document describes common administrative tasks.
1311
For a full introduction to sharding in MongoDB see
1412
":doc:`/core/sharding`," and for a complete overview of all sharding
1513
documentation in the MongoDB Manual, see ":doc:`/sharding`." The
@@ -19,35 +17,40 @@ cluster. Finally, the ":doc:`/core/sharding-internals`" document
1917
provides a more detailed introduction to sharding when troubleshooting
2018
issues or understanding your cluster's behavior.
2119

20+
2221
.. contents:: Sharding Procedures:
2322
:backlinks: none
2423
:local:
2524

2625
.. _sharding-procedure-setup:
2726

28-
Setup
29-
-----
27+
Set up a Shard Cluster
28+
----------------------
29+
30+
Before deploying a shard cluster, see the requirements listed in
31+
:ref:`Requirements for Shard Clusters <sharding-requirements>`.
32+
33+
For testing purposes, you can run all the required shard processes on a
34+
single server. For production, use the configurations described in
35+
:doc:`/administration/replication-architectures`.
3036

31-
If you have an existing replica set, you can use the
32-
":doc:`/tutorial/convert-replica-set-to-replicated-shard-cluster`"
33-
tutorial as a guide. If you're deploying a :term:`shard cluster` from
34-
scratch, see the ":doc:`/tutorial/deploy-shard-cluster`" tutorial for
35-
more detail or use the following procedure as a quick starting point:
37+
.. include:: /includes/warning-sharding-hostnames.rst
3638

37-
#. Provision the required hardware.
39+
.. TODO Keep this or delete it:
40+
If you have an existing replica set, you can use the
41+
:doc:`/tutorial/convert-replica-set-to-replicated-shard-cluster`
42+
tutorial as a guide. If you're deploying a :term:`shard cluster` from
43+
scratch, see the :doc:`/tutorial/deploy-shard-cluster` tutorial for
44+
more detail or use the following procedure as a quick starting point:
3845

39-
The ":ref:`sharding-requirements`" section describes what you'll
40-
need to get started.
46+
1. Set up the required config servers, shards, and :program:`mongos`
47+
instances described in :ref:`Sharding Infrastructure
48+
<sharding-requirements-infrastructure>`.
4149

42-
.. warning:: Sharding and "localhost" Addresses
4350

44-
If you use either "localhost" or "``127.0.0.1``" as the host
45-
identifier, then you must use "localhost" or "``127.0.0.1``" for
46-
*all* host settings for any MongoDB instances in the cluster. If
47-
you mix localhost addresses with remote host address, MongoDB will
48-
produce errors.
51+
#. Start the three (3) config servers.
4952

50-
#. On all three (3) config server instances, issue the following
53+
#. On all three config server instances, issue the following
5154
command to start the :program:`mongod` process:
5255

5356
.. code-block:: sh
@@ -129,8 +132,8 @@ more detail or use the following procedure as a quick starting point:
129132

130133
replicaSetName/<seed1>,<seed2>,<seed3>
131134

132-
For example, if the name of the replica set is "``repl0``", then
133-
your :method:`sh.addShard` command would be:
135+
For example, if the name of the replica set is ``repl0``, then
136+
your :method:`sh.addShard()` command would be:
134137

135138
.. code-block:: javascript
136139

@@ -199,9 +202,9 @@ more detail or use the following procedure as a quick starting point:
199202
the distribution of data. Furthermore, you cannot change a
200203
collection's shard key once it has been set.
201204

202-
See the ":ref:`Shard Key Overview <sharding-shard-key>`" and the
203-
more in depth documentation of ":ref:`Shard Key Qualities
204-
<sharding-internals-shard-keys>`" to help you select better shard
205+
See the :ref:`Shard Key Overview <sharding-shard-key>` and the
206+
more in depth documentation of :ref:`Shard Key Qualities
207+
<sharding-internals-shard-keys>` to help you select better shard
205208
keys.
206209

207210
If you do not specify a shard key, MongoDB will shard the
@@ -271,7 +274,7 @@ procedure:
271274
following form: the replica set name, followed by a forward
272275
slash, followed by a comma-separated list of seeds for the
273276
replica set. For example, if the name of the replica set is
274-
"myapp1", then your :method:`sh.addShard` command might resemble:
277+
"myapp1", then your :method:`sh.addShard()` command might resemble:
275278

276279
.. code-block:: javascript
277280

@@ -282,9 +285,9 @@ procedure:
282285
It may take some time for :term:`chunks <chunk>` to migrate to the
283286
new shard.
284287

285-
See the ":ref:`Balancing and Distribution <sharding-balancing>`"
286-
section for an overview of the balancing operation and the ":ref:`Balancing Internals
287-
<sharding-balancing-internals>`" section for additional information.
288+
See the :ref:`Balancing and Distribution <sharding-balancing>`
289+
section for an overview of the balancing operation and the :ref:`Balancing Internals
290+
<sharding-balancing-internals>` section for additional information.
288291

289292
.. _sharding-procedure-remove-shard:
290293

@@ -695,7 +698,7 @@ Balancer Operations
695698
This section provides an overview of common administrative procedures
696699
related to balancing and the balancing process.
697700

698-
.. seealso:: ":ref:`sharding-balancing`" and the
701+
.. seealso:: :ref:`sharding-balancing` and the
699702
:dbcommand:`moveChunk` that provides manual :term:`chunk`
700703
migrations.
701704

@@ -947,7 +950,7 @@ name.
947950
#. Shut down the config server that you're moving.
948951

949952
This will render all config data for your cluster :ref:`read only
950-
<sharding-config-server>`."
953+
<sharding-config-server>`.
951954

952955
#. Change the DNS entry that points to the system that provided the old
953956
config server, so that the *same* hostname points to the new
@@ -1072,7 +1075,7 @@ of the cluster metadata from the config database is straight forward:
10721075
.. [#read-only] While one of the three config servers unavailable, no
10731076
the cluster cannot split any chunks nor can it migrate chunks
10741077
between shards. Your application will be able to write data to the
1075-
cluster. The ":ref:`sharding-config-server`" section of the
1078+
cluster. The :ref:`sharding-config-server` section of the
10761079
documentation provides more information on this topic.
10771080

10781081
.. index:: troubleshooting; sharding

source/core/sharding-internals.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,3 +495,34 @@ All chunk migrations use the following procedure:
495495
When the ``_secondaryThrottle`` is ``true`` for :dbcommand:`moveChunk`
496496
or the :term:`balancer`, MongoDB ensure that *one* :term:`secondary`
497497
member has replicated changes before allowing new chunk migrations.
498+
499+
Config Database
500+
---------------
501+
502+
The ``config`` database contains sharding configuration information. To
503+
start the ``config`` database from the :program:`mongo` shell, issue the
504+
following command:
505+
506+
.. code-block:: javascript
507+
508+
use config
509+
510+
The config database includes the following collections used by sharding:
511+
512+
- ``chunks``
513+
514+
- ``databases``
515+
516+
- ``lockpings``
517+
518+
- ``locks``
519+
520+
- ``mongos``
521+
522+
- ``settings``
523+
524+
- ``shards``
525+
526+
- ``system.indexes``
527+
528+
- ``version``

source/core/sharding.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,10 @@ A :term:`shard cluster` has the following components:
154154
configuration server process, but always use exactly three config
155155
servers for redundancy and safety in production.
156156

157-
- Two or more :program:`mongod` instances, to hold data.
157+
- Two or more shards. Each shard consists of one or more :program:`mongod`
158+
instances, which store the data for that shard.
158159

159-
These are "normal," :program:`mongod` instances that hold all of the
160+
These "normal" :program:`mongod` instances hold all of the
160161
actual data for the cluster.
161162

162163
Typically each shard is a :term:`replica sets <replica set>`. Each
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.. warning:: Sharding and "localhost" Addresses
2+
3+
If you use either "localhost" or ``127.0.0.1`` as the hostname
4+
portion of any host identifier, for example as the ``host`` argument
5+
to :dbcommand:`addShard` or the value to the :option:`mongos
6+
--configdb` run time option, then you must use "localhost" or
7+
``127.0.0.1`` for *all* host settings for any MongoDB instances in
8+
the cluster. If you mix localhost addresses and remote host address,
9+
MongoDB will error.

source/tutorial/deploy-shard-cluster.txt

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,18 @@ Deploy a Shard Cluster
44

55
.. default-domain:: mongodb
66

7-
Synopsis
8-
--------
9-
107
This document describes how to deploy a :term:`shard cluster` for a
11-
standalone :program:`mongod` instance.
12-
13-
To deploy a shard cluster for an existing replica set, see
8+
standalone :program:`mongod` instance. To deploy a shard cluster for an
9+
existing replica set, see
1410
:doc:`/tutorial/convert-replica-set-to-replicated-shard-cluster`.
1511

12+
Procedure
13+
---------
14+
1615
Before deploying a shard cluster, see the requirements listed in
1716
:ref:`Requirements for Shard Clusters <sharding-requirements>`.
1817

19-
.. warning:: Sharding and "localhost" Addresses
20-
21-
If you use either "localhost" or ``127.0.0.1`` as the hostname
22-
portion of any host identifier, for example as the ``host`` argument to
23-
:dbcommand:`addShard` or the value to the :option:`mongos --configdb`
24-
run time option, then you must use "localhost" or ``127.0.0.1``
25-
for *all* host settings. If you mix localhost addresses and remote
26-
host address, MongoDB will error.
27-
28-
Procedure
29-
---------
18+
.. include:: /includes/warning-sharding-hostnames.rst
3019

3120
Start Config Server Database Instances
3221
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -132,7 +121,7 @@ These operations add two shards, provided by:
132121
- the replica set name and ``s1``, that includes the
133122
``sfo40.example.net`` host.
134123

135-
.. admonition:: All shards should be replica sets.
124+
.. admonition:: All shards should be replica sets
136125

137126
.. versionchanged:: 2.0.3
138127

0 commit comments

Comments
 (0)