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

前端 未结 2 1894
南笙
南笙 2021-02-19 22:45

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

2条回答
  •  无人共我
    2021-02-19 23:16

    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
    

提交回复
热议问题