From ac1016fb0eec220da4b70d716e01fe195051ed39 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Wed, 13 Feb 2013 17:44:06 -0500 Subject: [PATCH 01/25] DOCS-1016 document missing sharding shell helpers --- source/reference/method/sh._adminCommand.txt | 19 ++++++++++++++++ source/reference/method/sh._checkFullName.txt | 16 ++++++++++++++ .../reference/method/sh._checkLastError.txt | 7 ++++++ source/reference/method/sh._checkMongos.txt | 14 ++++++++++++ source/reference/method/sh._collRE.txt | 7 ++++++ source/reference/method/sh._dataFormat.txt | 7 ++++++ source/reference/method/sh._lastMigration.txt | 7 ++++++ source/reference/method/sh._pchunk.txt | 7 ++++++ .../reference/method/sh.disableBalancing.txt | 19 ++++++++++++++++ .../reference/method/sh.enableBalancing.txt | 22 +++++++++++++++++++ .../reference/method/sh.getBalancerHost.txt | 19 ++++++++++++++++ .../reference/method/sh.getBalancerState.txt | 12 ++++++++++ .../reference/method/sh.isBalancerRunning.txt | 12 ++++++++++ .../reference/method/sh.setBalancerState.txt | 12 ++++++++++ source/reference/method/sh.startBalancer.txt | 19 ++++++++++++++++ source/reference/method/sh.stopBalancer.txt | 19 ++++++++++++++++ .../reference/method/sh.waitForBalancer.txt | 19 ++++++++++++++++ .../method/sh.waitForBalancerOff.txt | 19 ++++++++++++++++ source/reference/method/sh.waitForDLock.txt | 8 +++++++ .../reference/method/sh.waitForPingChange.txt | 8 +++++++ 20 files changed, 272 insertions(+) create mode 100644 source/reference/method/sh._adminCommand.txt create mode 100644 source/reference/method/sh._checkFullName.txt create mode 100644 source/reference/method/sh._checkLastError.txt create mode 100644 source/reference/method/sh._checkMongos.txt create mode 100644 source/reference/method/sh._collRE.txt create mode 100644 source/reference/method/sh._dataFormat.txt create mode 100644 source/reference/method/sh._lastMigration.txt create mode 100644 source/reference/method/sh._pchunk.txt create mode 100644 source/reference/method/sh.disableBalancing.txt create mode 100644 source/reference/method/sh.enableBalancing.txt create mode 100644 source/reference/method/sh.getBalancerHost.txt create mode 100644 source/reference/method/sh.startBalancer.txt create mode 100644 source/reference/method/sh.stopBalancer.txt create mode 100644 source/reference/method/sh.waitForBalancer.txt create mode 100644 source/reference/method/sh.waitForBalancerOff.txt create mode 100644 source/reference/method/sh.waitForDLock.txt create mode 100644 source/reference/method/sh.waitForPingChange.txt diff --git a/source/reference/method/sh._adminCommand.txt b/source/reference/method/sh._adminCommand.txt new file mode 100644 index 00000000000..86d42d286c1 --- /dev/null +++ b/source/reference/method/sh._adminCommand.txt @@ -0,0 +1,19 @@ +================== +sh._adminCommand() +================== + +.. default-domain:: mongodb + +.. method:: sh._adminCommand(cmd, checkMongos) + + :param string dbcommand: a database command to run against the ``admin`` + database. + :param Boolean checkMongos: verify whether or not the shell is connected + to a :program:`mongos` instance. + + The :method:`sh._adminCommand` method runs a database command against + the admin database of a mongos instance. + +.. seealso:: + + - :method:`db.runCommand` \ No newline at end of file diff --git a/source/reference/method/sh._checkFullName.txt b/source/reference/method/sh._checkFullName.txt new file mode 100644 index 00000000000..77b1c0085b8 --- /dev/null +++ b/source/reference/method/sh._checkFullName.txt @@ -0,0 +1,16 @@ +=================== +sh._checkFullName() +=================== + +.. default-domain:: mongodb + +.. method:: sh._checkFullName(namespace) + + :param string namespace: specify a complete namespace. + + :throws: "name needs to be fully qualified ." + + The :method:`sh._checkFullName()` method verifies that a namespace + name is well-formed. If the name has a period ``.`` then the + :method:`sh._checkFullName()` method exits, otherwise it throws + an error. \ No newline at end of file diff --git a/source/reference/method/sh._checkLastError.txt b/source/reference/method/sh._checkLastError.txt new file mode 100644 index 00000000000..8182310deb0 --- /dev/null +++ b/source/reference/method/sh._checkLastError.txt @@ -0,0 +1,7 @@ +==================== +sh._checkLastError() +==================== + +.. default-domain:: mongodb + +.. method:: sh._checkLastError() diff --git a/source/reference/method/sh._checkMongos.txt b/source/reference/method/sh._checkMongos.txt new file mode 100644 index 00000000000..858dd853b8e --- /dev/null +++ b/source/reference/method/sh._checkMongos.txt @@ -0,0 +1,14 @@ +================= +sh._checkMongos() +================= + +.. default-domain:: mongodb + +.. method:: sh._checkMongos() + + :returns: nothing + :throws: "not connected to a mongos" + + The :method:`sh._checkMongos()` method throws an error message if the + :program:`mongo` shell is not connected to a :program:`mongos` instance. + Otherwise it exits (no return document or return code). \ No newline at end of file diff --git a/source/reference/method/sh._collRE.txt b/source/reference/method/sh._collRE.txt new file mode 100644 index 00000000000..19c88577730 --- /dev/null +++ b/source/reference/method/sh._collRE.txt @@ -0,0 +1,7 @@ +============ +sh._collRE() +============ + +.. default-domain:: mongodb + +.. method:: sh._collRE \ No newline at end of file diff --git a/source/reference/method/sh._dataFormat.txt b/source/reference/method/sh._dataFormat.txt new file mode 100644 index 00000000000..e75b3f2c023 --- /dev/null +++ b/source/reference/method/sh._dataFormat.txt @@ -0,0 +1,7 @@ +================ +sh._dataFormat() +================ + +.. default-domain:: mongodb + +.. method:: sh._dataFormat() \ No newline at end of file diff --git a/source/reference/method/sh._lastMigration.txt b/source/reference/method/sh._lastMigration.txt new file mode 100644 index 00000000000..2dfefdd5927 --- /dev/null +++ b/source/reference/method/sh._lastMigration.txt @@ -0,0 +1,7 @@ +=================== +sh._lastMigration() +=================== + +.. default-domain:: mongodb + +.. method:: sh._lastMigration() \ No newline at end of file diff --git a/source/reference/method/sh._pchunk.txt b/source/reference/method/sh._pchunk.txt new file mode 100644 index 00000000000..834260b7d89 --- /dev/null +++ b/source/reference/method/sh._pchunk.txt @@ -0,0 +1,7 @@ +============ +sh._pchunk() +============ + +.. default-domain:: mongodb + +.. method:: sh._pchunk() diff --git a/source/reference/method/sh.disableBalancing.txt b/source/reference/method/sh.disableBalancing.txt new file mode 100644 index 00000000000..d6c238d3bb1 --- /dev/null +++ b/source/reference/method/sh.disableBalancing.txt @@ -0,0 +1,19 @@ +===================== +sh.disableBalancing() +===================== + +.. default-domain:: mongodb + +.. method:: sh.disableBalancing() + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.getBalancerHost()` + - :method:`sh.getBalancerState()` + - :method:`sh.isBalancerRunning()` + - :method:`sh.setBalancerState()` + - :method:`sh.startBalancer()` + - :method:`sh.stopBalancer()` + - :method:`sh.waitForBalancer()` + - :method:`sh.waitForBalancerOff()` diff --git a/source/reference/method/sh.enableBalancing.txt b/source/reference/method/sh.enableBalancing.txt new file mode 100644 index 00000000000..753fdd4ddb6 --- /dev/null +++ b/source/reference/method/sh.enableBalancing.txt @@ -0,0 +1,22 @@ +==================== +sh.enableBalancing() +==================== + +.. default-domain:: mongodb + +.. method:: sh.enableBalancing() + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.disableBalancing()` + - :method:`sh.getBalancerHost()` + - :method:`sh.getBalancerState()` + - :method:`sh.isBalancerRunning()` + - :method:`sh.setBalancerState()` + - :method:`sh.startBalancer()` + - :method:`sh.stopBalancer()` + - :method:`sh.waitForBalancer()` + - :method:`sh.waitForBalancerOff()` + + diff --git a/source/reference/method/sh.getBalancerHost.txt b/source/reference/method/sh.getBalancerHost.txt new file mode 100644 index 00000000000..4d6fa7c0568 --- /dev/null +++ b/source/reference/method/sh.getBalancerHost.txt @@ -0,0 +1,19 @@ +==================== +sh.getBalancerHost() +==================== + +.. default-domain:: mongodb + +.. method:: sh.getBalancerHost() + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.disableBalancing()` + - :method:`sh.getBalancerState()` + - :method:`sh.isBalancerRunning()` + - :method:`sh.setBalancerState()` + - :method:`sh.startBalancer()` + - :method:`sh.stopBalancer()` + - :method:`sh.waitForBalancer()` + - :method:`sh.waitForBalancerOff()` diff --git a/source/reference/method/sh.getBalancerState.txt b/source/reference/method/sh.getBalancerState.txt index 447948874c1..7ab82d762d5 100644 --- a/source/reference/method/sh.getBalancerState.txt +++ b/source/reference/method/sh.getBalancerState.txt @@ -13,3 +13,15 @@ sh.getBalancerState() disabled. This does not reflect the current state of balancing operations: use :method:`sh.isBalancerRunning()` to check the balancer's current state. + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.disableBalancing()` + - :method:`sh.getBalancerHost()` + - :method:`sh.isBalancerRunning()` + - :method:`sh.setBalancerState()` + - :method:`sh.startBalancer()` + - :method:`sh.stopBalancer()` + - :method:`sh.waitForBalancer()` + - :method:`sh.waitForBalancerOff()` diff --git a/source/reference/method/sh.isBalancerRunning.txt b/source/reference/method/sh.isBalancerRunning.txt index b1d9e7d8f66..3b89110e06f 100644 --- a/source/reference/method/sh.isBalancerRunning.txt +++ b/source/reference/method/sh.isBalancerRunning.txt @@ -12,3 +12,15 @@ sh.isBalancerRunning() and migrating chunks and false if the balancer process is not running. Use :method:`sh.getBalancerState()` to determine if the balancer is enabled or disabled. + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.disableBalancing()` + - :method:`sh.getBalancerHost()` + - :method:`sh.getBalancerState()` + - :method:`sh.setBalancerState()` + - :method:`sh.startBalancer()` + - :method:`sh.stopBalancer()` + - :method:`sh.waitForBalancer()` + - :method:`sh.waitForBalancerOff()` diff --git a/source/reference/method/sh.setBalancerState.txt b/source/reference/method/sh.setBalancerState.txt index 2dda05a7e73..49c7facbd94 100644 --- a/source/reference/method/sh.setBalancerState.txt +++ b/source/reference/method/sh.setBalancerState.txt @@ -13,3 +13,15 @@ sh.setBalancerState() :method:`sh.getBalancerState()` to determine if the balancer is currently enabled or disabled and :method:`sh.isBalancerRunning()` to check its current state. + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.disableBalancing()` + - :method:`sh.getBalancerHost()` + - :method:`sh.getBalancerState()` + - :method:`sh.isBalancerRunning()` + - :method:`sh.startBalancer()` + - :method:`sh.stopBalancer()` + - :method:`sh.waitForBalancer()` + - :method:`sh.waitForBalancerOff()` diff --git a/source/reference/method/sh.startBalancer.txt b/source/reference/method/sh.startBalancer.txt new file mode 100644 index 00000000000..f87f711722e --- /dev/null +++ b/source/reference/method/sh.startBalancer.txt @@ -0,0 +1,19 @@ +================== +sh.startBalancer() +================== + +.. default-domain:: mongodb + +.. method:: sh.startBalancer() + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.disableBalancing()` + - :method:`sh.getBalancerHost()` + - :method:`sh.getBalancerState()` + - :method:`sh.isBalancerRunning()` + - :method:`sh.setBalancerState()` + - :method:`sh.stopBalancer()` + - :method:`sh.waitForBalancer()` + - :method:`sh.waitForBalancerOff()` diff --git a/source/reference/method/sh.stopBalancer.txt b/source/reference/method/sh.stopBalancer.txt new file mode 100644 index 00000000000..8036e67038d --- /dev/null +++ b/source/reference/method/sh.stopBalancer.txt @@ -0,0 +1,19 @@ +================= +sh.stopBalancer() +================= + +.. default-domain:: mongodb + +.. method:: sh.stopBalancer() + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.disableBalancing()` + - :method:`sh.getBalancerHost()` + - :method:`sh.getBalancerState()` + - :method:`sh.isBalancerRunning()` + - :method:`sh.setBalancerState()` + - :method:`sh.startBalancer()` + - :method:`sh.waitForBalancer()` + - :method:`sh.waitForBalancerOff()` diff --git a/source/reference/method/sh.waitForBalancer.txt b/source/reference/method/sh.waitForBalancer.txt new file mode 100644 index 00000000000..34477d6c7a5 --- /dev/null +++ b/source/reference/method/sh.waitForBalancer.txt @@ -0,0 +1,19 @@ +==================== +sh.waitForBalancer() +==================== + +.. default-domain:: mongodb + +.. method:: sh.waitForBalancer() + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.disableBalancing()` + - :method:`sh.getBalancerHost()` + - :method:`sh.getBalancerState()` + - :method:`sh.isBalancerRunning()` + - :method:`sh.setBalancerState()` + - :method:`sh.startBalancer()` + - :method:`sh.stopBalancer()` + - :method:`sh.waitForBalancerOff()` diff --git a/source/reference/method/sh.waitForBalancerOff.txt b/source/reference/method/sh.waitForBalancerOff.txt new file mode 100644 index 00000000000..17c38025402 --- /dev/null +++ b/source/reference/method/sh.waitForBalancerOff.txt @@ -0,0 +1,19 @@ +==================== +sh.waitForBalancerOff() +==================== + +.. default-domain:: mongodb + +.. method:: sh.waitForBalancerOff() + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.disableBalancing()` + - :method:`sh.getBalancerHost()` + - :method:`sh.getBalancerState()` + - :method:`sh.isBalancerRunning()` + - :method:`sh.setBalancerState()` + - :method:`sh.startBalancer()` + - :method:`sh.stopBalancer()` + - :method:`sh.waitForBalancer()` diff --git a/source/reference/method/sh.waitForDLock.txt b/source/reference/method/sh.waitForDLock.txt new file mode 100644 index 00000000000..b30c44a8a64 --- /dev/null +++ b/source/reference/method/sh.waitForDLock.txt @@ -0,0 +1,8 @@ +==================== +sh.waitForDLock() +==================== + +.. default-domain:: mongodb + +.. method:: sh.waitForDLock() + diff --git a/source/reference/method/sh.waitForPingChange.txt b/source/reference/method/sh.waitForPingChange.txt new file mode 100644 index 00000000000..be0064f15a2 --- /dev/null +++ b/source/reference/method/sh.waitForPingChange.txt @@ -0,0 +1,8 @@ +====================== +sh.waitForPingChange() +====================== + +.. default-domain:: mongodb + +.. method:: sh.waitForPingChange() + From fa18288cd3bc37a1996f63f3e81e54645fb1b51b Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Thu, 14 Feb 2013 18:01:18 -0500 Subject: [PATCH 02/25] DOCS-1016 copy edits & more for shard helpers --- source/reference/method/sh._adminCommand.txt | 2 +- .../reference/method/sh._checkLastError.txt | 7 --- source/reference/method/sh._collRE.txt | 8 +--- source/reference/method/sh._dataFormat.txt | 8 +--- source/reference/method/sh._lastMigration.txt | 29 ++++++++++- source/reference/method/sh._pchunk.txt | 8 +--- source/reference/method/sh.addTagRange.txt | 48 ++++++++++++------- .../reference/method/sh.disableBalancing.txt | 7 ++- .../reference/method/sh.enableBalancing.txt | 14 +++--- source/reference/method/sh.enableSharding.txt | 7 ++- .../reference/method/sh.getBalancerHost.txt | 5 ++ .../reference/method/sh.getBalancerState.txt | 2 +- source/reference/method/sh.startBalancer.txt | 9 +++- source/reference/method/sh.stopBalancer.txt | 11 ++++- .../reference/method/sh.waitForBalancer.txt | 13 ++++- .../method/sh.waitForBalancerOff.txt | 12 ++++- source/reference/method/sh.waitForDLock.txt | 13 ++++- .../reference/method/sh.waitForPingChange.txt | 9 +++- 18 files changed, 148 insertions(+), 64 deletions(-) diff --git a/source/reference/method/sh._adminCommand.txt b/source/reference/method/sh._adminCommand.txt index 86d42d286c1..53f5ca966ab 100644 --- a/source/reference/method/sh._adminCommand.txt +++ b/source/reference/method/sh._adminCommand.txt @@ -12,7 +12,7 @@ sh._adminCommand() to a :program:`mongos` instance. The :method:`sh._adminCommand` method runs a database command against - the admin database of a mongos instance. + the admin database of a :program:`mongos` instance. .. seealso:: diff --git a/source/reference/method/sh._checkLastError.txt b/source/reference/method/sh._checkLastError.txt index 8182310deb0..e69de29bb2d 100644 --- a/source/reference/method/sh._checkLastError.txt +++ b/source/reference/method/sh._checkLastError.txt @@ -1,7 +0,0 @@ -==================== -sh._checkLastError() -==================== - -.. default-domain:: mongodb - -.. method:: sh._checkLastError() diff --git a/source/reference/method/sh._collRE.txt b/source/reference/method/sh._collRE.txt index 19c88577730..af6d12954ab 100644 --- a/source/reference/method/sh._collRE.txt +++ b/source/reference/method/sh._collRE.txt @@ -1,7 +1 @@ -============ -sh._collRE() -============ - -.. default-domain:: mongodb - -.. method:: sh._collRE \ No newline at end of file +remove \ No newline at end of file diff --git a/source/reference/method/sh._dataFormat.txt b/source/reference/method/sh._dataFormat.txt index e75b3f2c023..af6d12954ab 100644 --- a/source/reference/method/sh._dataFormat.txt +++ b/source/reference/method/sh._dataFormat.txt @@ -1,7 +1 @@ -================ -sh._dataFormat() -================ - -.. default-domain:: mongodb - -.. method:: sh._dataFormat() \ No newline at end of file +remove \ No newline at end of file diff --git a/source/reference/method/sh._lastMigration.txt b/source/reference/method/sh._lastMigration.txt index 2dfefdd5927..377671ac3de 100644 --- a/source/reference/method/sh._lastMigration.txt +++ b/source/reference/method/sh._lastMigration.txt @@ -4,4 +4,31 @@ sh._lastMigration() .. default-domain:: mongodb -.. method:: sh._lastMigration() \ No newline at end of file +.. method:: sh._lastMigration(namespace) + + :param string namespace: The name of a database or collection within the + current database. + + :method:`sh._lastMigration()` returns a document with details about + the last migration performed on the database or collection you specify. + + :returns: a document with fields detailing the most recent migration + in the specified namespace. + + :field string _id: the id of the migration task + + :field string server: the name of the server + + :field string clientAddr: the IP address and port number of the server. + + :field ISODate time: the time of the last migration. + + :field string what: the specific type of migration. + + :field string ns: the complete namespace of the collection affected + by the migration. + + :field document details: a document containing details about the + migrated chunk. Includes ``min`` and ``max`` + sub-documents with the bounds of the migrated + chunk \ No newline at end of file diff --git a/source/reference/method/sh._pchunk.txt b/source/reference/method/sh._pchunk.txt index 834260b7d89..af6d12954ab 100644 --- a/source/reference/method/sh._pchunk.txt +++ b/source/reference/method/sh._pchunk.txt @@ -1,7 +1 @@ -============ -sh._pchunk() -============ - -.. default-domain:: mongodb - -.. method:: sh._pchunk() +remove \ No newline at end of file diff --git a/source/reference/method/sh.addTagRange.txt b/source/reference/method/sh.addTagRange.txt index 284e5f847bc..7ed440ed968 100644 --- a/source/reference/method/sh.addTagRange.txt +++ b/source/reference/method/sh.addTagRange.txt @@ -8,22 +8,22 @@ sh.addTagRange() .. versionadded:: 2.2 - :param namespace: Specifies the namespace, in the form of - ``.`` of the sharded - collection that you would like to tag. - - :param minimum: Specifies the minimum value of the - :term:`shard key` range to include in the tag. - Specify the minimum value in the form of - ``:``. - This value must be of the same BSON type or types - as the shard key. - - :param maximum: Specifies the maximum value of the shard key range - to include in the tag. Specify the maximum value - in the form of ``:``. - This value must be of the same BSON type or types - as the shard key. + :param string namespace: Specifies the namespace, in the form of + ``.`` of the sharded + collection that you would like to tag. + + :param document minimum: Specifies the minimum value of the + :term:`shard key` range to include in the tag. + Specify the minimum value in the form of + ``:``. + This value must be of the same BSON type or types + as the shard key. + + :param document maximum: Specifies the maximum value of the shard key range + to include in the tag. Specify the maximum value + in the form of ``:``. + This value must be of the same BSON type or types + as the shard key. :param string tag: Specifies the name of the tag to attach the range specified by the ``minimum`` and ``maximum`` @@ -37,7 +37,21 @@ sh.addTagRange() Always issue :method:`sh.addTagRange()` when connected to a :program:`mongos` instance. - + + .. example:: + + Given a shard key of ``{STATE:1,ZIP:1}``, create a tag range covering + ZIP codes in New York State: + + .. code-block:: javascript + + sh.addTagRange( "exampledb.collection", + {STATE: "NY", ZIP: {minKey:1}}, + {STATE:"NY", ZIP: {maxKey:1}}, + "NY" + ) + + .. seealso:: :method:`sh.addShardTag()`, diff --git a/source/reference/method/sh.disableBalancing.txt b/source/reference/method/sh.disableBalancing.txt index d6c238d3bb1..6cb203fd59b 100644 --- a/source/reference/method/sh.disableBalancing.txt +++ b/source/reference/method/sh.disableBalancing.txt @@ -4,7 +4,12 @@ sh.disableBalancing() .. default-domain:: mongodb -.. method:: sh.disableBalancing() +.. method:: sh.disableBalancing(collection) + + :param string collection: the name of a collection. + + :method:`sh.disableBalancing()` disables the balancer for the specified + sharded collection. .. seealso:: diff --git a/source/reference/method/sh.enableBalancing.txt b/source/reference/method/sh.enableBalancing.txt index 753fdd4ddb6..baaf7e40f55 100644 --- a/source/reference/method/sh.enableBalancing.txt +++ b/source/reference/method/sh.enableBalancing.txt @@ -1,14 +1,18 @@ -==================== +===================== sh.enableBalancing() -==================== +===================== .. default-domain:: mongodb -.. method:: sh.enableBalancing() +.. method:: sh.enableBalancing(collection) + + :param string collection: the name of a collection. + + :method:`sh.enableBalancing()` enables the balancer for the specified + sharded collection. .. seealso:: - - :method:`sh.enableBalancing()` - :method:`sh.disableBalancing()` - :method:`sh.getBalancerHost()` - :method:`sh.getBalancerState()` @@ -18,5 +22,3 @@ sh.enableBalancing() - :method:`sh.stopBalancer()` - :method:`sh.waitForBalancer()` - :method:`sh.waitForBalancerOff()` - - diff --git a/source/reference/method/sh.enableSharding.txt b/source/reference/method/sh.enableSharding.txt index 824edffb541..04fc899b19c 100644 --- a/source/reference/method/sh.enableSharding.txt +++ b/source/reference/method/sh.enableSharding.txt @@ -6,8 +6,13 @@ sh.enableSharding() .. method:: sh.enableSharding(database) - :param name database: Specify a database name to shard. + :param string database: Specify a database name to shard. Enables sharding on the specified database. This does not automatically shard any collections, but makes it possible to begin sharding collections using :method:`sh.shardCollection()`. + +.. seealso:: + + - :ref:`sh.shardCollection()` + \ No newline at end of file diff --git a/source/reference/method/sh.getBalancerHost.txt b/source/reference/method/sh.getBalancerHost.txt index 4d6fa7c0568..fcaefd86745 100644 --- a/source/reference/method/sh.getBalancerHost.txt +++ b/source/reference/method/sh.getBalancerHost.txt @@ -6,6 +6,11 @@ sh.getBalancerHost() .. method:: sh.getBalancerHost() + :returns: string in form :samp:`{hostname}:{port}` + + :method:`sh.getBalancerHost()` returns the name of the server that is + running the balancer. + .. seealso:: - :method:`sh.enableBalancing()` diff --git a/source/reference/method/sh.getBalancerState.txt b/source/reference/method/sh.getBalancerState.txt index 7ab82d762d5..61a27eca4f4 100644 --- a/source/reference/method/sh.getBalancerState.txt +++ b/source/reference/method/sh.getBalancerState.txt @@ -6,7 +6,7 @@ sh.getBalancerState() .. method:: sh.getBalancerState() - :returns: boolean. + :returns: Boolean. :method:`sh.getBalancerState()` returns ``true`` when the :term:`balancer` is enabled and false if the balancer is diff --git a/source/reference/method/sh.startBalancer.txt b/source/reference/method/sh.startBalancer.txt index f87f711722e..9c79dd471f0 100644 --- a/source/reference/method/sh.startBalancer.txt +++ b/source/reference/method/sh.startBalancer.txt @@ -4,7 +4,14 @@ sh.startBalancer() .. default-domain:: mongodb -.. method:: sh.startBalancer() +.. method:: sh.startBalancer(timeout, interval) + + :param integer timeout: milliseconds to wait. + + :param integer interval: milliseconds to sleep each cycle of waiting. + + The :method:`sh.startBalancer()` enables the balancer in a sharded + cluster and waits for balancing to initiate. .. seealso:: diff --git a/source/reference/method/sh.stopBalancer.txt b/source/reference/method/sh.stopBalancer.txt index 8036e67038d..2cb3fffe2c9 100644 --- a/source/reference/method/sh.stopBalancer.txt +++ b/source/reference/method/sh.stopBalancer.txt @@ -4,8 +4,15 @@ sh.stopBalancer() .. default-domain:: mongodb -.. method:: sh.stopBalancer() - +.. method:: sh.stopBalancer(timeout, interval) + + :param integer timeout: milliseconds to wait. + + :param integer interval: milliseconds to sleep each cycle of waiting. + + The :method:`sh.stopBalancer()` disables the balancer in a sharded + cluster and waits for balancing to complete. + .. seealso:: - :method:`sh.enableBalancing()` diff --git a/source/reference/method/sh.waitForBalancer.txt b/source/reference/method/sh.waitForBalancer.txt index 34477d6c7a5..171e714e32c 100644 --- a/source/reference/method/sh.waitForBalancer.txt +++ b/source/reference/method/sh.waitForBalancer.txt @@ -4,8 +4,19 @@ sh.waitForBalancer() .. default-domain:: mongodb -.. method:: sh.waitForBalancer() +.. method:: sh.waitForBalancer(onOrNot, timeout, interval) + :param Boolean onOrNot: whether to wait for the lock to be + on (``true``) or off (``false``). + + :param integer timeout: milliseconds to wait. + + :param integer interval: milliseconds to sleep. + + + :method:`sh.waitForBalancer()` is an internal method that waits for + a change in the state of the balancer. + .. seealso:: - :method:`sh.enableBalancing()` diff --git a/source/reference/method/sh.waitForBalancerOff.txt b/source/reference/method/sh.waitForBalancerOff.txt index 17c38025402..99bf27dcb58 100644 --- a/source/reference/method/sh.waitForBalancerOff.txt +++ b/source/reference/method/sh.waitForBalancerOff.txt @@ -1,11 +1,19 @@ -==================== +======================= sh.waitForBalancerOff() -==================== +======================= .. default-domain:: mongodb .. method:: sh.waitForBalancerOff() + :param integer timeout: milliseconds to wait. + + :param integer interval: milliseconds to sleep. + + :method:`sh.waitForBalancerOff()` is an internal method that waits + until the balancer is not running. + + .. seealso:: - :method:`sh.enableBalancing()` diff --git a/source/reference/method/sh.waitForDLock.txt b/source/reference/method/sh.waitForDLock.txt index b30c44a8a64..a764b15880f 100644 --- a/source/reference/method/sh.waitForDLock.txt +++ b/source/reference/method/sh.waitForDLock.txt @@ -4,5 +4,16 @@ sh.waitForDLock() .. default-domain:: mongodb -.. method:: sh.waitForDLock() +.. method:: sh.waitForDLock(lockId, onOrNot, timeout, interval) + :param string lockId: the name of the lock. + + :param Boolean onOrNot: optional, whether to wait for the lock to be + on (``true``) or off (``false``). + + :param integer timeout: milliseconds to wait. + + :param integer interval: milliseconds to sleep in each waiting cycle. + + :method:`sh.waitForDLock()` is an internal method that waits until + the specified lock is changes state. diff --git a/source/reference/method/sh.waitForPingChange.txt b/source/reference/method/sh.waitForPingChange.txt index be0064f15a2..760981c9da7 100644 --- a/source/reference/method/sh.waitForPingChange.txt +++ b/source/reference/method/sh.waitForPingChange.txt @@ -4,5 +4,12 @@ sh.waitForPingChange() .. default-domain:: mongodb -.. method:: sh.waitForPingChange() +.. method:: sh.waitForPingChange(activepings, timeout, interval) + :param array activepings: an array of active pings from the + ``config.mongos`` collection. + + :param integer timeout: milliseconds to wait for a change in ping state. + + :param integer interval: milliseconds to sleep in each waiting cycle. + \ No newline at end of file From b55eca70dfaaf8b9ae7e778ae45ef0f298663dc8 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Thu, 14 Feb 2013 18:03:11 -0500 Subject: [PATCH 03/25] DOCS-1016 remove several commands which are internal and rarely used --- source/reference/method/sh._checkLastError.txt | 0 source/reference/method/sh._collRE.txt | 1 - source/reference/method/sh._dataFormat.txt | 1 - source/reference/method/sh._pchunk.txt | 1 - 4 files changed, 3 deletions(-) delete mode 100644 source/reference/method/sh._checkLastError.txt delete mode 100644 source/reference/method/sh._collRE.txt delete mode 100644 source/reference/method/sh._dataFormat.txt delete mode 100644 source/reference/method/sh._pchunk.txt diff --git a/source/reference/method/sh._checkLastError.txt b/source/reference/method/sh._checkLastError.txt deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/source/reference/method/sh._collRE.txt b/source/reference/method/sh._collRE.txt deleted file mode 100644 index af6d12954ab..00000000000 --- a/source/reference/method/sh._collRE.txt +++ /dev/null @@ -1 +0,0 @@ -remove \ No newline at end of file diff --git a/source/reference/method/sh._dataFormat.txt b/source/reference/method/sh._dataFormat.txt deleted file mode 100644 index af6d12954ab..00000000000 --- a/source/reference/method/sh._dataFormat.txt +++ /dev/null @@ -1 +0,0 @@ -remove \ No newline at end of file diff --git a/source/reference/method/sh._pchunk.txt b/source/reference/method/sh._pchunk.txt deleted file mode 100644 index af6d12954ab..00000000000 --- a/source/reference/method/sh._pchunk.txt +++ /dev/null @@ -1 +0,0 @@ -remove \ No newline at end of file From 3bddf1c6eefda2b0f1b9d2cefae4538c5f9075ad Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Wed, 13 Feb 2013 17:44:06 -0500 Subject: [PATCH 04/25] DOCS-1016 document missing sharding shell helpers --- source/reference/method/sh._adminCommand.txt | 19 ++++++++++++++++ source/reference/method/sh._checkFullName.txt | 16 ++++++++++++++ .../reference/method/sh._checkLastError.txt | 7 ++++++ source/reference/method/sh._checkMongos.txt | 14 ++++++++++++ source/reference/method/sh._collRE.txt | 7 ++++++ source/reference/method/sh._dataFormat.txt | 7 ++++++ source/reference/method/sh._lastMigration.txt | 7 ++++++ source/reference/method/sh._pchunk.txt | 7 ++++++ .../reference/method/sh.disableBalancing.txt | 19 ++++++++++++++++ .../reference/method/sh.enableBalancing.txt | 22 +++++++++++++++++++ .../reference/method/sh.getBalancerHost.txt | 19 ++++++++++++++++ .../reference/method/sh.getBalancerState.txt | 12 ++++++++++ .../reference/method/sh.isBalancerRunning.txt | 12 ++++++++++ .../reference/method/sh.setBalancerState.txt | 12 ++++++++++ source/reference/method/sh.startBalancer.txt | 19 ++++++++++++++++ source/reference/method/sh.stopBalancer.txt | 19 ++++++++++++++++ .../reference/method/sh.waitForBalancer.txt | 19 ++++++++++++++++ .../method/sh.waitForBalancerOff.txt | 19 ++++++++++++++++ source/reference/method/sh.waitForDLock.txt | 8 +++++++ .../reference/method/sh.waitForPingChange.txt | 8 +++++++ 20 files changed, 272 insertions(+) create mode 100644 source/reference/method/sh._adminCommand.txt create mode 100644 source/reference/method/sh._checkFullName.txt create mode 100644 source/reference/method/sh._checkLastError.txt create mode 100644 source/reference/method/sh._checkMongos.txt create mode 100644 source/reference/method/sh._collRE.txt create mode 100644 source/reference/method/sh._dataFormat.txt create mode 100644 source/reference/method/sh._lastMigration.txt create mode 100644 source/reference/method/sh._pchunk.txt create mode 100644 source/reference/method/sh.disableBalancing.txt create mode 100644 source/reference/method/sh.enableBalancing.txt create mode 100644 source/reference/method/sh.getBalancerHost.txt create mode 100644 source/reference/method/sh.startBalancer.txt create mode 100644 source/reference/method/sh.stopBalancer.txt create mode 100644 source/reference/method/sh.waitForBalancer.txt create mode 100644 source/reference/method/sh.waitForBalancerOff.txt create mode 100644 source/reference/method/sh.waitForDLock.txt create mode 100644 source/reference/method/sh.waitForPingChange.txt diff --git a/source/reference/method/sh._adminCommand.txt b/source/reference/method/sh._adminCommand.txt new file mode 100644 index 00000000000..86d42d286c1 --- /dev/null +++ b/source/reference/method/sh._adminCommand.txt @@ -0,0 +1,19 @@ +================== +sh._adminCommand() +================== + +.. default-domain:: mongodb + +.. method:: sh._adminCommand(cmd, checkMongos) + + :param string dbcommand: a database command to run against the ``admin`` + database. + :param Boolean checkMongos: verify whether or not the shell is connected + to a :program:`mongos` instance. + + The :method:`sh._adminCommand` method runs a database command against + the admin database of a mongos instance. + +.. seealso:: + + - :method:`db.runCommand` \ No newline at end of file diff --git a/source/reference/method/sh._checkFullName.txt b/source/reference/method/sh._checkFullName.txt new file mode 100644 index 00000000000..77b1c0085b8 --- /dev/null +++ b/source/reference/method/sh._checkFullName.txt @@ -0,0 +1,16 @@ +=================== +sh._checkFullName() +=================== + +.. default-domain:: mongodb + +.. method:: sh._checkFullName(namespace) + + :param string namespace: specify a complete namespace. + + :throws: "name needs to be fully qualified ." + + The :method:`sh._checkFullName()` method verifies that a namespace + name is well-formed. If the name has a period ``.`` then the + :method:`sh._checkFullName()` method exits, otherwise it throws + an error. \ No newline at end of file diff --git a/source/reference/method/sh._checkLastError.txt b/source/reference/method/sh._checkLastError.txt new file mode 100644 index 00000000000..8182310deb0 --- /dev/null +++ b/source/reference/method/sh._checkLastError.txt @@ -0,0 +1,7 @@ +==================== +sh._checkLastError() +==================== + +.. default-domain:: mongodb + +.. method:: sh._checkLastError() diff --git a/source/reference/method/sh._checkMongos.txt b/source/reference/method/sh._checkMongos.txt new file mode 100644 index 00000000000..858dd853b8e --- /dev/null +++ b/source/reference/method/sh._checkMongos.txt @@ -0,0 +1,14 @@ +================= +sh._checkMongos() +================= + +.. default-domain:: mongodb + +.. method:: sh._checkMongos() + + :returns: nothing + :throws: "not connected to a mongos" + + The :method:`sh._checkMongos()` method throws an error message if the + :program:`mongo` shell is not connected to a :program:`mongos` instance. + Otherwise it exits (no return document or return code). \ No newline at end of file diff --git a/source/reference/method/sh._collRE.txt b/source/reference/method/sh._collRE.txt new file mode 100644 index 00000000000..19c88577730 --- /dev/null +++ b/source/reference/method/sh._collRE.txt @@ -0,0 +1,7 @@ +============ +sh._collRE() +============ + +.. default-domain:: mongodb + +.. method:: sh._collRE \ No newline at end of file diff --git a/source/reference/method/sh._dataFormat.txt b/source/reference/method/sh._dataFormat.txt new file mode 100644 index 00000000000..e75b3f2c023 --- /dev/null +++ b/source/reference/method/sh._dataFormat.txt @@ -0,0 +1,7 @@ +================ +sh._dataFormat() +================ + +.. default-domain:: mongodb + +.. method:: sh._dataFormat() \ No newline at end of file diff --git a/source/reference/method/sh._lastMigration.txt b/source/reference/method/sh._lastMigration.txt new file mode 100644 index 00000000000..2dfefdd5927 --- /dev/null +++ b/source/reference/method/sh._lastMigration.txt @@ -0,0 +1,7 @@ +=================== +sh._lastMigration() +=================== + +.. default-domain:: mongodb + +.. method:: sh._lastMigration() \ No newline at end of file diff --git a/source/reference/method/sh._pchunk.txt b/source/reference/method/sh._pchunk.txt new file mode 100644 index 00000000000..834260b7d89 --- /dev/null +++ b/source/reference/method/sh._pchunk.txt @@ -0,0 +1,7 @@ +============ +sh._pchunk() +============ + +.. default-domain:: mongodb + +.. method:: sh._pchunk() diff --git a/source/reference/method/sh.disableBalancing.txt b/source/reference/method/sh.disableBalancing.txt new file mode 100644 index 00000000000..d6c238d3bb1 --- /dev/null +++ b/source/reference/method/sh.disableBalancing.txt @@ -0,0 +1,19 @@ +===================== +sh.disableBalancing() +===================== + +.. default-domain:: mongodb + +.. method:: sh.disableBalancing() + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.getBalancerHost()` + - :method:`sh.getBalancerState()` + - :method:`sh.isBalancerRunning()` + - :method:`sh.setBalancerState()` + - :method:`sh.startBalancer()` + - :method:`sh.stopBalancer()` + - :method:`sh.waitForBalancer()` + - :method:`sh.waitForBalancerOff()` diff --git a/source/reference/method/sh.enableBalancing.txt b/source/reference/method/sh.enableBalancing.txt new file mode 100644 index 00000000000..753fdd4ddb6 --- /dev/null +++ b/source/reference/method/sh.enableBalancing.txt @@ -0,0 +1,22 @@ +==================== +sh.enableBalancing() +==================== + +.. default-domain:: mongodb + +.. method:: sh.enableBalancing() + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.disableBalancing()` + - :method:`sh.getBalancerHost()` + - :method:`sh.getBalancerState()` + - :method:`sh.isBalancerRunning()` + - :method:`sh.setBalancerState()` + - :method:`sh.startBalancer()` + - :method:`sh.stopBalancer()` + - :method:`sh.waitForBalancer()` + - :method:`sh.waitForBalancerOff()` + + diff --git a/source/reference/method/sh.getBalancerHost.txt b/source/reference/method/sh.getBalancerHost.txt new file mode 100644 index 00000000000..4d6fa7c0568 --- /dev/null +++ b/source/reference/method/sh.getBalancerHost.txt @@ -0,0 +1,19 @@ +==================== +sh.getBalancerHost() +==================== + +.. default-domain:: mongodb + +.. method:: sh.getBalancerHost() + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.disableBalancing()` + - :method:`sh.getBalancerState()` + - :method:`sh.isBalancerRunning()` + - :method:`sh.setBalancerState()` + - :method:`sh.startBalancer()` + - :method:`sh.stopBalancer()` + - :method:`sh.waitForBalancer()` + - :method:`sh.waitForBalancerOff()` diff --git a/source/reference/method/sh.getBalancerState.txt b/source/reference/method/sh.getBalancerState.txt index 447948874c1..7ab82d762d5 100644 --- a/source/reference/method/sh.getBalancerState.txt +++ b/source/reference/method/sh.getBalancerState.txt @@ -13,3 +13,15 @@ sh.getBalancerState() disabled. This does not reflect the current state of balancing operations: use :method:`sh.isBalancerRunning()` to check the balancer's current state. + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.disableBalancing()` + - :method:`sh.getBalancerHost()` + - :method:`sh.isBalancerRunning()` + - :method:`sh.setBalancerState()` + - :method:`sh.startBalancer()` + - :method:`sh.stopBalancer()` + - :method:`sh.waitForBalancer()` + - :method:`sh.waitForBalancerOff()` diff --git a/source/reference/method/sh.isBalancerRunning.txt b/source/reference/method/sh.isBalancerRunning.txt index b1d9e7d8f66..3b89110e06f 100644 --- a/source/reference/method/sh.isBalancerRunning.txt +++ b/source/reference/method/sh.isBalancerRunning.txt @@ -12,3 +12,15 @@ sh.isBalancerRunning() and migrating chunks and false if the balancer process is not running. Use :method:`sh.getBalancerState()` to determine if the balancer is enabled or disabled. + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.disableBalancing()` + - :method:`sh.getBalancerHost()` + - :method:`sh.getBalancerState()` + - :method:`sh.setBalancerState()` + - :method:`sh.startBalancer()` + - :method:`sh.stopBalancer()` + - :method:`sh.waitForBalancer()` + - :method:`sh.waitForBalancerOff()` diff --git a/source/reference/method/sh.setBalancerState.txt b/source/reference/method/sh.setBalancerState.txt index 2dda05a7e73..49c7facbd94 100644 --- a/source/reference/method/sh.setBalancerState.txt +++ b/source/reference/method/sh.setBalancerState.txt @@ -13,3 +13,15 @@ sh.setBalancerState() :method:`sh.getBalancerState()` to determine if the balancer is currently enabled or disabled and :method:`sh.isBalancerRunning()` to check its current state. + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.disableBalancing()` + - :method:`sh.getBalancerHost()` + - :method:`sh.getBalancerState()` + - :method:`sh.isBalancerRunning()` + - :method:`sh.startBalancer()` + - :method:`sh.stopBalancer()` + - :method:`sh.waitForBalancer()` + - :method:`sh.waitForBalancerOff()` diff --git a/source/reference/method/sh.startBalancer.txt b/source/reference/method/sh.startBalancer.txt new file mode 100644 index 00000000000..f87f711722e --- /dev/null +++ b/source/reference/method/sh.startBalancer.txt @@ -0,0 +1,19 @@ +================== +sh.startBalancer() +================== + +.. default-domain:: mongodb + +.. method:: sh.startBalancer() + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.disableBalancing()` + - :method:`sh.getBalancerHost()` + - :method:`sh.getBalancerState()` + - :method:`sh.isBalancerRunning()` + - :method:`sh.setBalancerState()` + - :method:`sh.stopBalancer()` + - :method:`sh.waitForBalancer()` + - :method:`sh.waitForBalancerOff()` diff --git a/source/reference/method/sh.stopBalancer.txt b/source/reference/method/sh.stopBalancer.txt new file mode 100644 index 00000000000..8036e67038d --- /dev/null +++ b/source/reference/method/sh.stopBalancer.txt @@ -0,0 +1,19 @@ +================= +sh.stopBalancer() +================= + +.. default-domain:: mongodb + +.. method:: sh.stopBalancer() + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.disableBalancing()` + - :method:`sh.getBalancerHost()` + - :method:`sh.getBalancerState()` + - :method:`sh.isBalancerRunning()` + - :method:`sh.setBalancerState()` + - :method:`sh.startBalancer()` + - :method:`sh.waitForBalancer()` + - :method:`sh.waitForBalancerOff()` diff --git a/source/reference/method/sh.waitForBalancer.txt b/source/reference/method/sh.waitForBalancer.txt new file mode 100644 index 00000000000..34477d6c7a5 --- /dev/null +++ b/source/reference/method/sh.waitForBalancer.txt @@ -0,0 +1,19 @@ +==================== +sh.waitForBalancer() +==================== + +.. default-domain:: mongodb + +.. method:: sh.waitForBalancer() + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.disableBalancing()` + - :method:`sh.getBalancerHost()` + - :method:`sh.getBalancerState()` + - :method:`sh.isBalancerRunning()` + - :method:`sh.setBalancerState()` + - :method:`sh.startBalancer()` + - :method:`sh.stopBalancer()` + - :method:`sh.waitForBalancerOff()` diff --git a/source/reference/method/sh.waitForBalancerOff.txt b/source/reference/method/sh.waitForBalancerOff.txt new file mode 100644 index 00000000000..17c38025402 --- /dev/null +++ b/source/reference/method/sh.waitForBalancerOff.txt @@ -0,0 +1,19 @@ +==================== +sh.waitForBalancerOff() +==================== + +.. default-domain:: mongodb + +.. method:: sh.waitForBalancerOff() + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.disableBalancing()` + - :method:`sh.getBalancerHost()` + - :method:`sh.getBalancerState()` + - :method:`sh.isBalancerRunning()` + - :method:`sh.setBalancerState()` + - :method:`sh.startBalancer()` + - :method:`sh.stopBalancer()` + - :method:`sh.waitForBalancer()` diff --git a/source/reference/method/sh.waitForDLock.txt b/source/reference/method/sh.waitForDLock.txt new file mode 100644 index 00000000000..b30c44a8a64 --- /dev/null +++ b/source/reference/method/sh.waitForDLock.txt @@ -0,0 +1,8 @@ +==================== +sh.waitForDLock() +==================== + +.. default-domain:: mongodb + +.. method:: sh.waitForDLock() + diff --git a/source/reference/method/sh.waitForPingChange.txt b/source/reference/method/sh.waitForPingChange.txt new file mode 100644 index 00000000000..be0064f15a2 --- /dev/null +++ b/source/reference/method/sh.waitForPingChange.txt @@ -0,0 +1,8 @@ +====================== +sh.waitForPingChange() +====================== + +.. default-domain:: mongodb + +.. method:: sh.waitForPingChange() + From 7b665306bf6e6a434a669aa2af87ff68f582b6e1 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Thu, 14 Feb 2013 18:01:18 -0500 Subject: [PATCH 05/25] DOCS-1016 copy edits & more for shard helpers --- source/reference/method/sh._adminCommand.txt | 2 +- .../reference/method/sh._checkLastError.txt | 7 --- source/reference/method/sh._collRE.txt | 8 +--- source/reference/method/sh._dataFormat.txt | 8 +--- source/reference/method/sh._lastMigration.txt | 29 ++++++++++- source/reference/method/sh._pchunk.txt | 8 +--- source/reference/method/sh.addTagRange.txt | 48 ++++++++++++------- .../reference/method/sh.disableBalancing.txt | 7 ++- .../reference/method/sh.enableBalancing.txt | 14 +++--- source/reference/method/sh.enableSharding.txt | 7 ++- .../reference/method/sh.getBalancerHost.txt | 5 ++ .../reference/method/sh.getBalancerState.txt | 2 +- source/reference/method/sh.startBalancer.txt | 9 +++- source/reference/method/sh.stopBalancer.txt | 11 ++++- .../reference/method/sh.waitForBalancer.txt | 13 ++++- .../method/sh.waitForBalancerOff.txt | 12 ++++- source/reference/method/sh.waitForDLock.txt | 13 ++++- .../reference/method/sh.waitForPingChange.txt | 9 +++- 18 files changed, 148 insertions(+), 64 deletions(-) diff --git a/source/reference/method/sh._adminCommand.txt b/source/reference/method/sh._adminCommand.txt index 86d42d286c1..53f5ca966ab 100644 --- a/source/reference/method/sh._adminCommand.txt +++ b/source/reference/method/sh._adminCommand.txt @@ -12,7 +12,7 @@ sh._adminCommand() to a :program:`mongos` instance. The :method:`sh._adminCommand` method runs a database command against - the admin database of a mongos instance. + the admin database of a :program:`mongos` instance. .. seealso:: diff --git a/source/reference/method/sh._checkLastError.txt b/source/reference/method/sh._checkLastError.txt index 8182310deb0..e69de29bb2d 100644 --- a/source/reference/method/sh._checkLastError.txt +++ b/source/reference/method/sh._checkLastError.txt @@ -1,7 +0,0 @@ -==================== -sh._checkLastError() -==================== - -.. default-domain:: mongodb - -.. method:: sh._checkLastError() diff --git a/source/reference/method/sh._collRE.txt b/source/reference/method/sh._collRE.txt index 19c88577730..af6d12954ab 100644 --- a/source/reference/method/sh._collRE.txt +++ b/source/reference/method/sh._collRE.txt @@ -1,7 +1 @@ -============ -sh._collRE() -============ - -.. default-domain:: mongodb - -.. method:: sh._collRE \ No newline at end of file +remove \ No newline at end of file diff --git a/source/reference/method/sh._dataFormat.txt b/source/reference/method/sh._dataFormat.txt index e75b3f2c023..af6d12954ab 100644 --- a/source/reference/method/sh._dataFormat.txt +++ b/source/reference/method/sh._dataFormat.txt @@ -1,7 +1 @@ -================ -sh._dataFormat() -================ - -.. default-domain:: mongodb - -.. method:: sh._dataFormat() \ No newline at end of file +remove \ No newline at end of file diff --git a/source/reference/method/sh._lastMigration.txt b/source/reference/method/sh._lastMigration.txt index 2dfefdd5927..377671ac3de 100644 --- a/source/reference/method/sh._lastMigration.txt +++ b/source/reference/method/sh._lastMigration.txt @@ -4,4 +4,31 @@ sh._lastMigration() .. default-domain:: mongodb -.. method:: sh._lastMigration() \ No newline at end of file +.. method:: sh._lastMigration(namespace) + + :param string namespace: The name of a database or collection within the + current database. + + :method:`sh._lastMigration()` returns a document with details about + the last migration performed on the database or collection you specify. + + :returns: a document with fields detailing the most recent migration + in the specified namespace. + + :field string _id: the id of the migration task + + :field string server: the name of the server + + :field string clientAddr: the IP address and port number of the server. + + :field ISODate time: the time of the last migration. + + :field string what: the specific type of migration. + + :field string ns: the complete namespace of the collection affected + by the migration. + + :field document details: a document containing details about the + migrated chunk. Includes ``min`` and ``max`` + sub-documents with the bounds of the migrated + chunk \ No newline at end of file diff --git a/source/reference/method/sh._pchunk.txt b/source/reference/method/sh._pchunk.txt index 834260b7d89..af6d12954ab 100644 --- a/source/reference/method/sh._pchunk.txt +++ b/source/reference/method/sh._pchunk.txt @@ -1,7 +1 @@ -============ -sh._pchunk() -============ - -.. default-domain:: mongodb - -.. method:: sh._pchunk() +remove \ No newline at end of file diff --git a/source/reference/method/sh.addTagRange.txt b/source/reference/method/sh.addTagRange.txt index 284e5f847bc..7ed440ed968 100644 --- a/source/reference/method/sh.addTagRange.txt +++ b/source/reference/method/sh.addTagRange.txt @@ -8,22 +8,22 @@ sh.addTagRange() .. versionadded:: 2.2 - :param namespace: Specifies the namespace, in the form of - ``.`` of the sharded - collection that you would like to tag. - - :param minimum: Specifies the minimum value of the - :term:`shard key` range to include in the tag. - Specify the minimum value in the form of - ``:``. - This value must be of the same BSON type or types - as the shard key. - - :param maximum: Specifies the maximum value of the shard key range - to include in the tag. Specify the maximum value - in the form of ``:``. - This value must be of the same BSON type or types - as the shard key. + :param string namespace: Specifies the namespace, in the form of + ``.`` of the sharded + collection that you would like to tag. + + :param document minimum: Specifies the minimum value of the + :term:`shard key` range to include in the tag. + Specify the minimum value in the form of + ``:``. + This value must be of the same BSON type or types + as the shard key. + + :param document maximum: Specifies the maximum value of the shard key range + to include in the tag. Specify the maximum value + in the form of ``:``. + This value must be of the same BSON type or types + as the shard key. :param string tag: Specifies the name of the tag to attach the range specified by the ``minimum`` and ``maximum`` @@ -37,7 +37,21 @@ sh.addTagRange() Always issue :method:`sh.addTagRange()` when connected to a :program:`mongos` instance. - + + .. example:: + + Given a shard key of ``{STATE:1,ZIP:1}``, create a tag range covering + ZIP codes in New York State: + + .. code-block:: javascript + + sh.addTagRange( "exampledb.collection", + {STATE: "NY", ZIP: {minKey:1}}, + {STATE:"NY", ZIP: {maxKey:1}}, + "NY" + ) + + .. seealso:: :method:`sh.addShardTag()`, diff --git a/source/reference/method/sh.disableBalancing.txt b/source/reference/method/sh.disableBalancing.txt index d6c238d3bb1..6cb203fd59b 100644 --- a/source/reference/method/sh.disableBalancing.txt +++ b/source/reference/method/sh.disableBalancing.txt @@ -4,7 +4,12 @@ sh.disableBalancing() .. default-domain:: mongodb -.. method:: sh.disableBalancing() +.. method:: sh.disableBalancing(collection) + + :param string collection: the name of a collection. + + :method:`sh.disableBalancing()` disables the balancer for the specified + sharded collection. .. seealso:: diff --git a/source/reference/method/sh.enableBalancing.txt b/source/reference/method/sh.enableBalancing.txt index 753fdd4ddb6..baaf7e40f55 100644 --- a/source/reference/method/sh.enableBalancing.txt +++ b/source/reference/method/sh.enableBalancing.txt @@ -1,14 +1,18 @@ -==================== +===================== sh.enableBalancing() -==================== +===================== .. default-domain:: mongodb -.. method:: sh.enableBalancing() +.. method:: sh.enableBalancing(collection) + + :param string collection: the name of a collection. + + :method:`sh.enableBalancing()` enables the balancer for the specified + sharded collection. .. seealso:: - - :method:`sh.enableBalancing()` - :method:`sh.disableBalancing()` - :method:`sh.getBalancerHost()` - :method:`sh.getBalancerState()` @@ -18,5 +22,3 @@ sh.enableBalancing() - :method:`sh.stopBalancer()` - :method:`sh.waitForBalancer()` - :method:`sh.waitForBalancerOff()` - - diff --git a/source/reference/method/sh.enableSharding.txt b/source/reference/method/sh.enableSharding.txt index 824edffb541..04fc899b19c 100644 --- a/source/reference/method/sh.enableSharding.txt +++ b/source/reference/method/sh.enableSharding.txt @@ -6,8 +6,13 @@ sh.enableSharding() .. method:: sh.enableSharding(database) - :param name database: Specify a database name to shard. + :param string database: Specify a database name to shard. Enables sharding on the specified database. This does not automatically shard any collections, but makes it possible to begin sharding collections using :method:`sh.shardCollection()`. + +.. seealso:: + + - :ref:`sh.shardCollection()` + \ No newline at end of file diff --git a/source/reference/method/sh.getBalancerHost.txt b/source/reference/method/sh.getBalancerHost.txt index 4d6fa7c0568..fcaefd86745 100644 --- a/source/reference/method/sh.getBalancerHost.txt +++ b/source/reference/method/sh.getBalancerHost.txt @@ -6,6 +6,11 @@ sh.getBalancerHost() .. method:: sh.getBalancerHost() + :returns: string in form :samp:`{hostname}:{port}` + + :method:`sh.getBalancerHost()` returns the name of the server that is + running the balancer. + .. seealso:: - :method:`sh.enableBalancing()` diff --git a/source/reference/method/sh.getBalancerState.txt b/source/reference/method/sh.getBalancerState.txt index 7ab82d762d5..61a27eca4f4 100644 --- a/source/reference/method/sh.getBalancerState.txt +++ b/source/reference/method/sh.getBalancerState.txt @@ -6,7 +6,7 @@ sh.getBalancerState() .. method:: sh.getBalancerState() - :returns: boolean. + :returns: Boolean. :method:`sh.getBalancerState()` returns ``true`` when the :term:`balancer` is enabled and false if the balancer is diff --git a/source/reference/method/sh.startBalancer.txt b/source/reference/method/sh.startBalancer.txt index f87f711722e..9c79dd471f0 100644 --- a/source/reference/method/sh.startBalancer.txt +++ b/source/reference/method/sh.startBalancer.txt @@ -4,7 +4,14 @@ sh.startBalancer() .. default-domain:: mongodb -.. method:: sh.startBalancer() +.. method:: sh.startBalancer(timeout, interval) + + :param integer timeout: milliseconds to wait. + + :param integer interval: milliseconds to sleep each cycle of waiting. + + The :method:`sh.startBalancer()` enables the balancer in a sharded + cluster and waits for balancing to initiate. .. seealso:: diff --git a/source/reference/method/sh.stopBalancer.txt b/source/reference/method/sh.stopBalancer.txt index 8036e67038d..2cb3fffe2c9 100644 --- a/source/reference/method/sh.stopBalancer.txt +++ b/source/reference/method/sh.stopBalancer.txt @@ -4,8 +4,15 @@ sh.stopBalancer() .. default-domain:: mongodb -.. method:: sh.stopBalancer() - +.. method:: sh.stopBalancer(timeout, interval) + + :param integer timeout: milliseconds to wait. + + :param integer interval: milliseconds to sleep each cycle of waiting. + + The :method:`sh.stopBalancer()` disables the balancer in a sharded + cluster and waits for balancing to complete. + .. seealso:: - :method:`sh.enableBalancing()` diff --git a/source/reference/method/sh.waitForBalancer.txt b/source/reference/method/sh.waitForBalancer.txt index 34477d6c7a5..171e714e32c 100644 --- a/source/reference/method/sh.waitForBalancer.txt +++ b/source/reference/method/sh.waitForBalancer.txt @@ -4,8 +4,19 @@ sh.waitForBalancer() .. default-domain:: mongodb -.. method:: sh.waitForBalancer() +.. method:: sh.waitForBalancer(onOrNot, timeout, interval) + :param Boolean onOrNot: whether to wait for the lock to be + on (``true``) or off (``false``). + + :param integer timeout: milliseconds to wait. + + :param integer interval: milliseconds to sleep. + + + :method:`sh.waitForBalancer()` is an internal method that waits for + a change in the state of the balancer. + .. seealso:: - :method:`sh.enableBalancing()` diff --git a/source/reference/method/sh.waitForBalancerOff.txt b/source/reference/method/sh.waitForBalancerOff.txt index 17c38025402..99bf27dcb58 100644 --- a/source/reference/method/sh.waitForBalancerOff.txt +++ b/source/reference/method/sh.waitForBalancerOff.txt @@ -1,11 +1,19 @@ -==================== +======================= sh.waitForBalancerOff() -==================== +======================= .. default-domain:: mongodb .. method:: sh.waitForBalancerOff() + :param integer timeout: milliseconds to wait. + + :param integer interval: milliseconds to sleep. + + :method:`sh.waitForBalancerOff()` is an internal method that waits + until the balancer is not running. + + .. seealso:: - :method:`sh.enableBalancing()` diff --git a/source/reference/method/sh.waitForDLock.txt b/source/reference/method/sh.waitForDLock.txt index b30c44a8a64..a764b15880f 100644 --- a/source/reference/method/sh.waitForDLock.txt +++ b/source/reference/method/sh.waitForDLock.txt @@ -4,5 +4,16 @@ sh.waitForDLock() .. default-domain:: mongodb -.. method:: sh.waitForDLock() +.. method:: sh.waitForDLock(lockId, onOrNot, timeout, interval) + :param string lockId: the name of the lock. + + :param Boolean onOrNot: optional, whether to wait for the lock to be + on (``true``) or off (``false``). + + :param integer timeout: milliseconds to wait. + + :param integer interval: milliseconds to sleep in each waiting cycle. + + :method:`sh.waitForDLock()` is an internal method that waits until + the specified lock is changes state. diff --git a/source/reference/method/sh.waitForPingChange.txt b/source/reference/method/sh.waitForPingChange.txt index be0064f15a2..760981c9da7 100644 --- a/source/reference/method/sh.waitForPingChange.txt +++ b/source/reference/method/sh.waitForPingChange.txt @@ -4,5 +4,12 @@ sh.waitForPingChange() .. default-domain:: mongodb -.. method:: sh.waitForPingChange() +.. method:: sh.waitForPingChange(activepings, timeout, interval) + :param array activepings: an array of active pings from the + ``config.mongos`` collection. + + :param integer timeout: milliseconds to wait for a change in ping state. + + :param integer interval: milliseconds to sleep in each waiting cycle. + \ No newline at end of file From 284a5a5052aead15992e0ab7e5a2fa3e36971146 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Thu, 14 Feb 2013 18:03:11 -0500 Subject: [PATCH 06/25] DOCS-1016 remove several commands which are internal and rarely used --- source/reference/method/sh._checkLastError.txt | 0 source/reference/method/sh._collRE.txt | 1 - source/reference/method/sh._dataFormat.txt | 1 - source/reference/method/sh._pchunk.txt | 1 - 4 files changed, 3 deletions(-) delete mode 100644 source/reference/method/sh._checkLastError.txt delete mode 100644 source/reference/method/sh._collRE.txt delete mode 100644 source/reference/method/sh._dataFormat.txt delete mode 100644 source/reference/method/sh._pchunk.txt diff --git a/source/reference/method/sh._checkLastError.txt b/source/reference/method/sh._checkLastError.txt deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/source/reference/method/sh._collRE.txt b/source/reference/method/sh._collRE.txt deleted file mode 100644 index af6d12954ab..00000000000 --- a/source/reference/method/sh._collRE.txt +++ /dev/null @@ -1 +0,0 @@ -remove \ No newline at end of file diff --git a/source/reference/method/sh._dataFormat.txt b/source/reference/method/sh._dataFormat.txt deleted file mode 100644 index af6d12954ab..00000000000 --- a/source/reference/method/sh._dataFormat.txt +++ /dev/null @@ -1 +0,0 @@ -remove \ No newline at end of file diff --git a/source/reference/method/sh._pchunk.txt b/source/reference/method/sh._pchunk.txt deleted file mode 100644 index af6d12954ab..00000000000 --- a/source/reference/method/sh._pchunk.txt +++ /dev/null @@ -1 +0,0 @@ -remove \ No newline at end of file From f2365f5f342313f85213aa4e18591ac2d047d6e5 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Fri, 15 Feb 2013 12:41:34 -0500 Subject: [PATCH 07/25] DOCS-1016 minor cleanup --- source/reference/method/sh._adminCommand.txt | 3 +- source/reference/method/sh._checkMongos.txt | 3 +- source/reference/method/sh._lastMigration.txt | 39 ++++++++++--------- .../reference/method/sh.getBalancerState.txt | 2 +- .../reference/method/sh.isBalancerRunning.txt | 2 +- .../reference/method/sh.setBalancerState.txt | 2 +- .../method/sh.waitForBalancerOff.txt | 1 - 7 files changed, 27 insertions(+), 25 deletions(-) diff --git a/source/reference/method/sh._adminCommand.txt b/source/reference/method/sh._adminCommand.txt index 53f5ca966ab..95bb5b6b543 100644 --- a/source/reference/method/sh._adminCommand.txt +++ b/source/reference/method/sh._adminCommand.txt @@ -8,6 +8,7 @@ sh._adminCommand() :param string dbcommand: a database command to run against the ``admin`` database. + :param Boolean checkMongos: verify whether or not the shell is connected to a :program:`mongos` instance. @@ -16,4 +17,4 @@ sh._adminCommand() .. seealso:: - - :method:`db.runCommand` \ No newline at end of file + - :method:`db.runCommand` diff --git a/source/reference/method/sh._checkMongos.txt b/source/reference/method/sh._checkMongos.txt index 858dd853b8e..fac8dfe395c 100644 --- a/source/reference/method/sh._checkMongos.txt +++ b/source/reference/method/sh._checkMongos.txt @@ -7,8 +7,9 @@ sh._checkMongos() .. method:: sh._checkMongos() :returns: nothing + :throws: "not connected to a mongos" The :method:`sh._checkMongos()` method throws an error message if the :program:`mongo` shell is not connected to a :program:`mongos` instance. - Otherwise it exits (no return document or return code). \ No newline at end of file + Otherwise it exits (no return document or return code). diff --git a/source/reference/method/sh._lastMigration.txt b/source/reference/method/sh._lastMigration.txt index 377671ac3de..5e7c3467cab 100644 --- a/source/reference/method/sh._lastMigration.txt +++ b/source/reference/method/sh._lastMigration.txt @@ -9,26 +9,27 @@ sh._lastMigration() :param string namespace: The name of a database or collection within the current database. + :returns: a document with fields detailing the most recent + migration in the specified namespace. + :method:`sh._lastMigration()` returns a document with details about the last migration performed on the database or collection you specify. - :returns: a document with fields detailing the most recent migration - in the specified namespace. - :field string _id: the id of the migration task - - :field string server: the name of the server - - :field string clientAddr: the IP address and port number of the server. - - :field ISODate time: the time of the last migration. - - :field string what: the specific type of migration. - - :field string ns: the complete namespace of the collection affected - by the migration. - - :field document details: a document containing details about the - migrated chunk. Includes ``min`` and ``max`` - sub-documents with the bounds of the migrated - chunk \ No newline at end of file + :field string _id: the id of the migration task + + :field string server: the name of the server + + :field string clientAddr: the IP address and port number of the server. + + :field ISODate time: the time of the last migration. + + :field string what: the specific type of migration. + + :field string ns: the complete namespace of the collection affected + by the migration. + + :field document details: a document containing details about the + migrated chunk. Includes ``min`` and ``max`` + sub-documents with the bounds of the migrated + chunk. diff --git a/source/reference/method/sh.getBalancerState.txt b/source/reference/method/sh.getBalancerState.txt index 61a27eca4f4..71911fde536 100644 --- a/source/reference/method/sh.getBalancerState.txt +++ b/source/reference/method/sh.getBalancerState.txt @@ -6,7 +6,7 @@ sh.getBalancerState() .. method:: sh.getBalancerState() - :returns: Boolean. + :returns: Boolean :method:`sh.getBalancerState()` returns ``true`` when the :term:`balancer` is enabled and false if the balancer is diff --git a/source/reference/method/sh.isBalancerRunning.txt b/source/reference/method/sh.isBalancerRunning.txt index 3b89110e06f..43bd9d48331 100644 --- a/source/reference/method/sh.isBalancerRunning.txt +++ b/source/reference/method/sh.isBalancerRunning.txt @@ -6,7 +6,7 @@ sh.isBalancerRunning() .. method:: sh.isBalancerRunning() - :returns: boolean. + :returns: Boolean. Returns true if the :term:`balancer` process is currently running and migrating chunks and false if the balancer process is not diff --git a/source/reference/method/sh.setBalancerState.txt b/source/reference/method/sh.setBalancerState.txt index 49c7facbd94..3dd20023cc3 100644 --- a/source/reference/method/sh.setBalancerState.txt +++ b/source/reference/method/sh.setBalancerState.txt @@ -6,7 +6,7 @@ sh.setBalancerState() .. method:: sh.setBalancerState(state) - :param boolean state: ``true`` enables the balancer if disabled, + :param Boolean state: ``true`` enables the balancer if disabled, and ``false`` disables the balancer. Enables or disables the :term:`balancer`. Use diff --git a/source/reference/method/sh.waitForBalancerOff.txt b/source/reference/method/sh.waitForBalancerOff.txt index 99bf27dcb58..acc908ce65a 100644 --- a/source/reference/method/sh.waitForBalancerOff.txt +++ b/source/reference/method/sh.waitForBalancerOff.txt @@ -12,7 +12,6 @@ sh.waitForBalancerOff() :method:`sh.waitForBalancerOff()` is an internal method that waits until the balancer is not running. - .. seealso:: From 827f4827a28451ca72d5a1b77ecd4491a1552ab2 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Fri, 15 Feb 2013 12:42:34 -0500 Subject: [PATCH 08/25] DOCS-1016 minor cleanup --- source/reference/method/sh.isBalancerRunning.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/reference/method/sh.isBalancerRunning.txt b/source/reference/method/sh.isBalancerRunning.txt index 43bd9d48331..87e58de6f9e 100644 --- a/source/reference/method/sh.isBalancerRunning.txt +++ b/source/reference/method/sh.isBalancerRunning.txt @@ -6,7 +6,7 @@ sh.isBalancerRunning() .. method:: sh.isBalancerRunning() - :returns: Boolean. + :returns: Boolean Returns true if the :term:`balancer` process is currently running and migrating chunks and false if the balancer process is not From a177563268af3a175cd6133011ce9349d8225ba8 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Wed, 13 Feb 2013 17:44:06 -0500 Subject: [PATCH 09/25] DOCS-1016 document missing sharding shell helpers --- source/reference/method/sh._adminCommand.txt | 19 ++++++++++++++++ source/reference/method/sh._checkFullName.txt | 16 ++++++++++++++ .../reference/method/sh._checkLastError.txt | 7 ++++++ source/reference/method/sh._checkMongos.txt | 14 ++++++++++++ source/reference/method/sh._collRE.txt | 7 ++++++ source/reference/method/sh._dataFormat.txt | 7 ++++++ source/reference/method/sh._lastMigration.txt | 7 ++++++ source/reference/method/sh._pchunk.txt | 7 ++++++ .../reference/method/sh.disableBalancing.txt | 19 ++++++++++++++++ .../reference/method/sh.enableBalancing.txt | 22 +++++++++++++++++++ .../reference/method/sh.getBalancerHost.txt | 19 ++++++++++++++++ .../reference/method/sh.getBalancerState.txt | 12 ++++++++++ .../reference/method/sh.isBalancerRunning.txt | 12 ++++++++++ .../reference/method/sh.setBalancerState.txt | 12 ++++++++++ source/reference/method/sh.startBalancer.txt | 19 ++++++++++++++++ source/reference/method/sh.stopBalancer.txt | 19 ++++++++++++++++ .../reference/method/sh.waitForBalancer.txt | 19 ++++++++++++++++ .../method/sh.waitForBalancerOff.txt | 19 ++++++++++++++++ source/reference/method/sh.waitForDLock.txt | 8 +++++++ .../reference/method/sh.waitForPingChange.txt | 8 +++++++ 20 files changed, 272 insertions(+) create mode 100644 source/reference/method/sh._adminCommand.txt create mode 100644 source/reference/method/sh._checkFullName.txt create mode 100644 source/reference/method/sh._checkLastError.txt create mode 100644 source/reference/method/sh._checkMongos.txt create mode 100644 source/reference/method/sh._collRE.txt create mode 100644 source/reference/method/sh._dataFormat.txt create mode 100644 source/reference/method/sh._lastMigration.txt create mode 100644 source/reference/method/sh._pchunk.txt create mode 100644 source/reference/method/sh.disableBalancing.txt create mode 100644 source/reference/method/sh.enableBalancing.txt create mode 100644 source/reference/method/sh.getBalancerHost.txt create mode 100644 source/reference/method/sh.startBalancer.txt create mode 100644 source/reference/method/sh.stopBalancer.txt create mode 100644 source/reference/method/sh.waitForBalancer.txt create mode 100644 source/reference/method/sh.waitForBalancerOff.txt create mode 100644 source/reference/method/sh.waitForDLock.txt create mode 100644 source/reference/method/sh.waitForPingChange.txt diff --git a/source/reference/method/sh._adminCommand.txt b/source/reference/method/sh._adminCommand.txt new file mode 100644 index 00000000000..86d42d286c1 --- /dev/null +++ b/source/reference/method/sh._adminCommand.txt @@ -0,0 +1,19 @@ +================== +sh._adminCommand() +================== + +.. default-domain:: mongodb + +.. method:: sh._adminCommand(cmd, checkMongos) + + :param string dbcommand: a database command to run against the ``admin`` + database. + :param Boolean checkMongos: verify whether or not the shell is connected + to a :program:`mongos` instance. + + The :method:`sh._adminCommand` method runs a database command against + the admin database of a mongos instance. + +.. seealso:: + + - :method:`db.runCommand` \ No newline at end of file diff --git a/source/reference/method/sh._checkFullName.txt b/source/reference/method/sh._checkFullName.txt new file mode 100644 index 00000000000..77b1c0085b8 --- /dev/null +++ b/source/reference/method/sh._checkFullName.txt @@ -0,0 +1,16 @@ +=================== +sh._checkFullName() +=================== + +.. default-domain:: mongodb + +.. method:: sh._checkFullName(namespace) + + :param string namespace: specify a complete namespace. + + :throws: "name needs to be fully qualified ." + + The :method:`sh._checkFullName()` method verifies that a namespace + name is well-formed. If the name has a period ``.`` then the + :method:`sh._checkFullName()` method exits, otherwise it throws + an error. \ No newline at end of file diff --git a/source/reference/method/sh._checkLastError.txt b/source/reference/method/sh._checkLastError.txt new file mode 100644 index 00000000000..8182310deb0 --- /dev/null +++ b/source/reference/method/sh._checkLastError.txt @@ -0,0 +1,7 @@ +==================== +sh._checkLastError() +==================== + +.. default-domain:: mongodb + +.. method:: sh._checkLastError() diff --git a/source/reference/method/sh._checkMongos.txt b/source/reference/method/sh._checkMongos.txt new file mode 100644 index 00000000000..858dd853b8e --- /dev/null +++ b/source/reference/method/sh._checkMongos.txt @@ -0,0 +1,14 @@ +================= +sh._checkMongos() +================= + +.. default-domain:: mongodb + +.. method:: sh._checkMongos() + + :returns: nothing + :throws: "not connected to a mongos" + + The :method:`sh._checkMongos()` method throws an error message if the + :program:`mongo` shell is not connected to a :program:`mongos` instance. + Otherwise it exits (no return document or return code). \ No newline at end of file diff --git a/source/reference/method/sh._collRE.txt b/source/reference/method/sh._collRE.txt new file mode 100644 index 00000000000..19c88577730 --- /dev/null +++ b/source/reference/method/sh._collRE.txt @@ -0,0 +1,7 @@ +============ +sh._collRE() +============ + +.. default-domain:: mongodb + +.. method:: sh._collRE \ No newline at end of file diff --git a/source/reference/method/sh._dataFormat.txt b/source/reference/method/sh._dataFormat.txt new file mode 100644 index 00000000000..e75b3f2c023 --- /dev/null +++ b/source/reference/method/sh._dataFormat.txt @@ -0,0 +1,7 @@ +================ +sh._dataFormat() +================ + +.. default-domain:: mongodb + +.. method:: sh._dataFormat() \ No newline at end of file diff --git a/source/reference/method/sh._lastMigration.txt b/source/reference/method/sh._lastMigration.txt new file mode 100644 index 00000000000..2dfefdd5927 --- /dev/null +++ b/source/reference/method/sh._lastMigration.txt @@ -0,0 +1,7 @@ +=================== +sh._lastMigration() +=================== + +.. default-domain:: mongodb + +.. method:: sh._lastMigration() \ No newline at end of file diff --git a/source/reference/method/sh._pchunk.txt b/source/reference/method/sh._pchunk.txt new file mode 100644 index 00000000000..834260b7d89 --- /dev/null +++ b/source/reference/method/sh._pchunk.txt @@ -0,0 +1,7 @@ +============ +sh._pchunk() +============ + +.. default-domain:: mongodb + +.. method:: sh._pchunk() diff --git a/source/reference/method/sh.disableBalancing.txt b/source/reference/method/sh.disableBalancing.txt new file mode 100644 index 00000000000..d6c238d3bb1 --- /dev/null +++ b/source/reference/method/sh.disableBalancing.txt @@ -0,0 +1,19 @@ +===================== +sh.disableBalancing() +===================== + +.. default-domain:: mongodb + +.. method:: sh.disableBalancing() + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.getBalancerHost()` + - :method:`sh.getBalancerState()` + - :method:`sh.isBalancerRunning()` + - :method:`sh.setBalancerState()` + - :method:`sh.startBalancer()` + - :method:`sh.stopBalancer()` + - :method:`sh.waitForBalancer()` + - :method:`sh.waitForBalancerOff()` diff --git a/source/reference/method/sh.enableBalancing.txt b/source/reference/method/sh.enableBalancing.txt new file mode 100644 index 00000000000..753fdd4ddb6 --- /dev/null +++ b/source/reference/method/sh.enableBalancing.txt @@ -0,0 +1,22 @@ +==================== +sh.enableBalancing() +==================== + +.. default-domain:: mongodb + +.. method:: sh.enableBalancing() + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.disableBalancing()` + - :method:`sh.getBalancerHost()` + - :method:`sh.getBalancerState()` + - :method:`sh.isBalancerRunning()` + - :method:`sh.setBalancerState()` + - :method:`sh.startBalancer()` + - :method:`sh.stopBalancer()` + - :method:`sh.waitForBalancer()` + - :method:`sh.waitForBalancerOff()` + + diff --git a/source/reference/method/sh.getBalancerHost.txt b/source/reference/method/sh.getBalancerHost.txt new file mode 100644 index 00000000000..4d6fa7c0568 --- /dev/null +++ b/source/reference/method/sh.getBalancerHost.txt @@ -0,0 +1,19 @@ +==================== +sh.getBalancerHost() +==================== + +.. default-domain:: mongodb + +.. method:: sh.getBalancerHost() + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.disableBalancing()` + - :method:`sh.getBalancerState()` + - :method:`sh.isBalancerRunning()` + - :method:`sh.setBalancerState()` + - :method:`sh.startBalancer()` + - :method:`sh.stopBalancer()` + - :method:`sh.waitForBalancer()` + - :method:`sh.waitForBalancerOff()` diff --git a/source/reference/method/sh.getBalancerState.txt b/source/reference/method/sh.getBalancerState.txt index 447948874c1..7ab82d762d5 100644 --- a/source/reference/method/sh.getBalancerState.txt +++ b/source/reference/method/sh.getBalancerState.txt @@ -13,3 +13,15 @@ sh.getBalancerState() disabled. This does not reflect the current state of balancing operations: use :method:`sh.isBalancerRunning()` to check the balancer's current state. + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.disableBalancing()` + - :method:`sh.getBalancerHost()` + - :method:`sh.isBalancerRunning()` + - :method:`sh.setBalancerState()` + - :method:`sh.startBalancer()` + - :method:`sh.stopBalancer()` + - :method:`sh.waitForBalancer()` + - :method:`sh.waitForBalancerOff()` diff --git a/source/reference/method/sh.isBalancerRunning.txt b/source/reference/method/sh.isBalancerRunning.txt index b1d9e7d8f66..3b89110e06f 100644 --- a/source/reference/method/sh.isBalancerRunning.txt +++ b/source/reference/method/sh.isBalancerRunning.txt @@ -12,3 +12,15 @@ sh.isBalancerRunning() and migrating chunks and false if the balancer process is not running. Use :method:`sh.getBalancerState()` to determine if the balancer is enabled or disabled. + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.disableBalancing()` + - :method:`sh.getBalancerHost()` + - :method:`sh.getBalancerState()` + - :method:`sh.setBalancerState()` + - :method:`sh.startBalancer()` + - :method:`sh.stopBalancer()` + - :method:`sh.waitForBalancer()` + - :method:`sh.waitForBalancerOff()` diff --git a/source/reference/method/sh.setBalancerState.txt b/source/reference/method/sh.setBalancerState.txt index 2dda05a7e73..49c7facbd94 100644 --- a/source/reference/method/sh.setBalancerState.txt +++ b/source/reference/method/sh.setBalancerState.txt @@ -13,3 +13,15 @@ sh.setBalancerState() :method:`sh.getBalancerState()` to determine if the balancer is currently enabled or disabled and :method:`sh.isBalancerRunning()` to check its current state. + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.disableBalancing()` + - :method:`sh.getBalancerHost()` + - :method:`sh.getBalancerState()` + - :method:`sh.isBalancerRunning()` + - :method:`sh.startBalancer()` + - :method:`sh.stopBalancer()` + - :method:`sh.waitForBalancer()` + - :method:`sh.waitForBalancerOff()` diff --git a/source/reference/method/sh.startBalancer.txt b/source/reference/method/sh.startBalancer.txt new file mode 100644 index 00000000000..f87f711722e --- /dev/null +++ b/source/reference/method/sh.startBalancer.txt @@ -0,0 +1,19 @@ +================== +sh.startBalancer() +================== + +.. default-domain:: mongodb + +.. method:: sh.startBalancer() + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.disableBalancing()` + - :method:`sh.getBalancerHost()` + - :method:`sh.getBalancerState()` + - :method:`sh.isBalancerRunning()` + - :method:`sh.setBalancerState()` + - :method:`sh.stopBalancer()` + - :method:`sh.waitForBalancer()` + - :method:`sh.waitForBalancerOff()` diff --git a/source/reference/method/sh.stopBalancer.txt b/source/reference/method/sh.stopBalancer.txt new file mode 100644 index 00000000000..8036e67038d --- /dev/null +++ b/source/reference/method/sh.stopBalancer.txt @@ -0,0 +1,19 @@ +================= +sh.stopBalancer() +================= + +.. default-domain:: mongodb + +.. method:: sh.stopBalancer() + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.disableBalancing()` + - :method:`sh.getBalancerHost()` + - :method:`sh.getBalancerState()` + - :method:`sh.isBalancerRunning()` + - :method:`sh.setBalancerState()` + - :method:`sh.startBalancer()` + - :method:`sh.waitForBalancer()` + - :method:`sh.waitForBalancerOff()` diff --git a/source/reference/method/sh.waitForBalancer.txt b/source/reference/method/sh.waitForBalancer.txt new file mode 100644 index 00000000000..34477d6c7a5 --- /dev/null +++ b/source/reference/method/sh.waitForBalancer.txt @@ -0,0 +1,19 @@ +==================== +sh.waitForBalancer() +==================== + +.. default-domain:: mongodb + +.. method:: sh.waitForBalancer() + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.disableBalancing()` + - :method:`sh.getBalancerHost()` + - :method:`sh.getBalancerState()` + - :method:`sh.isBalancerRunning()` + - :method:`sh.setBalancerState()` + - :method:`sh.startBalancer()` + - :method:`sh.stopBalancer()` + - :method:`sh.waitForBalancerOff()` diff --git a/source/reference/method/sh.waitForBalancerOff.txt b/source/reference/method/sh.waitForBalancerOff.txt new file mode 100644 index 00000000000..17c38025402 --- /dev/null +++ b/source/reference/method/sh.waitForBalancerOff.txt @@ -0,0 +1,19 @@ +==================== +sh.waitForBalancerOff() +==================== + +.. default-domain:: mongodb + +.. method:: sh.waitForBalancerOff() + +.. seealso:: + + - :method:`sh.enableBalancing()` + - :method:`sh.disableBalancing()` + - :method:`sh.getBalancerHost()` + - :method:`sh.getBalancerState()` + - :method:`sh.isBalancerRunning()` + - :method:`sh.setBalancerState()` + - :method:`sh.startBalancer()` + - :method:`sh.stopBalancer()` + - :method:`sh.waitForBalancer()` diff --git a/source/reference/method/sh.waitForDLock.txt b/source/reference/method/sh.waitForDLock.txt new file mode 100644 index 00000000000..b30c44a8a64 --- /dev/null +++ b/source/reference/method/sh.waitForDLock.txt @@ -0,0 +1,8 @@ +==================== +sh.waitForDLock() +==================== + +.. default-domain:: mongodb + +.. method:: sh.waitForDLock() + diff --git a/source/reference/method/sh.waitForPingChange.txt b/source/reference/method/sh.waitForPingChange.txt new file mode 100644 index 00000000000..be0064f15a2 --- /dev/null +++ b/source/reference/method/sh.waitForPingChange.txt @@ -0,0 +1,8 @@ +====================== +sh.waitForPingChange() +====================== + +.. default-domain:: mongodb + +.. method:: sh.waitForPingChange() + From 27b678fb2240ebf97c2620ff56b52933f0c1fe35 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Thu, 14 Feb 2013 18:01:18 -0500 Subject: [PATCH 10/25] DOCS-1016 copy edits & more for shard helpers --- source/reference/method/sh._adminCommand.txt | 2 +- .../reference/method/sh._checkLastError.txt | 7 --- source/reference/method/sh._collRE.txt | 8 +--- source/reference/method/sh._dataFormat.txt | 8 +--- source/reference/method/sh._lastMigration.txt | 29 ++++++++++- source/reference/method/sh._pchunk.txt | 8 +--- source/reference/method/sh.addTagRange.txt | 48 ++++++++++++------- .../reference/method/sh.disableBalancing.txt | 7 ++- .../reference/method/sh.enableBalancing.txt | 14 +++--- source/reference/method/sh.enableSharding.txt | 7 ++- .../reference/method/sh.getBalancerHost.txt | 5 ++ .../reference/method/sh.getBalancerState.txt | 2 +- source/reference/method/sh.startBalancer.txt | 9 +++- source/reference/method/sh.stopBalancer.txt | 11 ++++- .../reference/method/sh.waitForBalancer.txt | 13 ++++- .../method/sh.waitForBalancerOff.txt | 12 ++++- source/reference/method/sh.waitForDLock.txt | 13 ++++- .../reference/method/sh.waitForPingChange.txt | 9 +++- 18 files changed, 148 insertions(+), 64 deletions(-) diff --git a/source/reference/method/sh._adminCommand.txt b/source/reference/method/sh._adminCommand.txt index 86d42d286c1..53f5ca966ab 100644 --- a/source/reference/method/sh._adminCommand.txt +++ b/source/reference/method/sh._adminCommand.txt @@ -12,7 +12,7 @@ sh._adminCommand() to a :program:`mongos` instance. The :method:`sh._adminCommand` method runs a database command against - the admin database of a mongos instance. + the admin database of a :program:`mongos` instance. .. seealso:: diff --git a/source/reference/method/sh._checkLastError.txt b/source/reference/method/sh._checkLastError.txt index 8182310deb0..e69de29bb2d 100644 --- a/source/reference/method/sh._checkLastError.txt +++ b/source/reference/method/sh._checkLastError.txt @@ -1,7 +0,0 @@ -==================== -sh._checkLastError() -==================== - -.. default-domain:: mongodb - -.. method:: sh._checkLastError() diff --git a/source/reference/method/sh._collRE.txt b/source/reference/method/sh._collRE.txt index 19c88577730..af6d12954ab 100644 --- a/source/reference/method/sh._collRE.txt +++ b/source/reference/method/sh._collRE.txt @@ -1,7 +1 @@ -============ -sh._collRE() -============ - -.. default-domain:: mongodb - -.. method:: sh._collRE \ No newline at end of file +remove \ No newline at end of file diff --git a/source/reference/method/sh._dataFormat.txt b/source/reference/method/sh._dataFormat.txt index e75b3f2c023..af6d12954ab 100644 --- a/source/reference/method/sh._dataFormat.txt +++ b/source/reference/method/sh._dataFormat.txt @@ -1,7 +1 @@ -================ -sh._dataFormat() -================ - -.. default-domain:: mongodb - -.. method:: sh._dataFormat() \ No newline at end of file +remove \ No newline at end of file diff --git a/source/reference/method/sh._lastMigration.txt b/source/reference/method/sh._lastMigration.txt index 2dfefdd5927..377671ac3de 100644 --- a/source/reference/method/sh._lastMigration.txt +++ b/source/reference/method/sh._lastMigration.txt @@ -4,4 +4,31 @@ sh._lastMigration() .. default-domain:: mongodb -.. method:: sh._lastMigration() \ No newline at end of file +.. method:: sh._lastMigration(namespace) + + :param string namespace: The name of a database or collection within the + current database. + + :method:`sh._lastMigration()` returns a document with details about + the last migration performed on the database or collection you specify. + + :returns: a document with fields detailing the most recent migration + in the specified namespace. + + :field string _id: the id of the migration task + + :field string server: the name of the server + + :field string clientAddr: the IP address and port number of the server. + + :field ISODate time: the time of the last migration. + + :field string what: the specific type of migration. + + :field string ns: the complete namespace of the collection affected + by the migration. + + :field document details: a document containing details about the + migrated chunk. Includes ``min`` and ``max`` + sub-documents with the bounds of the migrated + chunk \ No newline at end of file diff --git a/source/reference/method/sh._pchunk.txt b/source/reference/method/sh._pchunk.txt index 834260b7d89..af6d12954ab 100644 --- a/source/reference/method/sh._pchunk.txt +++ b/source/reference/method/sh._pchunk.txt @@ -1,7 +1 @@ -============ -sh._pchunk() -============ - -.. default-domain:: mongodb - -.. method:: sh._pchunk() +remove \ No newline at end of file diff --git a/source/reference/method/sh.addTagRange.txt b/source/reference/method/sh.addTagRange.txt index 284e5f847bc..7ed440ed968 100644 --- a/source/reference/method/sh.addTagRange.txt +++ b/source/reference/method/sh.addTagRange.txt @@ -8,22 +8,22 @@ sh.addTagRange() .. versionadded:: 2.2 - :param namespace: Specifies the namespace, in the form of - ``.`` of the sharded - collection that you would like to tag. - - :param minimum: Specifies the minimum value of the - :term:`shard key` range to include in the tag. - Specify the minimum value in the form of - ``:``. - This value must be of the same BSON type or types - as the shard key. - - :param maximum: Specifies the maximum value of the shard key range - to include in the tag. Specify the maximum value - in the form of ``:``. - This value must be of the same BSON type or types - as the shard key. + :param string namespace: Specifies the namespace, in the form of + ``.`` of the sharded + collection that you would like to tag. + + :param document minimum: Specifies the minimum value of the + :term:`shard key` range to include in the tag. + Specify the minimum value in the form of + ``:``. + This value must be of the same BSON type or types + as the shard key. + + :param document maximum: Specifies the maximum value of the shard key range + to include in the tag. Specify the maximum value + in the form of ``:``. + This value must be of the same BSON type or types + as the shard key. :param string tag: Specifies the name of the tag to attach the range specified by the ``minimum`` and ``maximum`` @@ -37,7 +37,21 @@ sh.addTagRange() Always issue :method:`sh.addTagRange()` when connected to a :program:`mongos` instance. - + + .. example:: + + Given a shard key of ``{STATE:1,ZIP:1}``, create a tag range covering + ZIP codes in New York State: + + .. code-block:: javascript + + sh.addTagRange( "exampledb.collection", + {STATE: "NY", ZIP: {minKey:1}}, + {STATE:"NY", ZIP: {maxKey:1}}, + "NY" + ) + + .. seealso:: :method:`sh.addShardTag()`, diff --git a/source/reference/method/sh.disableBalancing.txt b/source/reference/method/sh.disableBalancing.txt index d6c238d3bb1..6cb203fd59b 100644 --- a/source/reference/method/sh.disableBalancing.txt +++ b/source/reference/method/sh.disableBalancing.txt @@ -4,7 +4,12 @@ sh.disableBalancing() .. default-domain:: mongodb -.. method:: sh.disableBalancing() +.. method:: sh.disableBalancing(collection) + + :param string collection: the name of a collection. + + :method:`sh.disableBalancing()` disables the balancer for the specified + sharded collection. .. seealso:: diff --git a/source/reference/method/sh.enableBalancing.txt b/source/reference/method/sh.enableBalancing.txt index 753fdd4ddb6..baaf7e40f55 100644 --- a/source/reference/method/sh.enableBalancing.txt +++ b/source/reference/method/sh.enableBalancing.txt @@ -1,14 +1,18 @@ -==================== +===================== sh.enableBalancing() -==================== +===================== .. default-domain:: mongodb -.. method:: sh.enableBalancing() +.. method:: sh.enableBalancing(collection) + + :param string collection: the name of a collection. + + :method:`sh.enableBalancing()` enables the balancer for the specified + sharded collection. .. seealso:: - - :method:`sh.enableBalancing()` - :method:`sh.disableBalancing()` - :method:`sh.getBalancerHost()` - :method:`sh.getBalancerState()` @@ -18,5 +22,3 @@ sh.enableBalancing() - :method:`sh.stopBalancer()` - :method:`sh.waitForBalancer()` - :method:`sh.waitForBalancerOff()` - - diff --git a/source/reference/method/sh.enableSharding.txt b/source/reference/method/sh.enableSharding.txt index 824edffb541..04fc899b19c 100644 --- a/source/reference/method/sh.enableSharding.txt +++ b/source/reference/method/sh.enableSharding.txt @@ -6,8 +6,13 @@ sh.enableSharding() .. method:: sh.enableSharding(database) - :param name database: Specify a database name to shard. + :param string database: Specify a database name to shard. Enables sharding on the specified database. This does not automatically shard any collections, but makes it possible to begin sharding collections using :method:`sh.shardCollection()`. + +.. seealso:: + + - :ref:`sh.shardCollection()` + \ No newline at end of file diff --git a/source/reference/method/sh.getBalancerHost.txt b/source/reference/method/sh.getBalancerHost.txt index 4d6fa7c0568..fcaefd86745 100644 --- a/source/reference/method/sh.getBalancerHost.txt +++ b/source/reference/method/sh.getBalancerHost.txt @@ -6,6 +6,11 @@ sh.getBalancerHost() .. method:: sh.getBalancerHost() + :returns: string in form :samp:`{hostname}:{port}` + + :method:`sh.getBalancerHost()` returns the name of the server that is + running the balancer. + .. seealso:: - :method:`sh.enableBalancing()` diff --git a/source/reference/method/sh.getBalancerState.txt b/source/reference/method/sh.getBalancerState.txt index 7ab82d762d5..61a27eca4f4 100644 --- a/source/reference/method/sh.getBalancerState.txt +++ b/source/reference/method/sh.getBalancerState.txt @@ -6,7 +6,7 @@ sh.getBalancerState() .. method:: sh.getBalancerState() - :returns: boolean. + :returns: Boolean. :method:`sh.getBalancerState()` returns ``true`` when the :term:`balancer` is enabled and false if the balancer is diff --git a/source/reference/method/sh.startBalancer.txt b/source/reference/method/sh.startBalancer.txt index f87f711722e..9c79dd471f0 100644 --- a/source/reference/method/sh.startBalancer.txt +++ b/source/reference/method/sh.startBalancer.txt @@ -4,7 +4,14 @@ sh.startBalancer() .. default-domain:: mongodb -.. method:: sh.startBalancer() +.. method:: sh.startBalancer(timeout, interval) + + :param integer timeout: milliseconds to wait. + + :param integer interval: milliseconds to sleep each cycle of waiting. + + The :method:`sh.startBalancer()` enables the balancer in a sharded + cluster and waits for balancing to initiate. .. seealso:: diff --git a/source/reference/method/sh.stopBalancer.txt b/source/reference/method/sh.stopBalancer.txt index 8036e67038d..2cb3fffe2c9 100644 --- a/source/reference/method/sh.stopBalancer.txt +++ b/source/reference/method/sh.stopBalancer.txt @@ -4,8 +4,15 @@ sh.stopBalancer() .. default-domain:: mongodb -.. method:: sh.stopBalancer() - +.. method:: sh.stopBalancer(timeout, interval) + + :param integer timeout: milliseconds to wait. + + :param integer interval: milliseconds to sleep each cycle of waiting. + + The :method:`sh.stopBalancer()` disables the balancer in a sharded + cluster and waits for balancing to complete. + .. seealso:: - :method:`sh.enableBalancing()` diff --git a/source/reference/method/sh.waitForBalancer.txt b/source/reference/method/sh.waitForBalancer.txt index 34477d6c7a5..171e714e32c 100644 --- a/source/reference/method/sh.waitForBalancer.txt +++ b/source/reference/method/sh.waitForBalancer.txt @@ -4,8 +4,19 @@ sh.waitForBalancer() .. default-domain:: mongodb -.. method:: sh.waitForBalancer() +.. method:: sh.waitForBalancer(onOrNot, timeout, interval) + :param Boolean onOrNot: whether to wait for the lock to be + on (``true``) or off (``false``). + + :param integer timeout: milliseconds to wait. + + :param integer interval: milliseconds to sleep. + + + :method:`sh.waitForBalancer()` is an internal method that waits for + a change in the state of the balancer. + .. seealso:: - :method:`sh.enableBalancing()` diff --git a/source/reference/method/sh.waitForBalancerOff.txt b/source/reference/method/sh.waitForBalancerOff.txt index 17c38025402..99bf27dcb58 100644 --- a/source/reference/method/sh.waitForBalancerOff.txt +++ b/source/reference/method/sh.waitForBalancerOff.txt @@ -1,11 +1,19 @@ -==================== +======================= sh.waitForBalancerOff() -==================== +======================= .. default-domain:: mongodb .. method:: sh.waitForBalancerOff() + :param integer timeout: milliseconds to wait. + + :param integer interval: milliseconds to sleep. + + :method:`sh.waitForBalancerOff()` is an internal method that waits + until the balancer is not running. + + .. seealso:: - :method:`sh.enableBalancing()` diff --git a/source/reference/method/sh.waitForDLock.txt b/source/reference/method/sh.waitForDLock.txt index b30c44a8a64..a764b15880f 100644 --- a/source/reference/method/sh.waitForDLock.txt +++ b/source/reference/method/sh.waitForDLock.txt @@ -4,5 +4,16 @@ sh.waitForDLock() .. default-domain:: mongodb -.. method:: sh.waitForDLock() +.. method:: sh.waitForDLock(lockId, onOrNot, timeout, interval) + :param string lockId: the name of the lock. + + :param Boolean onOrNot: optional, whether to wait for the lock to be + on (``true``) or off (``false``). + + :param integer timeout: milliseconds to wait. + + :param integer interval: milliseconds to sleep in each waiting cycle. + + :method:`sh.waitForDLock()` is an internal method that waits until + the specified lock is changes state. diff --git a/source/reference/method/sh.waitForPingChange.txt b/source/reference/method/sh.waitForPingChange.txt index be0064f15a2..760981c9da7 100644 --- a/source/reference/method/sh.waitForPingChange.txt +++ b/source/reference/method/sh.waitForPingChange.txt @@ -4,5 +4,12 @@ sh.waitForPingChange() .. default-domain:: mongodb -.. method:: sh.waitForPingChange() +.. method:: sh.waitForPingChange(activepings, timeout, interval) + :param array activepings: an array of active pings from the + ``config.mongos`` collection. + + :param integer timeout: milliseconds to wait for a change in ping state. + + :param integer interval: milliseconds to sleep in each waiting cycle. + \ No newline at end of file From 04eed5e5d8e213ffcca5f31c4069653112e19411 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Thu, 14 Feb 2013 18:03:11 -0500 Subject: [PATCH 11/25] DOCS-1016 remove several commands which are internal and rarely used --- source/reference/method/sh._checkLastError.txt | 0 source/reference/method/sh._collRE.txt | 1 - source/reference/method/sh._dataFormat.txt | 1 - source/reference/method/sh._pchunk.txt | 1 - 4 files changed, 3 deletions(-) delete mode 100644 source/reference/method/sh._checkLastError.txt delete mode 100644 source/reference/method/sh._collRE.txt delete mode 100644 source/reference/method/sh._dataFormat.txt delete mode 100644 source/reference/method/sh._pchunk.txt diff --git a/source/reference/method/sh._checkLastError.txt b/source/reference/method/sh._checkLastError.txt deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/source/reference/method/sh._collRE.txt b/source/reference/method/sh._collRE.txt deleted file mode 100644 index af6d12954ab..00000000000 --- a/source/reference/method/sh._collRE.txt +++ /dev/null @@ -1 +0,0 @@ -remove \ No newline at end of file diff --git a/source/reference/method/sh._dataFormat.txt b/source/reference/method/sh._dataFormat.txt deleted file mode 100644 index af6d12954ab..00000000000 --- a/source/reference/method/sh._dataFormat.txt +++ /dev/null @@ -1 +0,0 @@ -remove \ No newline at end of file diff --git a/source/reference/method/sh._pchunk.txt b/source/reference/method/sh._pchunk.txt deleted file mode 100644 index af6d12954ab..00000000000 --- a/source/reference/method/sh._pchunk.txt +++ /dev/null @@ -1 +0,0 @@ -remove \ No newline at end of file From 4a795a834bad9b1bac7176631ec615931ce1cbe2 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Wed, 13 Feb 2013 17:44:06 -0500 Subject: [PATCH 12/25] DOCS-1016 document missing sharding shell helpers --- source/reference/method/sh._adminCommand.txt | 2 +- .../reference/method/sh._checkLastError.txt | 7 ++++ source/reference/method/sh._collRE.txt | 7 ++++ source/reference/method/sh._dataFormat.txt | 7 ++++ source/reference/method/sh._lastMigration.txt | 38 +++++++++---------- source/reference/method/sh._pchunk.txt | 7 ++++ .../method/sh.waitForBalancerOff.txt | 2 +- .../reference/method/sh.waitForPingChange.txt | 1 - 8 files changed, 49 insertions(+), 22 deletions(-) create mode 100644 source/reference/method/sh._checkLastError.txt create mode 100644 source/reference/method/sh._collRE.txt create mode 100644 source/reference/method/sh._dataFormat.txt create mode 100644 source/reference/method/sh._pchunk.txt diff --git a/source/reference/method/sh._adminCommand.txt b/source/reference/method/sh._adminCommand.txt index 53f5ca966ab..35093e64e67 100644 --- a/source/reference/method/sh._adminCommand.txt +++ b/source/reference/method/sh._adminCommand.txt @@ -16,4 +16,4 @@ sh._adminCommand() .. seealso:: - - :method:`db.runCommand` \ No newline at end of file + - :method:`db.runCommand` diff --git a/source/reference/method/sh._checkLastError.txt b/source/reference/method/sh._checkLastError.txt new file mode 100644 index 00000000000..8182310deb0 --- /dev/null +++ b/source/reference/method/sh._checkLastError.txt @@ -0,0 +1,7 @@ +==================== +sh._checkLastError() +==================== + +.. default-domain:: mongodb + +.. method:: sh._checkLastError() diff --git a/source/reference/method/sh._collRE.txt b/source/reference/method/sh._collRE.txt new file mode 100644 index 00000000000..19c88577730 --- /dev/null +++ b/source/reference/method/sh._collRE.txt @@ -0,0 +1,7 @@ +============ +sh._collRE() +============ + +.. default-domain:: mongodb + +.. method:: sh._collRE \ No newline at end of file diff --git a/source/reference/method/sh._dataFormat.txt b/source/reference/method/sh._dataFormat.txt new file mode 100644 index 00000000000..e75b3f2c023 --- /dev/null +++ b/source/reference/method/sh._dataFormat.txt @@ -0,0 +1,7 @@ +================ +sh._dataFormat() +================ + +.. default-domain:: mongodb + +.. method:: sh._dataFormat() \ No newline at end of file diff --git a/source/reference/method/sh._lastMigration.txt b/source/reference/method/sh._lastMigration.txt index 377671ac3de..e2bf6f3e455 100644 --- a/source/reference/method/sh._lastMigration.txt +++ b/source/reference/method/sh._lastMigration.txt @@ -9,26 +9,26 @@ sh._lastMigration() :param string namespace: The name of a database or collection within the current database. - :method:`sh._lastMigration()` returns a document with details about - the last migration performed on the database or collection you specify. - :returns: a document with fields detailing the most recent migration in the specified namespace. + + :method:`sh._lastMigration()` returns a document with details about + the last migration performed on the database or collection you specify. - :field string _id: the id of the migration task - - :field string server: the name of the server - - :field string clientAddr: the IP address and port number of the server. - - :field ISODate time: the time of the last migration. - - :field string what: the specific type of migration. - - :field string ns: the complete namespace of the collection affected - by the migration. + :field string _id: the id of the migration task + + :field string server: the name of the server + + :field string clientAddr: the IP address and port number of the server. + + :field ISODate time: the time of the last migration. + + :field string what: the specific type of migration. + + :field string ns: the complete namespace of the collection affected + by the migration. - :field document details: a document containing details about the - migrated chunk. Includes ``min`` and ``max`` - sub-documents with the bounds of the migrated - chunk \ No newline at end of file + :field document details: a document containing details about the + migrated chunk. Includes ``min`` and ``max`` + sub-documents with the bounds of the migrated + chunk diff --git a/source/reference/method/sh._pchunk.txt b/source/reference/method/sh._pchunk.txt new file mode 100644 index 00000000000..834260b7d89 --- /dev/null +++ b/source/reference/method/sh._pchunk.txt @@ -0,0 +1,7 @@ +============ +sh._pchunk() +============ + +.. default-domain:: mongodb + +.. method:: sh._pchunk() diff --git a/source/reference/method/sh.waitForBalancerOff.txt b/source/reference/method/sh.waitForBalancerOff.txt index 99bf27dcb58..e03c7e4c281 100644 --- a/source/reference/method/sh.waitForBalancerOff.txt +++ b/source/reference/method/sh.waitForBalancerOff.txt @@ -1,3 +1,4 @@ +<<<<<<< HEAD ======================= sh.waitForBalancerOff() ======================= @@ -12,7 +13,6 @@ sh.waitForBalancerOff() :method:`sh.waitForBalancerOff()` is an internal method that waits until the balancer is not running. - .. seealso:: diff --git a/source/reference/method/sh.waitForPingChange.txt b/source/reference/method/sh.waitForPingChange.txt index 760981c9da7..52b8ae92328 100644 --- a/source/reference/method/sh.waitForPingChange.txt +++ b/source/reference/method/sh.waitForPingChange.txt @@ -12,4 +12,3 @@ sh.waitForPingChange() :param integer timeout: milliseconds to wait for a change in ping state. :param integer interval: milliseconds to sleep in each waiting cycle. - \ No newline at end of file From f94865832d5c32114319601e81469e804850bacd Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Thu, 14 Feb 2013 18:01:18 -0500 Subject: [PATCH 13/25] DOCS-1016 copy edits & more for shard helpers --- source/reference/method/sh._checkLastError.txt | 7 ------- source/reference/method/sh._collRE.txt | 8 +------- source/reference/method/sh._dataFormat.txt | 8 +------- source/reference/method/sh._pchunk.txt | 8 +------- source/reference/method/sh.waitForBalancerOff.txt | 1 - 5 files changed, 3 insertions(+), 29 deletions(-) diff --git a/source/reference/method/sh._checkLastError.txt b/source/reference/method/sh._checkLastError.txt index 8182310deb0..e69de29bb2d 100644 --- a/source/reference/method/sh._checkLastError.txt +++ b/source/reference/method/sh._checkLastError.txt @@ -1,7 +0,0 @@ -==================== -sh._checkLastError() -==================== - -.. default-domain:: mongodb - -.. method:: sh._checkLastError() diff --git a/source/reference/method/sh._collRE.txt b/source/reference/method/sh._collRE.txt index 19c88577730..af6d12954ab 100644 --- a/source/reference/method/sh._collRE.txt +++ b/source/reference/method/sh._collRE.txt @@ -1,7 +1 @@ -============ -sh._collRE() -============ - -.. default-domain:: mongodb - -.. method:: sh._collRE \ No newline at end of file +remove \ No newline at end of file diff --git a/source/reference/method/sh._dataFormat.txt b/source/reference/method/sh._dataFormat.txt index e75b3f2c023..af6d12954ab 100644 --- a/source/reference/method/sh._dataFormat.txt +++ b/source/reference/method/sh._dataFormat.txt @@ -1,7 +1 @@ -================ -sh._dataFormat() -================ - -.. default-domain:: mongodb - -.. method:: sh._dataFormat() \ No newline at end of file +remove \ No newline at end of file diff --git a/source/reference/method/sh._pchunk.txt b/source/reference/method/sh._pchunk.txt index 834260b7d89..af6d12954ab 100644 --- a/source/reference/method/sh._pchunk.txt +++ b/source/reference/method/sh._pchunk.txt @@ -1,7 +1 @@ -============ -sh._pchunk() -============ - -.. default-domain:: mongodb - -.. method:: sh._pchunk() +remove \ No newline at end of file diff --git a/source/reference/method/sh.waitForBalancerOff.txt b/source/reference/method/sh.waitForBalancerOff.txt index e03c7e4c281..acc908ce65a 100644 --- a/source/reference/method/sh.waitForBalancerOff.txt +++ b/source/reference/method/sh.waitForBalancerOff.txt @@ -1,4 +1,3 @@ -<<<<<<< HEAD ======================= sh.waitForBalancerOff() ======================= From 031c296a6ef5fbc7110f8c13bc88a4a303c173f9 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Thu, 14 Feb 2013 18:03:11 -0500 Subject: [PATCH 14/25] DOCS-1016 remove several commands which are internal and rarely used --- source/reference/method/sh._checkLastError.txt | 0 source/reference/method/sh._collRE.txt | 1 - source/reference/method/sh._dataFormat.txt | 1 - source/reference/method/sh._pchunk.txt | 1 - 4 files changed, 3 deletions(-) delete mode 100644 source/reference/method/sh._checkLastError.txt delete mode 100644 source/reference/method/sh._collRE.txt delete mode 100644 source/reference/method/sh._dataFormat.txt delete mode 100644 source/reference/method/sh._pchunk.txt diff --git a/source/reference/method/sh._checkLastError.txt b/source/reference/method/sh._checkLastError.txt deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/source/reference/method/sh._collRE.txt b/source/reference/method/sh._collRE.txt deleted file mode 100644 index af6d12954ab..00000000000 --- a/source/reference/method/sh._collRE.txt +++ /dev/null @@ -1 +0,0 @@ -remove \ No newline at end of file diff --git a/source/reference/method/sh._dataFormat.txt b/source/reference/method/sh._dataFormat.txt deleted file mode 100644 index af6d12954ab..00000000000 --- a/source/reference/method/sh._dataFormat.txt +++ /dev/null @@ -1 +0,0 @@ -remove \ No newline at end of file diff --git a/source/reference/method/sh._pchunk.txt b/source/reference/method/sh._pchunk.txt deleted file mode 100644 index af6d12954ab..00000000000 --- a/source/reference/method/sh._pchunk.txt +++ /dev/null @@ -1 +0,0 @@ -remove \ No newline at end of file From a8cb672512e5820820459b91ac7becc81edba1fd Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Fri, 15 Feb 2013 12:41:34 -0500 Subject: [PATCH 15/25] DOCS-1016 minor cleanup --- source/reference/method/sh._adminCommand.txt | 1 + source/reference/method/sh._checkMongos.txt | 3 ++- source/reference/method/sh._lastMigration.txt | 4 ++-- source/reference/method/sh.getBalancerState.txt | 2 +- source/reference/method/sh.isBalancerRunning.txt | 2 +- source/reference/method/sh.setBalancerState.txt | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/source/reference/method/sh._adminCommand.txt b/source/reference/method/sh._adminCommand.txt index 35093e64e67..95bb5b6b543 100644 --- a/source/reference/method/sh._adminCommand.txt +++ b/source/reference/method/sh._adminCommand.txt @@ -8,6 +8,7 @@ sh._adminCommand() :param string dbcommand: a database command to run against the ``admin`` database. + :param Boolean checkMongos: verify whether or not the shell is connected to a :program:`mongos` instance. diff --git a/source/reference/method/sh._checkMongos.txt b/source/reference/method/sh._checkMongos.txt index 858dd853b8e..fac8dfe395c 100644 --- a/source/reference/method/sh._checkMongos.txt +++ b/source/reference/method/sh._checkMongos.txt @@ -7,8 +7,9 @@ sh._checkMongos() .. method:: sh._checkMongos() :returns: nothing + :throws: "not connected to a mongos" The :method:`sh._checkMongos()` method throws an error message if the :program:`mongo` shell is not connected to a :program:`mongos` instance. - Otherwise it exits (no return document or return code). \ No newline at end of file + Otherwise it exits (no return document or return code). diff --git a/source/reference/method/sh._lastMigration.txt b/source/reference/method/sh._lastMigration.txt index e2bf6f3e455..353e2dda23e 100644 --- a/source/reference/method/sh._lastMigration.txt +++ b/source/reference/method/sh._lastMigration.txt @@ -27,8 +27,8 @@ sh._lastMigration() :field string ns: the complete namespace of the collection affected by the migration. - + :field document details: a document containing details about the migrated chunk. Includes ``min`` and ``max`` sub-documents with the bounds of the migrated - chunk + chunk. diff --git a/source/reference/method/sh.getBalancerState.txt b/source/reference/method/sh.getBalancerState.txt index 61a27eca4f4..71911fde536 100644 --- a/source/reference/method/sh.getBalancerState.txt +++ b/source/reference/method/sh.getBalancerState.txt @@ -6,7 +6,7 @@ sh.getBalancerState() .. method:: sh.getBalancerState() - :returns: Boolean. + :returns: Boolean :method:`sh.getBalancerState()` returns ``true`` when the :term:`balancer` is enabled and false if the balancer is diff --git a/source/reference/method/sh.isBalancerRunning.txt b/source/reference/method/sh.isBalancerRunning.txt index 3b89110e06f..43bd9d48331 100644 --- a/source/reference/method/sh.isBalancerRunning.txt +++ b/source/reference/method/sh.isBalancerRunning.txt @@ -6,7 +6,7 @@ sh.isBalancerRunning() .. method:: sh.isBalancerRunning() - :returns: boolean. + :returns: Boolean. Returns true if the :term:`balancer` process is currently running and migrating chunks and false if the balancer process is not diff --git a/source/reference/method/sh.setBalancerState.txt b/source/reference/method/sh.setBalancerState.txt index 49c7facbd94..3dd20023cc3 100644 --- a/source/reference/method/sh.setBalancerState.txt +++ b/source/reference/method/sh.setBalancerState.txt @@ -6,7 +6,7 @@ sh.setBalancerState() .. method:: sh.setBalancerState(state) - :param boolean state: ``true`` enables the balancer if disabled, + :param Boolean state: ``true`` enables the balancer if disabled, and ``false`` disables the balancer. Enables or disables the :term:`balancer`. Use From 73c8a0769caebe37481cd906eba0711cc39bc537 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Fri, 15 Feb 2013 12:42:34 -0500 Subject: [PATCH 16/25] DOCS-1016 minor cleanup --- source/reference/method/sh.isBalancerRunning.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/reference/method/sh.isBalancerRunning.txt b/source/reference/method/sh.isBalancerRunning.txt index 43bd9d48331..87e58de6f9e 100644 --- a/source/reference/method/sh.isBalancerRunning.txt +++ b/source/reference/method/sh.isBalancerRunning.txt @@ -6,7 +6,7 @@ sh.isBalancerRunning() .. method:: sh.isBalancerRunning() - :returns: Boolean. + :returns: Boolean Returns true if the :term:`balancer` process is currently running and migrating chunks and false if the balancer process is not From 94185717115597f8fe5e65294905974e5bab5f0d Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Mon, 18 Feb 2013 11:11:43 -0500 Subject: [PATCH 17/25] DOCS-1131 maxSize=0 --- source/reference/command/addShard.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/source/reference/command/addShard.txt b/source/reference/command/addShard.txt index 25428cba365..48c504b52c4 100644 --- a/source/reference/command/addShard.txt +++ b/source/reference/command/addShard.txt @@ -12,11 +12,12 @@ addShard automatically provided to uniquely identify the shard. - :param integer maxSize: Optional. Unless specified, shards will consume - the total amount of available space on their - machines if necessary. Use the ``maxSize`` value - to limit the amount of space the database can - use. Specify this value in megabytes. + :param integer maxSize: Optional, megabytes. Limits the maximum size + of a shard. + Under normal operations, MongoDB will use as + much space as necessary for shard storage. + A ``maxSize`` of ``0`` is interpreted as if the + field were not specified. Use the :dbcommand:`addShard` command to add a database instance or replica set to a :term:`sharded cluster`. From 278602c6446a07afdc5cd6b6b06f7b3262682533 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Mon, 18 Feb 2013 11:48:50 -0500 Subject: [PATCH 18/25] DOCS-1133 document size limit on collection to be sharded --- source/reference/limits.txt | 8 ++++++++ source/reference/method/sh.shardCollection.txt | 7 +++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/source/reference/limits.txt b/source/reference/limits.txt index 28d06a83cb0..47426001b2b 100644 --- a/source/reference/limits.txt +++ b/source/reference/limits.txt @@ -109,6 +109,14 @@ Replica Sets Only 7 members of a replica set can have votes at any given time. See can vote :ref:`replica-set-non-voting-members` for more information +Sharded Collections +~~~~~~~~~~~~~~~~~~~ + +.. limit:: Size of sharded collection + + An existing collection must be under 256Gb (2\ :sup:`30`) in size in + order to enable sharding on the collection. + Operations ~~~~~~~~~~ diff --git a/source/reference/method/sh.shardCollection.txt b/source/reference/method/sh.shardCollection.txt index 719c886c49f..b0a3ef7cd26 100644 --- a/source/reference/method/sh.shardCollection.txt +++ b/source/reference/method/sh.shardCollection.txt @@ -6,9 +6,9 @@ sh.shardCollection() .. method:: sh.shardCollection(collection,key,unique) - :param name collection: The name of the collection to shard. + :param string collection: The namespace of the collection to shard. - :param document key: A :term:`document` containing :term:`shard key` + :param document key: A :term:`document` containing a :term:`shard key` that the sharding system uses to :term:`partition` and distribute objects among the shards. @@ -22,3 +22,6 @@ sh.shardCollection() :term:`shard key`. Specify shard keys in the form of a :term:`document`. Shard keys may refer to a single document field, or more typically several document fields to form a "compound shard key." + + An existing collection must be under 256Gb in size in order to enable + sharding. From 7943cd01439266c48bbaff378ce8fb4781d66b35 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Mon, 18 Feb 2013 15:05:14 -0500 Subject: [PATCH 19/25] DOCS-1120 improve example of replica set priorities when primary --- source/administration/replica-sets.txt | 73 +++++++++++++++----------- 1 file changed, 42 insertions(+), 31 deletions(-) diff --git a/source/administration/replica-sets.txt b/source/administration/replica-sets.txt index 911525f8849..2447bb33a21 100644 --- a/source/administration/replica-sets.txt +++ b/source/administration/replica-sets.txt @@ -74,7 +74,7 @@ Secondary-Only Members The secondary-only configuration prevents a :term:`secondary` member in a :term:`replica set` from ever becoming a :term:`primary` in a :term:`failover`. You can set secondary-only mode for any member of -the set. +the set except the current primary. For example, you may want to configure all members of a replica sets located outside of the main data centers as secondary-only to prevent @@ -96,26 +96,28 @@ replica set. Use the following sequence of operations in the .. code-block:: javascript cfg = rs.conf() - cfg.members[0].priority = 0 - cfg.members[1].priority = 0.5 - cfg.members[2].priority = 1 - cfg.members[3].priority = 2 + cfg.members[0].priority = 2 + cfg.members[1].priority = 1 + cfg.members[2].priority = 0.5 + cfg.members[3].priority = 0 rs.reconfig(cfg) -This configures the set, with the following priority settings: +This reconfigures the set, with the following priority settings: + +- Member ``0`` to a priority of ``2`` so that it becomes primary, under + most circumstances. -- Member ``0`` to a priority of ``0`` so that it can never become :term:`primary`. +- Member ``1`` to a priority of ``1``, which is the default value. + Member ``1`` becomes primary if no member with a *higher* priority is + eligible. -- Member ``1`` to a priority of ``0.5``, which makes it less likely to +- Member ``2`` to a priority of ``0.5``, which makes it less likely to become primary than other members but doesn't prohibit the possibility. -- Member ``2`` to a priority of ``1``, which is the default value. - Member ``2`` becomes primary if no member with a *higher* priority is - eligible. - -- Member ``3`` to a priority of ``2``. Member ``3`` becomes primary, if - eligible, under most circumstances. +- Member ``3`` to a priority of ``0``. + Member ``3`` cannot become the :term:`primary` member under any + circumstances. .. note:: @@ -124,6 +126,15 @@ This configures the set, with the following priority settings: members can quickly obtain a majority of votes in an election for primary. +.. note:: + + The current :term:`primary` cannot be assigned a + :data:`~local.system.replset.settings.members[n].priority` of 0. + If you want to prevent the current primary from being elected + primary again, you must first cause it to step down and then + set the appropriate priority with a :method:`replica set + reconfiguration `. + .. seealso:: :data:`~local.system.replset.settings.members[n].priority` and :ref:`Replica Set Reconfiguration `. @@ -667,7 +678,7 @@ You can use the following sequence of commands: cfg.settings.chainingAllowed = true rs.reconfig(cfg) -.. note:: +.. note:: If chained replication is disabled, you still can use :dbcommand:`replSetSyncFrom` to specify that a secondary replicates @@ -745,11 +756,11 @@ To resync the stale member: At this point, the :program:`mongod` will perform an initial sync. The length of the initial sync may process depends on the size of the database and network connection between members of the - replica set. + replica set. Initial sync operations can impact the other members of the set and create additional traffic to the primary, and can only occur if - another member of the set is accessible and up to date. + another member of the set is accessible and up to date. .. index:: replica set; resync .. _replica-set-resync-by-copying: @@ -758,14 +769,14 @@ Resync by Copying All Datafiles from Another Member ``````````````````````````````````````````````````` This approach uses a copy of the data files from an existing member of -the replica set, or a back of the data files to "seed" the stale member. +the replica set, or a back of the data files to "seed" the stale member. The copy or backup of the data files **must** be sufficiently recent to allow the new member to catch up with the :term:`oplog`, otherwise the member would need to perform an initial sync. -.. note:: - +.. note:: + In most cases you cannot copy data files from a running :program:`mongod` instance to another, because the data files will change during the file copy operation. Consider the @@ -775,7 +786,7 @@ the member would need to perform an initial sync. After you have copied the data files from the "seed" source, start the :program:`mongod` instance and allow it to apply all operations from -the oplog until it refelcts the current state of the replica set. +the oplog until it reflects the current state of the replica set. .. _replica-set-security: @@ -795,12 +806,12 @@ Additionally, MongoDB provides an authentication mechanism for replica sets. These instances enable authentication but specify a shared key file that serves as a shared password. -.. versionadded:: 1.8 +.. versionadded:: 1.8 Added support authentication in replica set deployments. .. versionchanged:: 1.9.1 Added support authentication in sharded replica set deployments. - + To enable authentication add the following option to your configuration file: @@ -1155,9 +1166,9 @@ the oplog has the wrong data type in the ``ts`` field. .. code-block:: javascript { "ts" : {t: 1347982456000, i: 1}, - "h" : NumberLong("8191276672478122996"), - "op" : "n", - "ns" : "", + "h" : NumberLong("8191276672478122996"), + "op" : "n", + "ns" : "", "o" : { "msg" : "Reconfig set", "version" : 4 } } And the second query returns this as the last entry where ``ts`` @@ -1165,10 +1176,10 @@ the oplog has the wrong data type in the ``ts`` field. .. code-block:: javascript - { "ts" : Timestamp(1347982454000, 1), - "h" : NumberLong("6188469075153256465"), - "op" : "n", - "ns" : "", + { "ts" : Timestamp(1347982454000, 1), + "h" : NumberLong("6188469075153256465"), + "op" : "n", + "ns" : "", "o" : { "msg" : "Reconfig set", "version" : 3 } } Then the value for the ``ts`` field in the last oplog entry is of the @@ -1179,7 +1190,7 @@ use an update operation that resembles the following: .. code-block:: javascript - db.oplog.rs.update( { ts: { t:1347982456000, i:1 } }, + db.oplog.rs.update( { ts: { t:1347982456000, i:1 } }, { $set: { ts: new Timestamp(1347982456000, 1)}}) Modify the timestamp values as needed based on your oplog entry. This From 90fdc0b7639b842603d6f51dc0040d8d008b66ed Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Mon, 18 Feb 2013 15:22:52 -0500 Subject: [PATCH 20/25] DOCS-1120 replica set priorities / fix intradocument links --- source/administration/replica-sets.txt | 56 +++++++++++++------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/source/administration/replica-sets.txt b/source/administration/replica-sets.txt index 2447bb33a21..14f8c2cfc05 100644 --- a/source/administration/replica-sets.txt +++ b/source/administration/replica-sets.txt @@ -81,8 +81,8 @@ located outside of the main data centers as secondary-only to prevent these members from ever becoming primary. To configure a member as secondary-only, set its -:data:`~local.system.replset.settings.members[n].priority` value to ``0``. Any member with a -:data:`~local.system.replset.settings.members[n].priority` equal to ``0`` will never seek +:data:`~local.system.replset.members[n].priority` value to ``0``. Any member with a +:data:`~local.system.replset.members[n].priority` equal to ``0`` will never seek :ref:`election ` and cannot become primary in any situation. For more information on priority levels, see :ref:`replica-set-node-priority`. @@ -129,14 +129,14 @@ This reconfigures the set, with the following priority settings: .. note:: The current :term:`primary` cannot be assigned a - :data:`~local.system.replset.settings.members[n].priority` of 0. + :data:`~local.system.replset.members[n].priority` of 0. If you want to prevent the current primary from being elected primary again, you must first cause it to step down and then set the appropriate priority with a :method:`replica set reconfiguration `. -.. seealso:: :data:`~local.system.replset.settings.members[n].priority` and :ref:`Replica Set - Reconfiguration `. +.. seealso:: :data:`~local.system.replset.members[n].priority` and + :ref:`Replica Set Reconfiguration `. .. index:: replica set members; hidden .. _replica-set-hidden-members: @@ -155,8 +155,8 @@ from normal traffic. Typically, hidden members provide reporting, dedicated backups, and dedicated read-only testing and integration support. -Hidden members have :data:`~local.system.replset.settings.members[n].priority` set -``0`` and have :data:`~local.system.replset.settings.members[n].hidden` set to ``true``. +Hidden members have :data:`~local.system.replset.members[n].priority` set +``0`` and have :data:`~local.system.replset.members[n].hidden` set to ``true``. To configure a :term:`hidden member`, use the following sequence of operations in the :program:`mongo` shell: @@ -169,7 +169,7 @@ operations in the :program:`mongo` shell: rs.reconfig(cfg) After re-configuring the set, the first member of the set in the -:data:`~local.system.replset.settings.members` array will have a priority of ``0`` +:data:`~local.system.replset.members` array will have a priority of ``0`` so that it cannot become primary. The other members in the set will not advertise the hidden member in the :dbcommand:`isMaster` or :method:`db.isMaster()` output. @@ -179,7 +179,7 @@ not advertise the hidden member in the :dbcommand:`isMaster` or You must send the :method:`rs.reconfig()` command to a set member that *can* become :term:`primary`. In the above example, if you issue the :method:`rs.reconfig()` operation to a member with a - :data:`~local.system.replset.members.[n].priority` of ``0`` the operation will + :data:`~local.system.replset.members[n].priority` of ``0`` the operation will fail. .. note:: @@ -239,24 +239,24 @@ following sequence of operations in the :program:`mongo` shell: rs.reconfig(cfg) After the replica set reconfigures, the first member of the set in the -:data:`~local.system.replset.settings.members` array will have a priority +:data:`~local.system.replset.members` array will have a priority of ``0`` and cannot become :term:`primary`. The :data:`slaveDelay ` value delays both replication and the member's :term:`oplog` by 3600 seconds (1 -hour). Setting :data:`~local.system.replset.settings.members[n].slaveDelay` to a -non-zero value also sets :data:`~local.system.replset.settings.members[n].hidden` to +hour). Setting :data:`~local.system.replset.members[n].slaveDelay` to a +non-zero value also sets :data:`~local.system.replset.members[n].hidden` to ``true`` for this replica set so that it does not receive application queries in normal operations. .. warning:: The length of the secondary - :data:`~local.system.replset.settings.members[n].slaveDelay` must + :data:`~local.system.replset.members[n].slaveDelay` must fit within the window of the oplog. If the oplog is shorter than - the :data:`~local.system.replset.settings.members[n].slaveDelay` + the :data:`~local.system.replset.members[n].slaveDelay` window, the delayed member cannot successfully replicate operations. -.. seealso:: :data:`~local.system.replset.settings.members[n].slaveDelay`, :ref:`Replica Set Reconfiguration +.. seealso:: :data:`~local.system.replset.members[n].slaveDelay`, :ref:`Replica Set Reconfiguration `, :ref:`replica-set-oplog-sizing`, :ref:`replica-set-procedure-change-oplog-size` in this document, and the :doc:`/tutorial/change-oplog-size` tutorial. @@ -331,7 +331,7 @@ command sequence in the :program:`mongo` shell. This sequence gives ``0`` votes to the fourth, fifth, and sixth members of the set according to the order of the -:data:`~local.system.replset.settings.members` array in the output of +:data:`~local.system.replset.members` array in the output of :method:`rs.conf()`. This setting allows the set to elect these members as :term:`primary` but does not allow them to vote in elections. If you have three non-voting members, you can add three @@ -347,7 +347,7 @@ the event of a network partition. ` to control which members are more likely to become primary. -.. seealso:: :data:`~local.system.replset.settings.members[n].votes` and :ref:`Replica Set +.. seealso:: :data:`~local.system.replset.members[n].votes` and :ref:`Replica Set Reconfiguration `. .. _replica-set-chained-replication: @@ -451,7 +451,7 @@ You can re-add a removed member to a replica set at any time using the :ref:`procedure for adding replica set members `. Additionally, consider using the :ref:`replica set reconfiguration procedure ` to change the -:data:`~local.system.replset.settings.members[n].host` value to rename a member in a replica set +:data:`~local.system.replset.members[n].host` value to rename a member in a replica set directly. .. _replica-set-admin-procedure-replace-member: @@ -469,9 +469,9 @@ completely replace all configured options related to the previous member. Use :method:`rs.reconfig()` to change the value of the -:data:`~local.system.replset.settings.members[n].host` field to reflect the new hostname or port +:data:`~local.system.replset.members[n].host` field to reflect the new hostname or port number. :method:`rs.reconfig()` will not change the value of -:data:`~local.system.replset.settings.members[n]._id`. +:data:`~local.system.replset.members[n]._id`. .. code-block:: javascript @@ -492,7 +492,7 @@ number. :method:`rs.reconfig()` will not change the value of Adjusting Priority ~~~~~~~~~~~~~~~~~~ -To change the value of the :data:`~local.system.replset.settings.members[n].priority` in the +To change the value of the :data:`~local.system.replset.members[n].priority` in the replica set configuration, use the following sequence of commands in the :program:`mongo` shell: @@ -507,7 +507,7 @@ the :program:`mongo` shell: The first operation uses :method:`rs.conf()` to set the local variable ``cfg`` to the contents of the current replica set configuration, which is a :term:`document`. The next three operations change the -:data:`~local.system.replset.settings.members[n].priority` value in the ``cfg`` document for the +:data:`~local.system.replset.members[n].priority` value in the ``cfg`` document for the first three members configured in the :data:`members ` array. The final operation calls :method:`rs.reconfig()` with the argument of ``cfg`` to initialize @@ -515,24 +515,24 @@ the new configuration. .. include:: /includes/note-rs-conf-array-index.rst -If a member has :data:`~local.system.replset.settings.members[n].priority` set to ``0``, it is +If a member has :data:`~local.system.replset.members[n].priority` set to ``0``, it is ineligible to become :term:`primary` and will not seek election. :ref:`Hidden members `, :ref:`delayed members `, and -:ref:`arbiters ` all have :data:`~local.system.replset.settings.members[n].priority` +:ref:`arbiters ` all have :data:`~local.system.replset.members[n].priority` set to ``0``. -All members have a :data:`~local.system.replset.settings.members[n].priority` equal to ``1`` by default. +All members have a :data:`~local.system.replset.members[n].priority` equal to ``1`` by default. -The value of :data:`~local.system.replset.settings.members[n].priority` can be any floating point +The value of :data:`~local.system.replset.members[n].priority` can be any floating point (i.e. decimal) number between ``0`` and ``1000``. Priorities are only used to determine the preference in election. The priority value is used only in relation to other members. With the exception of members with a priority of ``0``, the absolute value of the -:data:`~local.system.replset.settings.members[n].priority` value is irrelevant. +:data:`~local.system.replset.members[n].priority` value is irrelevant. Replica sets will preferentially elect and maintain the primary status -of the member with the highest :data:`~local.system.replset.settings.members[n].priority` setting. +of the member with the highest :data:`~local.system.replset.members[n].priority` setting. .. warning:: From a4d8496fc1d8f46bfa4798afc86ca12d45412b09 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Mon, 18 Feb 2013 15:34:56 -0500 Subject: [PATCH 21/25] Fix broken links, replset.settings.members is not valid --- source/administration/master-slave.txt | 2 +- source/reference/connection-pool-stats.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/administration/master-slave.txt b/source/administration/master-slave.txt index 37d74289822..7a7b6193525 100644 --- a/source/administration/master-slave.txt +++ b/source/administration/master-slave.txt @@ -240,7 +240,7 @@ See :doc:`/reference/replica-configuration` for more information about replica set configurations. .. [#host-are-hostnames] In replica set configurations, the - :data:`~local.system.replset.settings.members[n].host` field must hold a resolvable + :data:`~local.system.replset.members[n].host` field must hold a resolvable hostname. Failing over to a Slave (Promotion) diff --git a/source/reference/connection-pool-stats.txt b/source/reference/connection-pool-stats.txt index 1c5bc521205..8076deb3542 100644 --- a/source/reference/connection-pool-stats.txt +++ b/source/reference/connection-pool-stats.txt @@ -105,7 +105,7 @@ Output .. versionadded:: 2.2 :data:`~connPoolStats.replicaSets.[shard].host[n].tags` reports the - :data:`~local.system.replset.settings.members[n].tags`, if this member of the set has tags + :data:`~local.system.replset.members[n].tags`, if this member of the set has tags configured. .. data:: connPoolStats.replicaSets.[shard].master From 4a1143f755dc893c85c07276526d9d1498edc3de Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Fri, 22 Feb 2013 16:46:30 -0500 Subject: [PATCH 22/25] DOCS-1131 incorporate code review comments --- source/reference/command/addShard.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/reference/command/addShard.txt b/source/reference/command/addShard.txt index 48c504b52c4..26e62893de2 100644 --- a/source/reference/command/addShard.txt +++ b/source/reference/command/addShard.txt @@ -14,10 +14,8 @@ addShard :param integer maxSize: Optional, megabytes. Limits the maximum size of a shard. - Under normal operations, MongoDB will use as - much space as necessary for shard storage. - A ``maxSize`` of ``0`` is interpreted as if the - field were not specified. + If ``maxSize`` is ``0`` then MongoDB will not + limit the size of the shard. Use the :dbcommand:`addShard` command to add a database instance or replica set to a :term:`sharded cluster`. From f349cbb81fd6bf0fd8fdf35b222f3d6cda89f0e7 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Fri, 22 Feb 2013 16:54:15 -0500 Subject: [PATCH 23/25] DOCS-1120 improve replica set priority documentation --- source/administration/replica-sets.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/administration/replica-sets.txt b/source/administration/replica-sets.txt index 14f8c2cfc05..832934ed4e0 100644 --- a/source/administration/replica-sets.txt +++ b/source/administration/replica-sets.txt @@ -131,9 +131,9 @@ This reconfigures the set, with the following priority settings: The current :term:`primary` cannot be assigned a :data:`~local.system.replset.members[n].priority` of 0. If you want to prevent the current primary from being elected - primary again, you must first cause it to step down and then - set the appropriate priority with a :method:`replica set - reconfiguration `. + primary again, you must demote it using + :method:`rs.stepDown()` and then set the appropriate priority + with the :method:`rs.reconfig()` method. .. seealso:: :data:`~local.system.replset.members[n].priority` and :ref:`Replica Set Reconfiguration `. From 0d61d5cfd2da1bc08fe03615c7648f0d359c64dd Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Fri, 22 Feb 2013 17:03:31 -0500 Subject: [PATCH 24/25] DOCS-1133 document size limit on collection to be sharded --- source/reference/limits.txt | 32 ++++++++++--------- .../reference/method/sh.shardCollection.txt | 3 +- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/source/reference/limits.txt b/source/reference/limits.txt index 47426001b2b..df954a4bd63 100644 --- a/source/reference/limits.txt +++ b/source/reference/limits.txt @@ -109,23 +109,9 @@ Replica Sets Only 7 members of a replica set can have votes at any given time. See can vote :ref:`replica-set-non-voting-members` for more information -Sharded Collections +Sharded Clusters ~~~~~~~~~~~~~~~~~~~ -.. limit:: Size of sharded collection - - An existing collection must be under 256Gb (2\ :sup:`30`) in size in - order to enable sharding on the collection. - -Operations -~~~~~~~~~~ - -.. _limit-sort: -.. limit:: Sorted Documents - - MongoDB will only return sorted results on fields without an index - *if* the sort operation uses less than 32 megabytes of memory. - .. _limit-sharding-limitations: .. limit:: Operations Unavailable in Sharded Environments @@ -145,6 +131,22 @@ Operations :operator:`$snapshot` queries do not work in sharded environments. +.. limit:: Size of Sharded Collection + + MongoDB only permits sharding an existing collection that holds + fewer than 256 gigabytes of data. + +.. seealso:: :limit:`Unique Indexes in Sharded Collections` + +Operations +~~~~~~~~~~ + +.. _limit-sort: +.. limit:: Sorted Documents + + MongoDB will only return sorted results on fields without an index + *if* the sort operation uses less than 32 megabytes of memory. + .. limit:: 2d Geospatial queries cannot use the $or operator .. see:: :operator:`$or` and :doc:`/core/geospatial-indexes`. diff --git a/source/reference/method/sh.shardCollection.txt b/source/reference/method/sh.shardCollection.txt index b0a3ef7cd26..29ebef38c17 100644 --- a/source/reference/method/sh.shardCollection.txt +++ b/source/reference/method/sh.shardCollection.txt @@ -23,5 +23,4 @@ sh.shardCollection() Shard keys may refer to a single document field, or more typically several document fields to form a "compound shard key." - An existing collection must be under 256Gb in size in order to enable - sharding. + .. see:: :limit:`Size of Sharded Collection` From 737d706ad463aeb0ed85246c9b3fc49541d5ca11 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Fri, 22 Feb 2013 18:07:58 -0500 Subject: [PATCH 25/25] DOCS-1016 final update/copy edits to undocumented sharding methods --- source/reference/method/sh._adminCommand.txt | 8 +++----- source/reference/method/sh._checkFullName.txt | 4 ++-- source/reference/method/sh._lastMigration.txt | 18 ++++++++++-------- .../reference/method/sh.disableBalancing.txt | 2 +- source/reference/method/sh.enableBalancing.txt | 2 +- source/reference/method/sh.enableSharding.txt | 6 ++---- source/reference/method/sh.getBalancerHost.txt | 2 +- .../reference/method/sh.getBalancerState.txt | 2 +- .../reference/method/sh.isBalancerRunning.txt | 2 +- .../reference/method/sh.setBalancerState.txt | 2 +- source/reference/method/sh.startBalancer.txt | 4 ++-- source/reference/method/sh.stopBalancer.txt | 4 ++-- source/reference/method/sh.waitForBalancer.txt | 6 +++--- .../reference/method/sh.waitForBalancerOff.txt | 4 ++-- source/reference/method/sh.waitForDLock.txt | 8 ++++---- .../reference/method/sh.waitForPingChange.txt | 9 ++++++--- 16 files changed, 42 insertions(+), 41 deletions(-) diff --git a/source/reference/method/sh._adminCommand.txt b/source/reference/method/sh._adminCommand.txt index 95bb5b6b543..dd366f69e5b 100644 --- a/source/reference/method/sh._adminCommand.txt +++ b/source/reference/method/sh._adminCommand.txt @@ -6,15 +6,13 @@ sh._adminCommand() .. method:: sh._adminCommand(cmd, checkMongos) - :param string dbcommand: a database command to run against the ``admin`` + :param string dbcommand: A database command to run against the ``admin`` database. - :param Boolean checkMongos: verify whether or not the shell is connected + :param Boolean checkMongos: Verify whether or not the shell is connected to a :program:`mongos` instance. The :method:`sh._adminCommand` method runs a database command against the admin database of a :program:`mongos` instance. -.. seealso:: - - - :method:`db.runCommand` +.. seealso:: :method:`db.runCommand()` diff --git a/source/reference/method/sh._checkFullName.txt b/source/reference/method/sh._checkFullName.txt index 77b1c0085b8..b4cf171366e 100644 --- a/source/reference/method/sh._checkFullName.txt +++ b/source/reference/method/sh._checkFullName.txt @@ -6,11 +6,11 @@ sh._checkFullName() .. method:: sh._checkFullName(namespace) - :param string namespace: specify a complete namespace. + :param string namespace: Specify a complete namespace. :throws: "name needs to be fully qualified ." The :method:`sh._checkFullName()` method verifies that a namespace name is well-formed. If the name has a period ``.`` then the :method:`sh._checkFullName()` method exits, otherwise it throws - an error. \ No newline at end of file + an error. diff --git a/source/reference/method/sh._lastMigration.txt b/source/reference/method/sh._lastMigration.txt index 74a89b87c78..9c926fd3d56 100644 --- a/source/reference/method/sh._lastMigration.txt +++ b/source/reference/method/sh._lastMigration.txt @@ -9,26 +9,28 @@ sh._lastMigration() :param string namespace: The name of a database or collection within the current database. - :returns: a document with fields detailing the most recent migration + :returns: A document with fields detailing the most recent migration in the specified namespace. :method:`sh._lastMigration()` returns a document with details about the last migration performed on the database or collection you specify. + + Document details: - :field string _id: the id of the migration task + :field string _id: The id of the migration task - :field string server: the name of the server + :field string server: The name of the server - :field string clientAddr: the IP address and port number of the server. + :field string clientAddr: The IP address and port number of the server. - :field ISODate time: the time of the last migration. + :field ISODate time: The time of the last migration. - :field string what: the specific type of migration. + :field string what: The specific type of migration. - :field string ns: the complete namespace of the collection affected + :field string ns: The complete namespace of the collection affected by the migration. - :field document details: a document containing details about the + :field document details: A document containing details about the migrated chunk. Includes ``min`` and ``max`` sub-documents with the bounds of the migrated chunk. diff --git a/source/reference/method/sh.disableBalancing.txt b/source/reference/method/sh.disableBalancing.txt index 6cb203fd59b..72a4afefced 100644 --- a/source/reference/method/sh.disableBalancing.txt +++ b/source/reference/method/sh.disableBalancing.txt @@ -6,7 +6,7 @@ sh.disableBalancing() .. method:: sh.disableBalancing(collection) - :param string collection: the name of a collection. + :param string collection: The name of a collection. :method:`sh.disableBalancing()` disables the balancer for the specified sharded collection. diff --git a/source/reference/method/sh.enableBalancing.txt b/source/reference/method/sh.enableBalancing.txt index baaf7e40f55..0f86f788361 100644 --- a/source/reference/method/sh.enableBalancing.txt +++ b/source/reference/method/sh.enableBalancing.txt @@ -6,7 +6,7 @@ sh.enableBalancing() .. method:: sh.enableBalancing(collection) - :param string collection: the name of a collection. + :param string collection: The name of a collection. :method:`sh.enableBalancing()` enables the balancer for the specified sharded collection. diff --git a/source/reference/method/sh.enableSharding.txt b/source/reference/method/sh.enableSharding.txt index 04fc899b19c..8fd05b1549c 100644 --- a/source/reference/method/sh.enableSharding.txt +++ b/source/reference/method/sh.enableSharding.txt @@ -12,7 +12,5 @@ sh.enableSharding() automatically shard any collections, but makes it possible to begin sharding collections using :method:`sh.shardCollection()`. -.. seealso:: - - - :ref:`sh.shardCollection()` - \ No newline at end of file +.. seealso:: :method:`sh.shardCollection()` + diff --git a/source/reference/method/sh.getBalancerHost.txt b/source/reference/method/sh.getBalancerHost.txt index fcaefd86745..dbadc86c0d4 100644 --- a/source/reference/method/sh.getBalancerHost.txt +++ b/source/reference/method/sh.getBalancerHost.txt @@ -6,7 +6,7 @@ sh.getBalancerHost() .. method:: sh.getBalancerHost() - :returns: string in form :samp:`{hostname}:{port}` + :returns: String in form :samp:`{hostname}:{port}` :method:`sh.getBalancerHost()` returns the name of the server that is running the balancer. diff --git a/source/reference/method/sh.getBalancerState.txt b/source/reference/method/sh.getBalancerState.txt index 71911fde536..c39ffdd5fc7 100644 --- a/source/reference/method/sh.getBalancerState.txt +++ b/source/reference/method/sh.getBalancerState.txt @@ -6,7 +6,7 @@ sh.getBalancerState() .. method:: sh.getBalancerState() - :returns: Boolean + :returns: boolean :method:`sh.getBalancerState()` returns ``true`` when the :term:`balancer` is enabled and false if the balancer is diff --git a/source/reference/method/sh.isBalancerRunning.txt b/source/reference/method/sh.isBalancerRunning.txt index 87e58de6f9e..8e112a6aa68 100644 --- a/source/reference/method/sh.isBalancerRunning.txt +++ b/source/reference/method/sh.isBalancerRunning.txt @@ -6,7 +6,7 @@ sh.isBalancerRunning() .. method:: sh.isBalancerRunning() - :returns: Boolean + :returns: boolean Returns true if the :term:`balancer` process is currently running and migrating chunks and false if the balancer process is not diff --git a/source/reference/method/sh.setBalancerState.txt b/source/reference/method/sh.setBalancerState.txt index 3dd20023cc3..49c7facbd94 100644 --- a/source/reference/method/sh.setBalancerState.txt +++ b/source/reference/method/sh.setBalancerState.txt @@ -6,7 +6,7 @@ sh.setBalancerState() .. method:: sh.setBalancerState(state) - :param Boolean state: ``true`` enables the balancer if disabled, + :param boolean state: ``true`` enables the balancer if disabled, and ``false`` disables the balancer. Enables or disables the :term:`balancer`. Use diff --git a/source/reference/method/sh.startBalancer.txt b/source/reference/method/sh.startBalancer.txt index 9c79dd471f0..27c81a87aa6 100644 --- a/source/reference/method/sh.startBalancer.txt +++ b/source/reference/method/sh.startBalancer.txt @@ -6,9 +6,9 @@ sh.startBalancer() .. method:: sh.startBalancer(timeout, interval) - :param integer timeout: milliseconds to wait. + :param integer timeout: Milliseconds to wait. - :param integer interval: milliseconds to sleep each cycle of waiting. + :param integer interval: Milliseconds to sleep each cycle of waiting. The :method:`sh.startBalancer()` enables the balancer in a sharded cluster and waits for balancing to initiate. diff --git a/source/reference/method/sh.stopBalancer.txt b/source/reference/method/sh.stopBalancer.txt index 2cb3fffe2c9..86f395a8c91 100644 --- a/source/reference/method/sh.stopBalancer.txt +++ b/source/reference/method/sh.stopBalancer.txt @@ -6,9 +6,9 @@ sh.stopBalancer() .. method:: sh.stopBalancer(timeout, interval) - :param integer timeout: milliseconds to wait. + :param integer timeout: Milliseconds to wait. - :param integer interval: milliseconds to sleep each cycle of waiting. + :param integer interval: Milliseconds to sleep each cycle of waiting. The :method:`sh.stopBalancer()` disables the balancer in a sharded cluster and waits for balancing to complete. diff --git a/source/reference/method/sh.waitForBalancer.txt b/source/reference/method/sh.waitForBalancer.txt index 171e714e32c..705498eaa88 100644 --- a/source/reference/method/sh.waitForBalancer.txt +++ b/source/reference/method/sh.waitForBalancer.txt @@ -6,12 +6,12 @@ sh.waitForBalancer() .. method:: sh.waitForBalancer(onOrNot, timeout, interval) - :param Boolean onOrNot: whether to wait for the lock to be + :param Boolean onOrNot: Whether to wait for the lock to be on (``true``) or off (``false``). - :param integer timeout: milliseconds to wait. + :param integer timeout: Milliseconds to wait. - :param integer interval: milliseconds to sleep. + :param integer interval: Milliseconds to sleep. :method:`sh.waitForBalancer()` is an internal method that waits for diff --git a/source/reference/method/sh.waitForBalancerOff.txt b/source/reference/method/sh.waitForBalancerOff.txt index acc908ce65a..6f878017cbb 100644 --- a/source/reference/method/sh.waitForBalancerOff.txt +++ b/source/reference/method/sh.waitForBalancerOff.txt @@ -6,9 +6,9 @@ sh.waitForBalancerOff() .. method:: sh.waitForBalancerOff() - :param integer timeout: milliseconds to wait. + :param integer timeout: Milliseconds to wait. - :param integer interval: milliseconds to sleep. + :param integer interval: Milliseconds to sleep. :method:`sh.waitForBalancerOff()` is an internal method that waits until the balancer is not running. diff --git a/source/reference/method/sh.waitForDLock.txt b/source/reference/method/sh.waitForDLock.txt index a764b15880f..290a4872060 100644 --- a/source/reference/method/sh.waitForDLock.txt +++ b/source/reference/method/sh.waitForDLock.txt @@ -6,14 +6,14 @@ sh.waitForDLock() .. method:: sh.waitForDLock(lockId, onOrNot, timeout, interval) - :param string lockId: the name of the lock. + :param string lockId: The name of the lock. - :param Boolean onOrNot: optional, whether to wait for the lock to be + :param Boolean onOrNot: Optional, whether to wait for the lock to be on (``true``) or off (``false``). - :param integer timeout: milliseconds to wait. + :param integer timeout: Milliseconds to wait. - :param integer interval: milliseconds to sleep in each waiting cycle. + :param integer interval: Milliseconds to sleep in each waiting cycle. :method:`sh.waitForDLock()` is an internal method that waits until the specified lock is changes state. diff --git a/source/reference/method/sh.waitForPingChange.txt b/source/reference/method/sh.waitForPingChange.txt index 52b8ae92328..58e3257669e 100644 --- a/source/reference/method/sh.waitForPingChange.txt +++ b/source/reference/method/sh.waitForPingChange.txt @@ -6,9 +6,12 @@ sh.waitForPingChange() .. method:: sh.waitForPingChange(activepings, timeout, interval) - :param array activepings: an array of active pings from the + :param array activepings: An array of active pings from the ``config.mongos`` collection. - :param integer timeout: milliseconds to wait for a change in ping state. + :param integer timeout: Milliseconds to wait for a change in ping state. - :param integer interval: milliseconds to sleep in each waiting cycle. + :param integer interval: Milliseconds to sleep in each waiting cycle. + + :method:`sh.waitForPingChange()` waits for a change in ping state + of the one of the ``activepings``.