MongoDB:Failed: error connecting to db server: no reachable servers

when using mongoimport and other tools to connect to remote mongodb server, the following error is often reported:

Failed: error connecting to db server: no reachable servers

this is due to the mongodb server restriction that only allows 127.0.0.1 access. There are three modification methods:

1. Add parameter –bind_ip_all

mongod –bind_ip_all

2. Add parameters –bind_ip 0.0.0.0

mongod – bind_ip 0.0.0.0

3. Modify mongod. CFG

bindIp: 0.0.0.0

reference document

mongodb meet error: no reachable servers

Read More: