MongoDB Cool Administration Tips (PDFDrive)
MongoDB Cool Administration Tips (PDFDrive)
MongoDB Cool Administration Tips (PDFDrive)
Filters: {"ns":/^customers\./,"op":"insert","secs_running":{$gt:60}}
db.currentOps() flat output
● Split the above range in fixed size chunks, by storing the chunk’s
boundaries in a list.
● Iterate through the chunks and execute the update operation for each
one
Massive document removal
db.runCommand(
{
planCacheSetFilter: <collection>,
query: <query>,
sort: <sort>,
projection: <projection>,
indexes: [ <index1>, <index2>, ...]
}
)
● db.orders.aggregate( [ { $indexStats: { } } ] )
...
"host" : "myhost:30008",
"accesses" : {
"ops" : NumberLong(4),
"since" : ISODate("2018-07-25T10:12:59.106Z")
}
...
● mlogfilter
○ --operation OP
○ --pattern P
○ --slow MS
○ --scan
○ --from FROM --to TO
● mplotqueries
mtools
#4 SSL troubleshooting
SSL troubleshooting
## Validate certificate - PK correspondence
## Configuration
ssl:
mode:[ allowSSL | preferSSL | requireSSL | ]
allowConnectionsWithoutCertificates: true
#5 Replicasets and Sharding
Sharded clusters maintenance
● Dealing with Jumbo chunks
○ Divide the chunk using sh.splitAt()
○ Manually clear the flag updating config.chunks
Flat currentOps()
https://github.com/gabocic/mongodb/blob/master/flatcurrentops.js
Unused indexes
https://github.com/gabocic/mongodb/blob/master/unusedidx.js
Thanks!
Gabriel Ciciliani
ciciliani@pythian.com
www.linkedin.com/in/gabrielciciliani
@gabocic