How to get the number of current servers which are not down from the c++ client
20 views
Skip to first unread message
gmail
unread,
Jul 27, 2012, 1:37:42 AM7/27/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongodb-user
Hi:
when I use replica set , and make w=3 when use the
c++ client to insert data , if one of the mongod down
,How to get the number of current servers which are not down from the c++ client
?
gmail
Kristina Chodorow
unread,
Jul 30, 2012, 10:55:17 AM7/30/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongod...@googlegroups.com, fly542
There's no automatic way. You would have to call isMaster on the primary and then try to connect to each of the hosts in the host list.
That is one reason we have the w="majority" option: it has almost the same safety properties as w=(total # of members) but will still work if a node is down.