Master & Slave (Replication) Configuration on MongoDB 5.0 ================================================
1. Edit "/etc/mongod.conf" and add local IP address & replicasetName on all nodes # network interfaces net: port: 27017 bindIp: 10.0.0.4 #127.0.0.1 replication: replSetName: "rs01"
2. Restart Mongodb Services from all Nodes
3. From Primary Node, Connect MongoDB and execute below commands: 1. rs.initiate() -- to initiate replication
2. rs.add ("IP's of secondary nodes") -- To add replica/secondary
4. From Replica Nodes, Connect MongoDB and execute below commands: rs.secondaryOk()
5. FailBack from Primary to Secondary Node
rs.secondaryOk()