title: Configure a Replica Set in local and on a cloud-server
body: <p>I'm trying to configure a Replica Set with 2 members in local e 1 member on a cloud-server.
  I started the two instance from local in this way:</p>
  
  <pre><code>mongod --port 27117 --dbpath mongodb/rs0-0 --logpath mongodb/rs0-0/mongo.log --replSet rs0 --fork 
  mongod --port 27118 --dbpath mongodb/rs0-1 --logpath mongodb/rs0-1/mongo.log --replSet rs0 --fork 
  </code></pre>
  
  <p>and then I started the instance on my cloud-server (after opened the port):</p>
  
  <pre><code>mongod --port 27119 --dbpath mongoRS/rs0-2 --logpath mongoRS/rs0-2/mongo.log --replSet rs0 --fork 
  </code></pre>
  
  <p>So, I started the server to configure the Replica Set:</p>
  
  <pre><code>mongo --port 27117
  
  rsconf = {
      _id: "rs0",
      members: [{
          _id: 0,
          host: "localhost:27117"
      }]
  }
  
  rs.initiate( rsconf )
  rs.add("localhost:27118")
  </code></pre>
  
  <p>Until now all was correct. But when I tryed to add the server-instance a error occurred:</p>
  
  <pre><code>rs.add("myServer.it:27119")     
  </code></pre>
  
  <p><strong>"errmsg" : "Either all host names in a replica set configuration must be localhost references, or none must be; found 2 out of 3",</strong></p>
  
  <p>So I'm thinking that I cannot set this configuration or what?</p>