[SERVER-2055] Trying to create replica set on local machine. Gives errror "couldn't initiate : can't find self in the replset config" Created: 02/Nov/10  Updated: 12/Jul/16  Resolved: 04/Nov/10

Status: Closed
Project: Core Server
Component/s: Admin
Affects Version/s: 1.6.3
Fix Version/s: None

Type: Question Priority: Major - P3
Reporter: Sujit Assignee: Kristina Chodorow (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

macbook


Participants:

 Description   

Testing replica sets before moving to production.

Started 3 instances of mongod on 3 dbs.
local-idinc is mapped to 127.0.0.1

config =
{
"_id" : "idincrepl",
"members" : [

{ "_id" : 0, "host" : "local-idinc:10001" }

,

{ "_id" : 1, "host" : "local-idinc:10002" }

,

{ "_id" : 2, "host" : "local-idinc:10003" }

]
}

> rs.initiate(config);
{
"errmsg" : "couldn't initiate : can't find self in the replset config",
"ok" : 0
}

-----------------------------
Any errors in the configuration?



 Comments   
Comment by Kristina Chodorow (Inactive) [ 04/Nov/10 ]

Great, glad it worked out. Local DNS can be a little funky, the DB is getting better at handling it.

Comment by Sujit [ 04/Nov/10 ]

Kristina,

Sorry for the late response.

In my case: putting localhost for the replica set worked fine. (and proper
alias's in case of separate machines.)

Thanks for looking into this and the immediate responses.

Regards,
Sujit

On Tue, Nov 2, 2010 at 4:07 PM, Kristina Chodorow (JIRA)

Comment by Kristina Chodorow (Inactive) [ 02/Nov/10 ]

Please try deleting the data directories (or at least the local.* files) and start up one mongod with:

$ mongod --replSet idincrepl --dbpath somewhere --port 10002

Then run:

$ mongo local-idinc:10002/admin
MongoDB shell version: 1.6.3
connecting to: local-idinc:10002/admin
> rs.initiate()

Please paste the output.

Comment by Sujit [ 02/Nov/10 ]

The replica set is not up. Not sure if this helps. Please let me know if I
should try something else.
Regards,
Sujit

$ mongo local-idinc:10002/admin
MongoDB shell version: 1.6.3
connecting to: local-idinc:10002/admin
{
"startupStatus" : 1,
"info" : "idincrepl/local-idinc:10001,local-idinc,10003",
"errmsg" : "all members and seeds must be reachable to initiate set",
"ok" : 0
}
{
"startupStatus" : 4,
"errmsg" : "can't currently get local.system.replset config from self or
any seed (EMPTYUNREACHABLE)",
"ok" : 0
}

$ ping local-idinc
PING local-idinc (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.046 ms

On Tue, Nov 2, 2010 at 3:43 PM, Kristina Chodorow (JIRA)
<jira@mongodb.org>wrote:

Comment by Kristina Chodorow (Inactive) [ 02/Nov/10 ]

If you do rs.initiate() (no config) on one of the machines and then run rs.status(), what does it say for name?

This might also be a problem with the server figuring out who itself is, does it work for you with the 1.7 branch? There were a number of fixes to this sort of problem that couldn't be backported.

Generated at Thu Feb 08 02:58:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.