Skip to content

Commit 6dc5e78

Browse files
author
Bob Grabar
committed
early draft
1 parent 2286896 commit 6dc5e78

File tree

2 files changed

+64
-3
lines changed

2 files changed

+64
-3
lines changed

source/administration/sharding.txt

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,44 @@ Cluster Management
200200

201201
Once you have a running sharded cluster, you will need to maintain it.
202202
This section describes common maintenance procedure, including: how to
203-
add and remove nodes, how to manually split chunks, and how to disable
203+
add and remove shards, how to manually split chunks, and how to disable
204204
the balancer for backups.
205205

206-
List all Shards
207-
~~~~~~~~~~~~~~~
206+
List Databases with Sharding Enabled
207+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
208+
209+
To list the databases for which sharding is enabled, query the
210+
``databases`` collection in the :ref:`config database
211+
<config-database>`. The databases with the ``partitioned`` field set to
212+
``true`` have sharding enabled.
213+
214+
.. example:: Run this sequence of commands to open the :ref:`config
215+
database <config-database>` and query the ``databases`` collection.
216+
217+
.. code-block:: javascript
218+
219+
use config
220+
221+
db.databases.find()
222+
223+
Given the following example output:
224+
225+
.. code-block:: javascript
226+
227+
{ "_id" : "admin", "partitioned" : false, "primary" : "config" }
228+
229+
{ "_id" : "foo", "partitioned" : true, "primary" : "example1.com:30001" }
230+
231+
{ "_id" : "baz", "partitioned" : false, "primary" : "example2.com:27017" }
232+
233+
Only the database `foo` has sharding enabled because only `foo` has
234+
the ``partitioned`` field set to ``true``.
235+
236+
.. note:: If a database in a sharded environment does not have sharding
237+
enabled, all its data is on the first shard of the cluster.
238+
239+
List Shards
240+
~~~~~~~~~~~
208241

209242
To list the current set of configured shards and verify that all shards
210243
have been committed to the system, run the :dbcommand:`listShards`
@@ -216,6 +249,32 @@ command:
216249

217250
.. _sharding-procedure-add-shard:
218251

252+
253+
254+
255+
256+
257+
258+
259+
260+
261+
262+
263+
264+
265+
266+
267+
268+
269+
270+
271+
272+
273+
274+
275+
276+
277+
219278
Add a Shard to a Cluster
220279
~~~~~~~~~~~~~~~~~~~~~~~~
221280

source/reference/glossary.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,3 +881,5 @@ Glossary
881881
primary shard
882882
For a database in which :term:`sharding` is enabled, the primary
883883
shard holds all un-sharded collections.
884+
885+
.. seealso:: :ref:`sharding-sharded-and-unsharded-data`

0 commit comments

Comments
 (0)