I tried to restore mongo from dump but failed:
mongorestore --port 27133 dump
2015-05-07T09:39:11.760+0300 Failed: no reachable servers
First run mongod
If you get exception exception in initAndListen: 29 Data directory /data/db not found., terminating
, do sudo mkdir -p /data/db
If you get expection exception in initAndListen: 98 Unable to create/open lock file: /data/db/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating
, This probably you have the permission issue. If this is your local, you can run sudo chmod 7777 /data/db
to fix the issue.
Now, mongod
should work.
Then, run mongorestore dump
where your dump file is.
You should successfully restore the dump file.