简体   繁体   English

Mongo Restore在AWS的分片群集环境中没有显示“可到达的服务器”错误?

[英]Mongo Restore shows no Reachable servers error in sharded cluster environment on AWS?

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. 我的客户在AWS的分片集群环境中创建了一个远程数据库,他给了我访问凭证。 I am able to connect to the remote cluster database using mongo shell. 我能够使用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: 我有可用的转储,需要在远程数据库上还原,但是当我在mongo shell上运行以下命令时,显示错误:

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 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-用户名jeff-密码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. 虽然,我能够使用mongo shell轻松连接到数据库并查看数据库/集合,但无法弄清mongorestore为什么不起作用。 Tried different things but every time above error appears. 尝试了不同的事情,但每次出现以上错误时,都会出现。

Aren't you missing the --port 27017 part. 您是否不错过--port 27017部分。 According to the documentation 根据文档

mongorestore --host mongodb1.example.net --port 37017 --username user --password pass /opt/backup/mongodump-2011-10-24

this is the example of restoring document. 这是还原文档的示例。

--ssl flag was missing from command. 命令中缺少--ssl标志。

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 --ssl --username jeff --password jeff11 dump/staffing/companies.bson 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 --ssl --username jeff --password jeff11 dump / staffing / companies.bson

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM