@@ -14,14 +14,11 @@ For a full introduction to sharding in MongoDB see
14
14
":doc:`/core/sharding`," and for a complete overview of all sharding
15
15
documentation in the MongoDB Manual, see ":doc:`/sharding`." The
16
16
":doc:`/administration/sharding-architectures`" document provides an
17
- overview of deployment possibilities that you may find helpful as you
18
- plan to deploy a shard cluster. Finally, the
19
- ":doc:`/core/sharding-internals`" document provides a more detailed
20
- introduction to sharding that you may find useful when troubleshooting
17
+ overview of deployment possibilities to help deploy a shard
18
+ cluster. Finally, the ":doc:`/core/sharding-internals`" document
19
+ provides a more detailed introduction to sharding when troubleshooting
21
20
issues or understanding your cluster's behavior.
22
21
23
- .. TODO - revise to use less 'you may'
24
-
25
22
.. contents:: Sharding Procedures:
26
23
:backlinks: none
27
24
:local:
@@ -37,9 +34,6 @@ tutorial as a guide. If you're deploying a :term:`shard cluster` from
37
34
scratch, see the ":doc:`/tutorial/deploy-shard-cluster`" tutorial for
38
35
more detail or use the following procedure as a quick starting point:
39
36
40
- Sharding Quick Start
41
- --------------------
42
-
43
37
#. Provision the required hardware.
44
38
45
39
The ":ref:`sharding-requirements`" section describes what you'll
@@ -137,10 +131,6 @@ Sharding Quick Start
137
131
138
132
sh.addShard( "repl0/mongodb0.example.net:27027,mongodb1.example.net:27017,mongodb2.example.net:27017" )
139
133
140
-
141
- Enable Sharding
142
- ---------------
143
-
144
134
#. Enable sharding for any database that you want to shard.
145
135
146
136
MongoDB enables sharding on a per-database basis. This is only a
@@ -204,11 +194,10 @@ Enable Sharding
204
194
the distribution of data. Furthermore, you cannot change a
205
195
collection's shard key once it has been set.
206
196
207
- See the ":ref:`Shard Key Overview <sharding-shard-key>`" and
208
- ":ref:`Shard Internals <sharding-internals-shard-keys>`" to help you
209
- choose a better shard key.
210
-
211
- .. TODO - find internal ref for `shard key`
197
+ See the ":ref:`Shard Key Overview <sharding-shard-key>`" and the
198
+ more in depth documentation of ":ref:`Shard Key Qualities
199
+ <sharding-internals-shard-keys>`" to help you select better shard
200
+ keys.
212
201
213
202
If you do not specify a shard key, MongoDB will shard the
214
203
collection using the ``_id`` field.
@@ -496,7 +485,7 @@ MB. This default chunk size works well for most deployments. However, if you
496
485
notice that automatic migrations are incurring a level of I/O that
497
486
your hardware cannot handle, you may want to reduce the chunk
498
487
size. For the automatic splits and migrations, a small chunk size
499
- leads to more rapid chunk migrations, at the cost of more frequent migrations.
488
+ leads to more rapid and frequent migrations.
500
489
501
490
To modify the chunk size, use the following procedure:
502
491
@@ -552,12 +541,11 @@ migrate :term:`chunks <chunk>` between :term:`shards <shard>`.
552
541
However, you may want to migrate chunks manually in a few cases:
553
542
554
543
- If you create chunks by presplitting the data in your collection,
555
- you will have to migrate chunks manually, to distribute chunks
544
+ you will have to migrate chunks manually to distribute chunks
556
545
evenly across the shards.
557
546
558
- - If you find an active cluster is out of balance and the balancer
559
- cannot migrate chunks fast enough, then you will have to migrate
560
- chunks manually.
547
+ - If the balancer in an active cluster cannot distribute chunks within
548
+ the balancing window, then you will have to migrate chunks manually.
561
549
562
550
To migrate chunks, use the :dbcommand:`moveChunk` command.
563
551
@@ -632,9 +620,6 @@ cluster`, do the following:
632
620
633
621
When this command returns, you will see output like the following:
634
622
635
- .. TODO - split up multi-line output to make it easier to read & describe
636
- .. OR maybe specify the original command using .pretty option
637
-
638
623
.. code-block:: javascript
639
624
640
625
{ "_id" : "balancer",
@@ -761,7 +746,7 @@ run this operation from a driver that does not have helper functions:
761
746
762
747
db.settings.update( { _id: "balancer" }, { $set : { stopped: true } } , true );
763
748
764
- #. To enable the balancer again, alter the value of ' stopped' as follows:
749
+ #. To enable the balancer again, alter the value of " stopped" as follows:
765
750
766
751
.. code-block:: javascript
767
752
@@ -804,7 +789,7 @@ three config servers.
804
789
#. Copy the entire :setting:`dbpath` file system tree from the
805
790
existing config server to the two machines that will provide the
806
791
additional config servers. These commands, issued on the system
807
- with the existing config database, `mongo-config0.example.net` may
792
+ with the existing config database, `` mongo-config0.example.net` ` may
808
793
look like the following:
809
794
810
795
.. code-block:: sh
@@ -832,9 +817,8 @@ name.
832
817
833
818
#. Shut down the config server that you are moving.
834
819
835
- This will render all config data for your cluster "read only:"
836
-
837
- .. TODO - make link to config servers :doc:`read only<core/sharding/#config-servers>`
820
+ This will render all config data for your cluster :ref:`read only
821
+ <sharding-config-server>`."
838
822
839
823
#. Change the DNS entry that points to the system that provided the old
840
824
config server, so that the *same* hostname points to the new
@@ -1025,12 +1009,10 @@ almost all cases this is the result of a shard key that does not
1025
1009
effectively allow :ref:`write scaling
1026
1010
<sharding-shard-key-write-scaling>`.
1027
1011
1028
- It's also possible that you have some "hot chunks". In this case, you may
1012
+ It's also possible that you have some "hot chunks." In this case, you may
1029
1013
be able to solve the problem by splitting and then migrating parts of
1030
1014
these chunks.
1031
1015
1032
- .. TODO - is 'hot chunks' a well defined term?
1033
-
1034
1016
In the worst case, you may have to consider re-sharding your data
1035
1017
and :ref:`choosing a different shard key <sharding-internals-choose-shard-key>`
1036
1018
to correct this pattern.
@@ -1100,16 +1082,14 @@ better :ref:`write scaling <sharding-shard-key-write-scaling>`.
1100
1082
Disable Balancing During Backups
1101
1083
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1102
1084
1103
- If MongoDB migrates a chunk while you're taking a :doc:`backup
1085
+ If MongoDB migrates a chunk during a :doc:`backup
1104
1086
</administration/backups>`, you can end with an inconsistent snapshot
1105
- of your shard cluster. You should never run a backup unless you're
1106
- certain that you have disabled the balancer. There are two ways to
1107
- ensure this:
1087
+ of your shard cluster. Never run a backup unless the balancer is
1088
+ disabled. There are two ways to ensure this:
1108
1089
1109
1090
- Set the :ref:`balancing window <sharding-schedule-balancing-window>`
1110
- so that the balancer is inactive while you're creating the
1111
- backup. Ensure that the backup process can complete while you have
1112
- the balancer disabled.
1091
+ so that the balancer is inactive during the backup. Ensure that the
1092
+ backup can complete while you have the balancer disabled.
1113
1093
1114
1094
- :ref:`manually disable the balancer <sharding-balancing-disable-temporally>`
1115
1095
for the duration of the backup procedure.
0 commit comments