MongoRestore shows no Reachable servers error in sharded cluster environment on AWS?

2,121 views
Skip to first unread message

adeel asghar

unread,
Oct 31, 2016, 7:00:24 PM10/31/16
to mongodb-user

Dear All,


Can someone help me as I am stuck in this problem for many days. My client created a remote database in a sharded cluster environment on AWS and he gave me credentials to access. I am able to connect to the remote cluster database using mongo shell. I have dumps available which need to restore on remote DB but when I ran the below command on mongo shell it shows me error:


mongorestore --host Test-shard-0/test-shard-00-00-fk4je.mongodb.net:27017,test-shard-00-01-fk4je.mongodb.net:27017,test-shard-00-02-fk4je.mongodb.net:27017 --db admin --username jeff --password jeff11 dump/staffing/companies.bson

Error: Failed: error connecting to db server: no reachable servers.


Though, I am able to connect to database easily using mongo shell and see the databases/collections but can't figure out why mongorestore not working. Tried different things but every time above error appears.


Cheers,

Adeel

Wan Bachtiar

unread,
Nov 6, 2016, 11:10:14 PM11/6/16
to mongodb-user

Error: Failed: error connecting to db server: no reachable servers.

Hi Adeel,

Check your database login credentials i.e. username and password make sure they are valid.

Also check whether you require —ssl parameter for mongorestore, as the mongo shell can accept the SSL option from connection string URI.

mongorestore —host … —db admin

Based on your example, you are trying to connect to the admin database. Perhaps you’re intending to specify —authenticationDatabase admin instead ?

See also mongorestore required access for privileges information.

Regards,

Wan

Reply all
Reply to author
Forward
0 new messages