Check replica set status
Show replica set members, lag and election status
mongosh --eval 'rs.status()' mongodb://mongo:27017
- tool
- mongodb20 commands
- tags
- mongodbmonitoring
More mongodb commands
-
mongosh --eval 'db.stats()' mongodb://mongo:27017/mydbShow data size, storage size and number of collections in a database
-
mongosh --eval 'db.myCollection.stats()' mongodb://mongo:27017/mydbShow document count, index sizes and storage size of a collection
-
mongosh --eval 'db.currentOp({active:true,secs_running:{$gt:5}})' mongodb://mongo:27017Show operations that run longer than 5 seconds
-
mongodump --uri='mongodb://user:pass@mongo:27017' --db=mydb --out=/backups/Export a database to BSON files
-
mongorestore --uri='mongodb://user:pass@mongo:27017' --db=mydb /backups/mydb/Load a BSON backup into MongoDB