errmsg" : "No host described in new configuration 1 for replica set rs0 maps to this node", Why I am getting this message? errmsg" : "No host described in new configuration 1 for replica set rs0 maps to this node", Why I am getting this message? mongodb mongodb

errmsg" : "No host described in new configuration 1 for replica set rs0 maps to this node", Why I am getting this message?


I just ran into this issue, and in my case the symptoms were that everything worked correctly, until I rebooted the server.

Then I would get the following error: NodeNotFound: No host described in new configuration $id for replica set $name maps to this node

Just restarting the mongodb daemon fixed it, so it couldn't be a replica set configuration issue.

After checking the logs a bit more in detail, I noticed the following error message: NETWORK [replexec-0] getaddrinfo("$name.emilburzo.com") failed: Temporary failure in name resolution -> bingo

It was trying to query the hostname before the network was fully up, and thus the replica set member didn't know it's own identity

Adding the server's FQDN hostname to /etc/hosts fixed it, e.g.:

127.0.1.1       shortname    shortname.fqdn.com


if you are using mongo.conf file then initially comment "replication" section like below,

...#operationProfiling:# replication:#   replSetName: rs0-here#sharding:...

Now run mongod and configure replica set on mongo terminal like below,

rs.initiate({_id: "rs0-here", version: 1, members: [{ _id: 0, host : "your_host:27017" }]})

You can also create users and databases here and then exit out of it. Uncomment the following section in mongo.conf,

 replication:   replSetName: rs0-here

run mongod again and then this issue should go away.


Looks like the port is wrong. The default port of MongoDB is 27017, not 27071.