Skip to content

Instantly share code, notes, and snippets.

View FrancescaK's full-sized avatar

Francesca Krihely FrancescaK

View GitHub Profile
sh.status()
--- Sharding Status ---
...
"clusterId" : ObjectId("53616554992f1bbce576f9fd")
}
shards:
{ "_id" : "shard0000", "host" : "Server1:27017", "tags" : [ "current" ] }
{ "_id" : "shard0001", "host" : "Server2:27017", "tags" : [ "tier-2" ] }
{ "_id" : "shard0002", "host" : "Server3:27017", "tags" : [ "tier-2" ] }
databases:
sh.addShardTag('shard0000', 'current')
sh.addShardTag('shard0001', 'tier-2')
sh.addShardTag('shard0002', 'tier-2')
sh.status()
--- Sharding Status ---
sharding version: {
"_id" : 1,
"version" : 3,
"minCompatibleVersion" : 3,
"currentVersion" : 4,
"clusterId" : ObjectId("53616554992f1bbce576f9fd")
}
shards:
{
"_id" : ObjectId("4f16fc97d1e2d32371003f87"),
"body" : "i say el tiempo\n\n\nTo: Timothy Blanchard/HOU/EES@EES, Bryan Hull/HOU/ECT@ECT, Luis \nMena/NA/Enron@Enron, Lisa Gillette/HOU/ECT@ECT, Susan M Scott/HOU/ECT@ECT, \nShanna Husser/HOU/EES@EES, Eric Bass/HOU/ECT@ECT,[email protected]\ncc: \nSubject: \n\ndoes everyone want to meet at tortucas on kirby south of 59 or el tiempo(no \ntequilla shots) or cabos downtown tonight. let's meet around 6-6:30.\n\n",
"date" : ISODate("2001-03-01T09:55:00Z"),
"filename" : "1107.",
"headers" : {
"Content-Transfer-Encoding" : "7bit",
"Content-Type" : "text/plain; charset=us-ascii",
"From" : "[email protected]",
"Message-ID" : "<25125852.1075854773620.JavaMail.evans@thyme>",
@FrancescaK
FrancescaK / gist:9380730
Last active August 29, 2015 13:57
STEP: re-enable the balancer
sh.setBalancerState(true)
sh.status()
sh.status()
--- Sharding Status ---
sharding version: {
"_id" : 1,
"version" : 3,
"minCompatibleVersion" : 3,
@FrancescaK
FrancescaK / gist:9380656
Last active August 29, 2015 13:57
STEP: update the archive range.
configdb.tags.update({tag:"tier 2"},{$set:{'max.date':ISODate("2001-07-31")}})
configdb.tags.update({tag:"recent"},{$set:{'min.date':ISODate("2001-07-31")}})
@FrancescaK
FrancescaK / gist:9380654
Created March 6, 2014 01:53
STEP Stop the Balancer Again
sh.setBalancerState(false)
@FrancescaK
FrancescaK / gist:9380652
Last active August 29, 2015 13:57
STEP: check status of # of chunks
sh.status()
--- Sharding Status ---
sharding version: {
"_id" : 1,
"version" : 3,
"minCompatibleVersion" : 3,
"currentVersion" : 4,
"clusterId" : ObjectId("5314f1487abd6cb2803696d6")
}
shards:
@FrancescaK
FrancescaK / gist:9380650
Created March 6, 2014 01:52
STEP: split chunk to break up the new archive from the current data
sh.splitAt('enron.messages',{date:ISODate("2001-08-01")})
@FrancescaK
FrancescaK / gist:9380648
Created March 6, 2014 01:52
STEP: Look in the config database for tag range definitions.
configdb = db.getSiblingDB("config")
configdb.tags.find().pretty()
{
"_id" : {
"ns" : "enron.messages",
"min" : {
"date" : { "$minKey" : 1 }
}
},