Database Reference
In-Depth Information
Failover testing
In this section, we will deactivate the specific nodes to force the replica set to make an
election and change the nodes' role.
First of all, we will deactivate one of the
secondary
nodes by stopping the
mongod
ser-
vice on the secondary machine.
Right after stopping the service of
mongod3.replicaset.com
, the replica set will set
this node as an unreachable secondary node, as shown in the following screenshot:
The status of the replica set shows that the third member has an issue, so this member be-
comes unavailable until the replica set gets a ping from it. After starting the service again,
the members' status changes again as shown in the following screenshot: