[SERVER-16157] bind_ip = 127.0.0.1 && rs.initiate(): error 93 "No host described in new configuration 1 for replica set indexers maps to this node" Created: 14/Nov/14  Updated: 18/Feb/17  Resolved: 14/Nov/14

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: 2.8.0-rc0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Thomas Riccardi Assignee: Andy Schwerin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Steps To Reproduce:

config file:

bind_ip = 127.0.0.1
replSet = myRS

Start mongod with config file, then mongo shell:

$ mongo
> rs.status()
{
        "info" : "run rs.initiate(...) if not yet done for the set",
        "ok" : 0,
        "errmsg" : "no replset config has been received",
        "code" : 94
}
> rs.initiate()
{
        "info2" : "no configuration explicitly specified -- making one",
        "me" : "MYHOST:27017",
        "ok" : 0,
        "errmsg" : "No host described in new configuration 1 for replica set indexers maps to this node",
        "code" : 93
}
> rs.status()
{
        "info" : "run rs.initiate(...) if not yet done for the set",
        "ok" : 0,
        "errmsg" : "no replset config has been received",
        "code" : 94
}

Participants:

 Description   

With "bind_ip = 127.0.0.1" config, it's no more possible to create a replica set in mongodb 2.8.0-rc0:

"errmsg" : "No host described in new configuration 1 for replica set indexers maps to this node",
"code" : 93

It worked with mongodb 2.6.4 (and 2.4 & 2.2 & 2.0 I think).



 Comments   
Comment by Nikhil Kumar Gupta [ 18/Feb/17 ]

I see similar error message in 3.4.1

Later I realize this occurred due to below reason.
I was trying to initiate the replica set from the mongo instance that is not listed in the config of replica set.

Thanks,

Nikhil

Comment by Andy Schwerin [ 17/Nov/14 ]

I don't recommend calling rs.initiate() with no parameters for anything other than testing / playing around with replica sets. It's always surprising to learn what name a mongod node gives itself if you let it.

Comment by Thomas Riccardi [ 17/Nov/14 ]

KO so this means the standard 'rs.initiate()' command doesn't work anymore for local only replica-sets, since it defaults to the public hostname, not the local one ('localhost').
This is only the default behavior and the replica set member can have its hostname changed after the rs.initiate() (I tested), so there is nothing blocking here.

We could change the rs.initiate() behavior in case of bind_ip local only to fix the initial scenario, but it would confuse more than the current situation I think.

Lastly, I did have MYHOST in the /etc/hosts, but bound to 127.0.1.1, not 127.0.0.1 (that's how debian and ubuntu do, it seems), so indeed mongod didn't listen on 127.0.1.1:2707, this explains why i didn't work.

I confirm that my initial scenario works when I add MYHOST to /etc/hosts on 127.0.0.1 before rs.initiate(). It also works if instead I configure mongod with "bind_ip=127.0.0.1,127.0.1.1" before rs.initiate().
Maybe this should be the default in the deb & rpm packages, instead of just 127.0.0.1, I'm not sure...

Comment by Andy Schwerin [ 14/Nov/14 ]

It was an error that this worked in prior versions of MongoDB, that was fixed as a side-effect of SERVER-14165. If you examine the replica set configuration that you get in 2.6, you'll notice that it lists the hostname for the one node as MYHOST:27017, not localhost:27017 or 127.0.0.1. This is correct behavior, but unless your /etc/hosts file maps MYHOST to 127.0.0.1, it's not actually possible to reach the node at MYHOST:27017. The 2.8 release candidate correctly refuses the new configuration because it cannot contact itself via the address listed in the config file.

Generated at Thu Feb 08 03:40:08 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.