mongorestore Failed: no reachable servers

The problem occured because --replSet was enabled in configuration. But the node wasn't yet in any replica set.

After I removed --replSet from configuration, relaunched mongodb server, mongorestore started to work without any --host parameter.


Do you run mongo in replica set, i.e., mongod --replSet rs0?

If yes, please remember to run in your mongo shell the command: rs.initiate()

Then you can use cmd mongorestore to restore your db.


try adding host param

mongorestore --host=127.0.0.1 --port=27133 dump

Tags:

Mongodb