Skip to content

Instantly share code, notes, and snippets.

@danared
Created April 2, 2015 21:57
Show Gist options
  • Save danared/7ca5aa2accf48b931aa1 to your computer and use it in GitHub Desktop.
Save danared/7ca5aa2accf48b931aa1 to your computer and use it in GitHub Desktop.
mongos> sh.status()
--- Sharding Status ---
sharding version: {
"_id" : 1,
"version" : 4,
"minCompatibleVersion" : 4,
"currentVersion" : 5,
"clusterId" : ObjectId("54d13c0555c0347d23e33cdd")
}
shards:
{ "_id" : "shard01", "host" : "shard01/hingo-sputnik:27018,hingo-sputnik:27019,hingo-sputnik:27020" }
{ "_id" : "shard02", "host" : "shard02/hingo-sputnik:27021,hingo-sputnik:27022,hingo-sputnik:27023" }
databases:
{ "_id" : "admin", "partitioned" : false, "primary" : "config" }
{ "_id" : "test", "partitioned" : true, "primary" : "shard01" }
test.mycollection
shard key: { "_id" : 1 }
chunks:
shard01 1
{ "_id" : { "$minKey" : 1 } } -->> { "_id" : { "$maxKey" : 1 } } on : shard01 Timestamp(1, 0)
mongos> sh.splitAt( "test.mycollection", { _id : 6 } )
{ "ok" : 1 }
mongos> sh.status()
--- Sharding Status ---
sharding version: {
"_id" : 1,
"version" : 4,
"minCompatibleVersion" : 4,
"currentVersion" : 5,
"clusterId" : ObjectId("54d13c0555c0347d23e33cdd")
}
shards:
{ "_id" : "shard01", "host" : "shard01/hingo-sputnik:27018,hingo-sputnik:27019,hingo-sputnik:27020" }
{ "_id" : "shard02", "host" : "shard02/hingo-sputnik:27021,hingo-sputnik:27022,hingo-sputnik:27023" }
databases:
{ "_id" : "admin", "partitioned" : false, "primary" : "config" }
{ "_id" : "test", "partitioned" : true, "primary" : "shard01" }
test.mycollection
shard key: { "_id" : 1 }
chunks:
shard02 1
shard01 1
{ "_id" : { "$minKey" : 1 } } -->> { "_id" : 6 } on : shard02 Timestamp(2, 0)
{ "_id" : 6 } -->> { "_id" : { "$maxKey" : 1 } } on : shard01 Timestamp(2, 1)
mongos>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment