Reset rs and create new rs:

In master:

cfg = {
     "_id" : "rs9",
     "version" : 1,
     "members" : [
         {
             "_id" : 0,
             "host" : "IP_Master:27017"
         }
     ]
}

rs.reconfig(cfg, {force:true})

rs.add("IP_SLAVE:27017")
Force secondary node to primary

Step 1: On sercondary

rs.conf()

Step 2: Save the current configuration to another variable.

x = rs.conf()

Step 3: Select the id,host and port of the member that is to be made as primary.

x.members = [{"_id":1,"host" : "localhost.localdomain:27071"}]

Step 4: Reconfigure them by force.

rs.reconfig(x, {force:true})

Now the desired member will be promoted as the primary.