[DOCS-1127] Comment on: "reference/command/shardingState.txt" Created: 14/Feb/13  Updated: 04/Mar/15  Resolved: 07/Mar/13

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: v1.2

Type: Improvement Priority: Minor - P4
Reporter: Ed Costello Assignee: Sam Kleinman (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 10 years, 49 weeks, 6 days ago

 Description   

shardingState only returns 'true' if the mongod is the primary member in a replica set which is part of a shard.

When invoked against a primary, shardingState returns a document like:

{
	"enabled" : true,
	"configServer" : "bartleby.local:27019,bartleby.local:30019,bartleby.local:40019",
	"shardName" : "boolean",
	"shardHost" : "boolean",
	"versions" : {
		"cfb.gen2009" : {
			"t" : 61000,
			"i" : 0
		}
	},
	"ok" : 1
}

but when invoked against a SECONDARY member, shardingState returns the document:

{ "note" : "from execCommand", "ok" : 0, "errmsg" : "not master" }

when invoked against a secondary member, even if it's part of a sharded cluster.

When invoked against a config server, shardingState returns:

{ "enabled" : false, "ok" : 1 }

And when invoked against a mongos instance:

{ "ok" : 0, "errmsg" : "no such cmd: shardingState" }



 Comments   
Comment by Ed Costello [ 08/Mar/13 ]

Not sure where the "boolean" got in there.
Another note: if you've set up a cluster but haven't sharded a collection yet, you'll get:

{ "enabled" : false, "ok" : 1 }

(that is, you've run this against a primary but no collections have been sharded yet).

Comment by auto [ 07/Mar/13 ]

Author:

{u'date': u'2013-03-07T21:05:28Z', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}

Message: DOCS-1127: additional examples of shardingState comamnd output
Branch: v2.2
https://github.com/mongodb/docs/commit/7c11c8abfaa6facffab0b29ed4b45164d856d062

Comment by auto [ 07/Mar/13 ]

Author:

{u'date': u'2013-03-07T21:05:28Z', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}

Message: DOCS-1127: additional examples of shardingState comamnd output
Branch: master
https://github.com/mongodb/docs/commit/ff0a6a86afd8f63b63de91a1d5287f5a5e328791

Generated at Thu Feb 08 07:40:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.