Mongodb – rs0 replica set to use first port as primary

We will keep you posted.

Mongodb – rs0 replica set to use first port as primary

  1. Go to the primary replica
cfg = rs.conf()

// Set the priority of the first member to a high value, like 10
cfg.members[0].priority = 10

// Set the priority of other members to a low value, like 1
cfg.members[1].priority = 1
cfg.members[2].priority = 1

rs.reconfig(cfg)

rs.status()