I am trying to deploy mongodb replica set . I have made my mongodb instance as primary of the replica . Now i am trying to add another mongodb instance hosted at different iP address, as secondary of the replica, but i am getting the following error :
rs0:PRIMARY> rs.add("<ip address>:27017")
{
"ok" : 0,
"errmsg" : "Either all host names in a replica set configuration must be localhost references, or none must be; found 1 out of 2",
"code" : 103
}
What I am doing wrong ?