I created a replica set with three members. now I read the following link: Replica Set Elections which explains only in an abstract way what is going on.
So they say that when the primary becomes unavailable the elections occur. So I was trying to make the primary unavailable by ctrl+c in the terminal which holds the mongod instance, the other two secondaries were sending each other heartbeats to connect but I got in each terminal:
Failed to connect to 127.0.1.1:27017, reason: errno:111 Connection refused
So maybe that's not the way to make the primary unavailable?
Can you help me please, I cant find examples..
Thanks.