title: Error while adding a secondary instance in mongodb replica set
body: <p>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 :</p>
  
  <pre><code>    rs0:PRIMARY&gt; rs.add("&lt;ip address&gt;: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
  }
  </code></pre>
  
  <p>What I am doing wrong ?</p>