MongoDB recipes
- Add a member to the replica setReplica Set
- Remove a member from the replica setReplica Set
- Step down the primary (stepDown)Replica Set
- Change member priorityReplica Set
- View replica set statusReplica Set
- Configure a hidden / non-voting memberReplica Set
- Resync a member from scratchReplica Set
- Add a shard to the clusterSharding
- Shard a collectionSharding
- Start the balancerSharding
- Stop the balancerSharding
- View sharding statusSharding
- Add a zone (tag) and assign a rangeSharding
- Move a chunk manuallySharding
- Compact a collectionMaintenance
- Create an index (non-blocking)Maintenance
- View index and collection sizesMaintenance
- Rotate the log fileMaintenance
- Find long-running operationsMaintenance
- Kill an operationMaintenance
- Change a runtime parameterParameters
- Set the profiling levelParameters
- Measure the oplog window and replication lagReplica Set
- Resize the oplog online (replSetResizeOplog)Replica Set
- Force a replica set reconfiguration after losing the majority (force reconfig)Replica Set
- Rolling maintenance on a replica set (restart, OS patch, minor upgrade)Replica Set
- Balancer state, active window and per-collection balancingSharding
- Find jumbo chunks, split them and clear the flagSharding
- Check shard key choice and data distribution (getShardDistribution, analyzeShardKey)Sharding
- Inspect a query plan with real execution statistics (explain executionStats)Performance
- Extract the slowest queries and query shapes from profiler dataPerformance
- Find unused indexes and hide them before dropping (hideIndex)Performance
- Count connections by application and client (connection storm diagnosis)Performance
- Monitor and abort an in-progress index buildMaintenance
- Rolling index build on a replica set (member by member)Maintenance
- Create a TTL index, change its expiry and monitor TTL deletesMaintenance
- Measure WiredTiger cache pressure (fill, dirty ratio, application eviction)Performance
- Take an archive backup with mongodump/mongorestore and restore a single collectionBackup
- Point-in-time restore with oplog replay (return to before a bad drop/delete)Backup
- Define a custom role, create a user, grant/revoke roles and change the passwordSecurity
- Check featureCompatibilityVersion (fCV) and the major upgrade sequenceUpgrade