3

最近 AWS 通过 DocumentDB 实现了与 MongoDB 版本 3.6 的兼容性。

Document DB 需要一个可以在以下位置下载的证书:

https://s3-us-gov-west-1.amazonaws.com/rds-downloads/rds-GovCloud-Root-CA-2017.pem

使用类似于以下内容的配置文件:

https://github.com/mongodb/mongoid/blob/master/lib/rails/generators/mongoid/config/templates/mongoid.yml

我想知道是否有办法在 mongoid gem 中设置与 3.6 的兼容性,或者是否有特定版本可以确保使用 3.6 版本?

谢谢

4

3 回答 3

2

首先,需要注意的是,DocumentDB 仅实现了与亚马逊宣传的“MongoDB 3.6”的部分兼容性。您可以在此处阅读有关某些不兼容性的更多信息:https: //www.mongodb.com/blog/post/documents-are-everywhere

Mongoid 在实际的 MongoDB 3.6 服务器上工作并经过测试。无需特殊配置。

根据尝试的确切操作,将 Mongoid 与 DocumentDB 一起使用可能会起作用,或者可能会暴露 Amazon 文档数据库中的不兼容/遗漏。

于 2019-03-19T15:52:47.133 回答
2

First, you may need to download the RDS combined bundle as opposed to the rds-GovCloud-Root-CA-2017.pem. Link: https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem

Try this as your yaml file:

development:
  clients:
    default:
      uri: mongodb://myuser:mypassword@<your_cluster_endpoint>:<cluster_port>/test?ssl=true
      options:
        ssl_ca_cert: /path/to/rds-combined-ca-bundle.pem
于 2019-03-25T20:23:20.573 回答
0

示例工作配置

production:
    clients:
        default:
            uri: "mongodb://user:pass@db_end_point:27017/db_name?ssl=true&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false"
            app_name: AppName
            options:
                ssl_ca_cert: "./config/rds-combined-ca-bundle.pem"

development:
    clients:
        default:
            uri: "mongodb://user:pass@db_end_point:27017/db_name?ssl=true&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false"
            app_name: AppName
            options:
                ssl_ca_cert: "./config/rds-combined-ca-bundle.pem"


test:
    clients:
        default:
            uri: "mongodb://user:pass@db_end_point:27017/db_name?ssl=true&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false"
            app_name: AppName
            options:
                ssl_ca_cert: "./config/rds-combined-ca-bundle.pem"
于 2020-08-06T15:45:39.987 回答