【问题标题】:How to deploy this mongodb cluster?如何部署这个 mongodb 集群?
【发布时间】:2021-04-08 18:09:37
【问题描述】:

所以我一直在尝试部署一个 mongodb 副本集。我的目标是让一个 vps 运行 docker 上所需的所有 mongodb 实例。我一直在关注这个GitHub,到目前为止它一直很顺利。现在我的问题是如何为此设置身份验证,以便我的服务器和 Robo 3t 客户端可以通过类似这样的 url 连接到它

mongodb+srv://username:password@serverurl.com/databasename?retryWrites=true&w=majority

我只需要公开路由器实例还是需要公开所有内容?如何?谢谢。

【问题讨论】:

    标签: database mongodb deployment


    【解决方案1】:
    1. 您需要在 mongodb 集群级别启用身份验证/授权: https://docs.mongodb.com/manual/core/security-internal-authentication/ (您可能需要启用传输加密)

    2.你只需要暴露路由服务(mongos)... 如何发布/公开:https://www.whitesourcesoftware.com/free-developer-tools/blog/docker-expose-port/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-02-21
      • 1970-01-01
      相关资源
      最近更新 更多