I have setup 2 system with mongodb replication in ubuntu 16.4 , one is primary and another secondary, its working correctly but when the primary goes to down the secondary not comes as a primary, I have seted voting and priority using below commands , but still getting same. members ID I used "1" because secondary server running with ID 1 , which one I got from rs.status() and rs.status(). I have done replication using this url only.
> use admin
> rs.status()
> cfg = rs.conf()
> cfg.members = [cfg.members[1]]
> cfg.members[1].votes = 1;
> rs.reconfig(cfg, {force : true})