Skip to content

Commit 3e13f86

Browse files
kennethdyerjeff-allen-mongoianf-mongodbjason-price-mongodbjason-price-mongodb
authored
DOCS-15138 enableSharding (#1040)
* DOCS-15138 Adds versionchanged notice to reference page * (DOCS-15177): Add count to stable API v1 (#1015) * (DOCSP-21679): stage stable api updates for count add 6.0 release notes add stable api changelog remove extra text updates per review feedback re-stage re-stage add footnotes to table adjust table widths table widths tweak header copy adding command specific section to changelog formatting formatting * remove count migration example * remove list of supported commands * tweak * add link to stable api changelog from release notes * clarify actor * add stable API ref * apply copy review suggestion * wording * DOCS-15267 Add release date for v5.0.8 (#1018) * DOCS-15267 * Update 5.0.txt * DOCSP-22186-namespace-content-addition (#1017) * DOCSP-22186-namespace-content-addition * DOCSP-22186-namespace-content-addition * DOCSP-22186-namespace-content-addition * DOCSP-22186-namespace-content-addition * DOCSP-22186-namespace-content-addition Co-authored-by: jason-price-mongodb <[email protected]> * DOCS-15138 Refactors enableSharding definition * DOCS-15138 Refactor enablesharding definition * DOCS-15138 Refactor enablesharding definition * DOCS-15138 Refactor enablesharding definition * DOCS-15138 Refactor enablesharding definition * DOCS-15138 Sharding procedure update * DOCS-15138 Updates steps * DOCS-15138 Removes enableSharding step * DOCS-15138 Removes enableSharding step * DOCS-15138 Removes enableSharding step * DOCS-15138 Fixes broken links * DOCS-15138 Fixes per Joe * DOCS-15138 Fixes per Joe * DOCS-15138 Fixes per Tomasso Tocci Co-authored-by: jeff-allen-mongo <[email protected]> Co-authored-by: ianf-mongodb <[email protected]> Co-authored-by: jason-price-mongodb <[email protected]> Co-authored-by: jason-price-mongodb <[email protected]>
1 parent d3737e8 commit 3e13f86

23 files changed

+66
-216
lines changed

source/core/sharding-shard-a-collection.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ Shard a Collection
1212
:depth: 2
1313
:class: singlecol
1414

15-
.. note::
16-
17-
To shard a collection, you need to :ref:`enable sharding
18-
<sharding-setup-enable-sharding>`.
19-
2015
To shard a collection, you must specify the full namespace of the
2116
collection that you want to shard and the shard key. You can use the
2217
:binary:`~bin.mongosh` method :method:`sh.shardCollection()` to

source/core/timeseries/timeseries-shard-collection.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@ Prerequisites
2727

2828
To shard a time series collection, first:
2929

30-
1. :ref:`Deploy a sharded cluster <sharding-procedure-setup>` to host
31-
the database that contains your time series collection.
32-
33-
#. :ref:`Enable sharding for your database <sharding-setup-enable-sharding>`.
30+
- :ref:`Deploy a sharded cluster <sharding-procedure-setup>` to host
31+
the database that contains your time series collection.
3432

3533
Procedure
3634
---------

source/includes/steps-convert-replica-set-enable-sharding.yaml

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,9 @@ source:
44
ref: connect-mongos
55
---
66
title:
7-
text: Enable sharding for a database.
8-
character: "`"
9-
stepnum: 2
10-
ref: enable-sharding-db-level
11-
pre: |
12-
Before you can shard a collection, you must first enable sharding
13-
for the collection's database. Enabling sharding for a database does not
14-
redistribute data but makes it possible to shard the collections in
15-
that database.
16-
action:
17-
- pre: |
18-
The following operation enables
19-
sharding on the ``test`` database:
20-
language: sh
21-
code: |
22-
sh.enableSharding( "test" )
23-
- pre: |
24-
.. include:: /includes/extracts/mongos-operations-wc-enable-sharding.rst
25-
26-
The operation returns the status of the operation:
27-
language: sh
28-
code: |
29-
{ "ok" : 1 }
30-
---
31-
title:
327
text: Determine the shard key.
338
character: "`"
34-
stepnum: 3
9+
stepnum: 2
3510
ref: determine-shard-key
3611
content: |
3712
For the collection to shard, determine the shard key. The :ref:`shard
@@ -45,14 +20,14 @@ content: |
4520
- allow for effective distribution of activity among shards.
4621
4722
For more information, see :ref:`sharding-shard-key-selection`.
48-
23+
4924
This procedure will use the ``number`` field as the shard key for
5025
``test_collection``.
5126
---
52-
title:
27+
title:
5328
text: Create an index on the shard key.
5429
character: "`"
55-
stepnum: 4
30+
stepnum: 3
5631
ref: enable-sharding-create-index
5732
pre: |
5833
Before sharding a non-empty collection, create an :doc:`index on
@@ -63,10 +38,10 @@ action:
6338
use test
6439
db.test_collection.createIndex( { number : 1 } )
6540
---
66-
title:
41+
title:
6742
text: Shard the collection.
6843
character: "`"
69-
stepnum: 5
44+
stepnum: 4
7045
ref: enable-sharding-collection
7146
action:
7247
- pre: |
@@ -77,7 +52,7 @@ action:
7752
use test
7853
sh.shardCollection( "test.test_collection", { "number" : 1 } )
7954
- pre: |
80-
55+
8156
.. include:: /includes/extracts/mongos-operations-wc-shard-collection.rst
8257
8358
The method returns the status of the operation:
@@ -93,7 +68,7 @@ post: |
9368
title:
9469
text: Confirm the shard is balancing.
9570
character: "`"
96-
stepnum: 6
71+
stepnum: 5
9772
ref: enable-sharding-confirm
9873
action:
9974
- pre: |

source/includes/steps-shard-a-collection-ranged.yaml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,31 +28,6 @@ action:
2828
code: |
2929
mongosh --host <hostname> --port <port> --username <user> --password <pass> --authenticationDatabase 'admin'
3030
---
31-
title: "Enable Sharding on the Database"
32-
level: 4
33-
ref: shard-database
34-
pre: |
35-
Issue the :method:`sh.enableSharding()` method, specifying the name of the
36-
target database:
37-
38-
action:
39-
- pre: |
40-
language: javascript
41-
code: |
42-
sh.enableSharding("<database>")
43-
- pre: |
44-
Optionally, enable sharding using the :dbcommand:`enableSharding`
45-
database command
46-
language: javascript
47-
code: |
48-
db.runCommand( { enableSharding : <database> } )
49-
post: |
50-
.. include:: /includes/extracts/mongos-operations-wc-enable-sharding.rst
51-
52-
53-
Enabling sharding on a database does *not* begin the sharding process.
54-
It only allows for collections within that database to be sharded.
55-
---
5631
title: "Determine the Shard Key"
5732
level: 4
5833
ref: select-shard-key

source/includes/steps-shard-existing-tsc.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ content: |
3232
"minCompatibleVersion" : 5,
3333
"currentVersion" : 6,
3434
...
35-
36-
If ``sh.status()`` returns ``This db does not have sharding enabled.``,
37-
:ref:`enable sharding <sharding-setup-enable-sharding>`.
35+
3836
---
3937
title: Shard the collection.
4038
ref: new-sharded-tsc-create

source/includes/steps-shard-new-tsc.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ content: |
3333
"minCompatibleVersion" : 5,
3434
"currentVersion" : 6,
3535
...
36-
37-
If ``sh.status()`` returns ``This db does not have sharding enabled.``,
38-
:ref:`enable sharding <sharding-setup-enable-sharding>`.
36+
3937
---
4038
title: Create the collection.
4139
ref: new-sharded-tsc-create

source/includes/steps-zones-initial-chunk-distribution-compound-hashed-non-prefix.yaml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -71,22 +71,6 @@ content: |
7171
``"facility" : "FacilityBaker"`` and all possible values of
7272
``_id``.
7373
74-
---
75-
title: "Enable Sharding for the Database"
76-
level: 4
77-
optional: true
78-
ref: initial-chunk-distribution-create-zones-enable-sharding
79-
content: |
80-
81-
Skip this step if you already enabled sharding on the database.
82-
83-
Use :method:`sh.enableSharding()` to enable sharding for the
84-
database:
85-
86-
.. code-block:: javascript
87-
88-
sh.enableSharding("examples")
89-
9074
---
9175
title: "Shard the Collection"
9276
level: 4

source/includes/steps-zones-initial-chunk-distribution-compound-hashed-prefix.yaml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,6 @@ content: |
3333
"FacilityAlpha"
3434
);
3535
36-
---
37-
title: "Enable Sharding for the Database"
38-
level: 4
39-
optional: true
40-
ref: initial-chunk-distribution-create-zones-enable-sharding
41-
content: |
42-
43-
Skip this step if you already enabled sharding on the database.
44-
45-
Use :method:`sh.enableSharding()` to enable sharding for the
46-
database:
47-
48-
.. code-block:: javascript
49-
50-
sh.enableSharding("examples")
51-
5236
---
5337
title: "Shard the Collection"
5438
level: 4

source/includes/steps-zones-initial-chunk-distribution-single-compound.yaml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,6 @@ content: |
3535
"DC2"
3636
);
3737
38-
---
39-
title: "Enable Sharding for the Database"
40-
level: 4
41-
optional: true
42-
ref: initial-chunk-distribution-create-zones-enable-sharding
43-
content: |
44-
45-
Skip this step if you already enabled sharding on the database.
46-
47-
Use :method:`sh.enableSharding()` to enable sharding for the
48-
database:
49-
50-
.. code-block:: javascript
51-
52-
sh.enableSharding("exampledb")
53-
5438
---
5539
title: "Shard the Collection"
5640
level: 4

source/reference/command.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ Sharding Commands
480480

481481
* - :dbcommand:`enableSharding`
482482

483-
- Enables sharding on a specific database.
483+
- Creates a database.
484484

485485
* - :dbcommand:`flushRouterConfig`
486486

0 commit comments

Comments
 (0)