title: MongoDB sharding: host does not belong to replica set
body: <p>I am a Mongo newbie.
  I am trying to sping up a MongoDB cluster with both sharding and replication. Cluster schema which I want to implement is: <a href="https://github.com/ansible/ansible-examples/raw/master/mongodb/images/site.png" rel="nofollow">https://github.com/ansible/ansible-examples/raw/master/mongodb/images/site.png</a>
  I am using server IP as replication set name. I.e. I am building replication sets with commands below:</p>
  
  <pre><code>rs.initiate()
  rs.add("10.148.28.51:27118")
  rs.add("10.148.28.52:27118")
  rs.add("10.148.28.53:27118")
  </code></pre>
  
  <p>Replication is being configured correctly so when I am executing rs.status() on PRIMARY host 10.148.28.51 I am getting "10.148.28.51" as repl.set name: <a href="https://gist.github.com/daniilyar/630bc6fe7723ed06f243" rel="nofollow">https://gist.github.com/daniilyar/630bc6fe7723ed06f243</a></p>
  
  <p>But when I am trying to add shards at mongos instance it gives me 2 opposite errors (depending on what addShard() syntax variation I use): </p>
  
  <pre><code>mongos&gt; sh.addShard("10.148.28.51:27118")
  {
  "ok" : 0,
  "errmsg" : "host is part of set 10.148.28.51, use replica set url format     &lt;setname&gt;/&lt;server1&gt;,&lt;server2&gt;,...."
  }
  mongos&gt; sh.addShard("10.148.28.51/10.148.28.51:27118") 
  {
  "ok" : 0,
  "errmsg" : "in seed list 10.148.28.51/10.148.28.51:27118, host 10.148.28.51:27118 does not belong to replica set 10.148.28.51"
  }
  </code></pre>
  
  <p>How do I add shard if Mongo tells that "host X is in replica set Y" and that "host X does not belong to replica set Y" in the same time?</p>
  
  <p>Any help would be greatly appreciated</p>