After reboot of your master, slave and master switched their roles and you want to switch back them:
login to current master and make:

1
2
3
4
cfg = rs.conf()
cfg.members[0].priority = 1
cfg.members[1].priority = 0.5
rs.reconfig(cfg)

after «cfg = rs.conf ()» you'll see config, change priority for master (set bigger number) and for slave (set lower number).