Press enter to see results or esc to cancel.

MongoDB: No host in new replica set maps to this node

In the “trivial-errors” category, I imagine one will encounter this error when setting up MongoDB replica sets.

> rs.initiate(rsconfig)
       "ok" : 0,
       "errmsg" : "No host described in new configuration 1 for replica set replset maps to this node",
       "code" : 93

What this means is that the current instance cannot connect to host 1 in my rsconfig for a few possible reasons.

  • A firewall or network configuration blocking access to the MongoDB port.
  • The host cannot be resolved.
  • There is not mongod instance specified on that host:port.
  • And more

So the next time you see these errors, check your replica set config, make sure you can connect to each node first.