MongoDB – How to Find Out if Any Cluster Member is Offline

mongodbreplication

I have a mongodb cluster with 1 master machine(running mongos and config service) and 3 slave machines(used as data store).But now,I find that one of 3 machines (192.168.10.11) is down because I can neither ping to it nor telnet to it.Of cource,only one machine is down will not lead to data loss because each replication set has three replication members which is distributed to three different machines. I select a database and run db.stats(),I cannot see anything wrong ,every shard is there.I use db.runCommand({listShards:1}),I cannot see anything wrong either,no shard is wrong.

So , my question is ,how can I find out any exception message from mongodb if any of cluster members is down or offline?

Best Answer

If you run the db.printSlaveReplicationInfo() or rs.status() as well as the db.printShardingStatus() commands you should be able to determine who can see who in the cluster and what state each member is in.