[MongoDB] handles jumbo chunks warning messages
What is Jumbo chunk?
Is the chunk that exceeds the set chunk size. The default chunk size is 64m.
Why deal with Jumbo chunk?
Jumbo chunk cannot be migrated
How to deal with it? # first find Jumbo chunk information sh.status (true) {"phone": NumberLong ("xxxxxx")}-> {"phone": NumberLong ("yyyyyyy")} on: shard_rep1 Timestamp (1,19) jumbo# execute # for the above Jumbo block, execute the following command sh.splitFind ("db.tb", {shardkeyX: "shardkeyXValue_in_range"}) script automatic processing: 1. Since sh.status (true) can find jumbo chunk, there must be jumbo information 2. 5 recorded in the config library. Quickly find the data marked jumbo from the metadata table of chunk. Processing very large data blocks can be copied to mongos shell and executed db = db.getSiblingDB ('config'); var goblins=db.chunks.find ({"jumbo": true}) goblins.forEach (function (item) {databaseDotTable = item.ns;minShardKeyInfo = item.min;maxShardKeyInfo = item.maxfor (var i in minShardKeyInfo) {var key=i; var value=minShardKeyInfo [I] If (typeof (value) = = "function") {for (var j in maxShardKeyInfo) {value = maxShardKeyInfo [j]}} var findFilter = {} findFilter [key] = valueprint (`Doing db.adminCommand ({"${databaseDotTable}", {${key}: ${value})} `); result=db.adminCommand ({split:databaseDotTable,find:findFilter}); printjson (result)}) remarks
1. It is officially recommended to use a more automatic sh.splitFind instead of the original sh.splitAt function