从地图集到本地副本设置的 Mongomirror

问题描述

我一直在尝试使用 mongomirror 将 Atlas 开发实例同步到本地 mongo 副本设置。图集也是支持此操作的 3 节点副本设置。主要问题似乎是与本地设置的连接。我尝试了许多不同的设置,从单节点副本到带有自签名 SSL 的 3 个副本,但仍然没有运气。 本地设置如下:

  • docker-compose 标准 mongo 图像,带有 --bind_ip_all --replSet rs0 --tlsMode requireTLS --tlsCertificateKeyFile /etc/ssl/keycert.pem
  • 使用192.168.0.23主机地址在mongo服务器中配置副本,每个节点映射到端口270172701827019

我还尝试使用本地 CA 签署证书,然后将该文件作为参数 --sslCAFile 传递给 mongomirror,已为 localhost 和本地 IP 地址执行此操作,但均无效

我收到的最后一个错误自带localhost 的单节点副本设置(其他设置也给出了相同的错误,这让我相信问题不在于复制设置)

mongomirror --host "hostinfo" --username "username" --password "password" --destination "localhost:27017" --ssl --tlsInsecure --sslCAFile "ssl/rootCA.crt"

mongomirror version: 0.11.1
git version: 326240f20c231f46d22040afe7c54f4b7bd83e88
Go version: go1.14.7
   os: linux
   arch: amd64
   compiler: gc

2021-04-28T12:22:55.631+0100    Source isMaster output: ... [log removed for confidentiality]
2021-04-28T12:22:55.644+0100    WARNING: --destination does not contain a replica set name! - localhost:27017
2021-04-28T12:22:55.644+0100    WARNING: mongomirror will not be able to tolerate destination failover if it occurs.
2021-04-28T12:24:55.645+0100    Error initializing mongomirror: Could not initialize destination connection: Could not connect to server: server selection error: server selection timeout,current topology: { Type: Single,Servers: [{ Addr: localhost:27017,Type: UnkNown,State: Connected,Average RTT: 0,Last error: connection() : x509: certificate signed by unkNown authority },] }

在 robo3T 中使用相同的 CA 文件和 TLS 我可以连接到该节点并执行操作,这让我相信这是 mongomirror一个问题,它不尊重传递给它的任何 TLS 标志。

如果我省略 SSL 并且不在本地服务器上启用它,我也会得到 server selection error: server selection timeout

我不知道接下来要尝试什么,副本总是在这些实例上启用和初始化,因此这似乎是 mongomirror 的连接问题,不幸的是,没有记录详细或调试选项来显示更多日志信息

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)