1

I logged into a secondary & did use admin; db.shutdownServer(), then I powered off the whole server with "sudo shutdown". On the primary server I am running rs.status().

For the secondary that is offline, I see: "health" : 1, "state" : 2, "stateStr" : "SECONDARY",

I also see that lastHeartbeat updates, but lastHeartbeatRecv does not update. I expect the health/state fields to change if the member is offline, but it does not. How can I monitor my replica set members to see if they are offline?

  • What specific version of MongoDB are you running? Can you include the full `rs.status()` output? If a secondary is shut down as described, the expected [replica set member state](https://docs.mongodb.com/manual/reference/replica-states/) would be "DOWN" and the values you've quoted from `rs.status()` should be: `"health": 0, "state": 8, "stateStr": "(not reachable/healthy)"`. – Stennie Jul 15 '17 at 03:26
  • Also, approximately how long did you wait after shutting down the secondary and checking `rs.status()` on the primary? Did you continue re-checking to see if the state of the down secondary changed after more elapsed time? – Stennie Jul 15 '17 at 03:29
  • Yep I checked for 5+ minutes, the `lastHeartbeat` kept updating, but `lastHeartbeatRect` never changed, each time I checked. What is the timeout before the `health` field should changed, maybe I did not wait long enough? – Josh Ribakoff Jul 17 '17 at 03:02
  • You need to provide more information on your environment -- something is amiss if you are waiting minutes and the secondary state isn't changing in `rs.status()`. What specific version of MongoDB are you running (as reported by `db.version()` in the `mongo` shell) and what is your O/S version? Can you include the full `rs.status()` output? Can you also include some details on the network topology (are all nodes on the same network, is that local hosting or a cloud provider, .. )? – Stennie Jul 17 '17 at 03:29

0 Answers0