title: Adding members to Replica Set on MongoDb
body: <p>I am trying to create a replica set with MongoDb, the servers hostnames are:</p>
  
  <p>hostname
  hostname-1
  hostname-2</p>
  
  <p>Each of these has all the relevant hostnames detailed in their /etc/hosts file (They;re all running Ubuntu 10.04 64-bit)</p>
  
  <p>When I do an rs.initiate on one node everything seems to start well. Running rs.status(); shows:</p>
  
  <pre><code>{
      "set" : "vega",
      "date" : ISODate("2012-01-22T19:15:55Z"),
      "myState" : 1,
      "members" : [
          {
              "_id" : 0,
              "name" : "hostname:27017",
              "health" : 1,
              "state" : 1,
              "stateStr" : "PRIMARY",
              "optime" : {
                  "t" : 1327254848000,
                  "i" : 1
              },
              "optimeDate" : ISODate("2012-01-22T17:54:08Z"),
              "self" : true
          }
      ],
      "ok" : 1
  }
  </code></pre>
  
  <p>The problem comes when I try to add a new member to the replica set. I use the command rs.add(hostname-1); and I get the following error:</p>
  
  <pre><code>{
      "assertion" : "need most members up to reconfigure, not ok : vega-1:27017",
      "assertionCode" : 13144,
      "errmsg" : "db assertion failure",
      "ok" : 0
  }
  </code></pre>
  
  <p>I've tried numerous combinations of using the hostname, IP address, both with and without the port number and I always get the same problem. The hostname is resolving, i've tried ping hostname-1 and it works fine.</p>
  
  <p>Does anybody have any ideas as to what could be causing this issue?</p>
  
  <p>Unfortunately in the Mongo documentation there are no examples of setting up a replica set in the real world scenario, only using three instances on the same machine which is clearly useless.</p>
  
  <p>Thanks in advance for any help!</p>