Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-1127

Comment on: "reference/command/shardingState.txt"

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • v1.2
    • None
    • manual
    • None

    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" }

      Attachments

        Activity

          People

            sam.kleinman Sam Kleinman (Inactive)
            epc Ed Costello
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              10 years, 49 weeks, 6 days ago