2

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?

4

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.

| improve this answer | |
  • Yes,thank you.I used to try rs.status(),but it reports erros message:replSetGetStatus is not supported through mongos.Now I know the reason of this error message.I should change the port number to the one of mongod service, not a mongos service.And I find that ,yes , the 'health' tag for every replication set member in this down machine is 0,not 1,meaning connection has been lost.Finally I have to restart this machine and all the mongod service on it ,problem resolved!Thank you! – wuchang Jan 10 '14 at 7:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.