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 service 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 becomes unavailable until the replica set gets a ping from it. After starting the service again, the members' status changes again as shown ...