使用 ELB 端点作为 dns 的 mongodb 集群 [英] mongodb cluster with ELB endpoint as dns

查看:31
本文介绍了使用 ELB 端点作为 dns 的 mongodb 集群的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这不是技术问题,而是我在这里提出的更多架构问题.

This is not a technical but more of architectural question I am asking here.

我已经关注了这个 博客 用于设置 mongodb 集群.我们有 2 个私有子网,我在其中配置了 3 个 mongodb 成员副本集.现在我想对整个集群使用像 mongod.some_subdomain.example.com 这样的单个 dns.我无权访问 Route53,在我的情况下,设置/更新 dns 记录至少需要 2 小时,因为我依赖于我们的云支持.我不确定哪个服务器主要响应 mongodb 集群中的应用程序请求.那么有没有办法将整个集群放在 ELB 后面,并使用 ELB 作为 DNS 将流量路由到主节点,同时如果有故障转移,那么下一个主节点将是除仲裁节点之外的 ELB 成员.

I have followed this blog for setting up the mongodb cluster. We have 2 private subnets in which I have configured 3 member replica set of mongodb. Now I want use a single dns like mongod.some_subdomain.example.com for whole cluster. I do not have access to Route53 and setting/updating the dns records takes at least 2 hours in my case since I am dependant on our cloud support for it. I am not sure which server primarily responds to applications requests in mongodb cluster. So is there a way to put the whole cluster behind ELB and use ELB as DNS to route traffic to primary and at the same time if there is failover then next primary would be the member of ELB except the arbiter node.

推荐答案

驱动程序将尝试连接到副本集配置中的所有节点.如果您将节点置于代理之后,驱动程序将绕过代理并尝试直接与节点对话.

The driver will attempt to connect to all nodes in the replica set configuration. If you put nodes behind proxies the driver will bypass the proxies and try to talk to the nodes directly.

您可以代理独立和分片集群部署,因为驱动程序不需要直接连接到这些数据节点,但是将多个 mongoses 映射到单个地址可能会导致可重试读/写、会话、事务等问题.这是不支持的配置.

You can proxy standalone and sharded cluster deployments as the driver doesn't need a direct connection to data nodes in those but mapping multiple mongoses to a single address can create problems with retryable reads/writes, sessions, transactions etc. This is not a supported configuration.

这篇关于使用 ELB 端点作为 dns 的 mongodb 集群的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆