I'm trying to produce a replica set with MongoDb, the servers hostnames are:

hostname hostname-1 hostname-2

All these has all of the relevant hostnames detailed within their /etc/hosts file (Theyre all running Ubuntu 10.04 64-bit)

After I do an rs.initiate on a single node everything appears to begin well. Running rs.status() shows:

{
    "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
}

The issue comes after i consider adding a brand new member towards the replica set. I personally use the command rs.add(hostname-1) and that i obtain the following error:

{
    "assertion" : "need most members up to reconfigure, not ok : vega-1:27017",
    "assertionCode" : 13144,
    "errmsg" : "db assertion failure",
    "ok" : 0
}

I have attempted numerous mixtures of while using hostname, Ip, both with and with no port number and that i always obtain the same issue. The hostname is solving, i have attempted ping hostname-1 and delay pills work fine.

Does anybody have ideas in regards to what might be leading to this problem?

Regrettably within the Mongo documentation you will find no good examples of establishing a duplicate occur the real life scenario, only using three instances on a single machine that is clearly useless.

Thanks ahead of time for just about any help!

Regrettably within the Mongo documentation you will find no good examples of establishing a duplicate occur the real life scenario, only using three instances on a single machine that is clearly useless.

Agreed, it's pretty poor. That example ought to be completely taken off the paperwork.

There's a different way to begin a replica set which is to apply the rs.configure() command. You may also specify the 3 nodes at the same time after which problem the rs.inititiate().

See here for a good example of indicating all nodes before starting.

See here for additional particulars around the various instructions.