Setup a 2 node mongodb replica set

This is not how it works. If you want replication and availability as provided by replica sets then you need 3 nodes. At a minimum you need 2 data nodes and an arbiter.

Whoever is responsible for your requirements needs to read up on MongoDB replication.

2 Likes