【问题标题】:Mongo Restore shows no Reachable servers error in sharded cluster environment on AWS?Mongo Restore 在 AWS 上的分片集群环境中显示没有可访问服务器错误?
【发布时间】:2017-03-13 22:17:36
【问题描述】:

有人可以帮助我,因为我被这个问题困扰了很多天。我的客户在 AWS 上的分片集群环境中创建了一个远程数据库,他给了我访问凭据。我可以使用 mongo shell 连接到远程集群数据库。我有可用的转储,需要在远程数据库上恢复,但是当我在 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

错误:失败:连接到数据库服务器时出错:没有可访问的服务器。

虽然,我可以使用 mongo shell 轻松连接到数据库并查看数据库/集合,但无法弄清楚为什么 mongorestore 不起作用。尝试了不同的东西,但每次都会出现上述错误。

【问题讨论】:

    标签: mysql node.js mongodb shell amazon-web-services


    【解决方案1】:

    你是不是错过了 --port 27017 部分。根据文档

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

    这是恢复文档的示例。

    【讨论】:

    • 它的集群环境端口已经存在。顺便提一句。你提到的那个也没有用。
    【解决方案2】:

    --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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-08
      • 2020-05-25
      相关资源
      最近更新 更多