I am getting this message every time I do rs.initiate()
:
No host described in new configuration 1 for replica set rs0 maps to this node
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