AWS 上的 mongodb 自动故障转移/高可用性
我需要在 aws ec2 上为 mongodb 提供正确的故障转移机制。我知道故障转移可以通过副本集来完成,但是启动新的 mongo 安装的 ubuntu-ec2 ami 节点并自动将其再次添加到副本集(零手动操作)并将副本集返回到正确的状态的最佳方法是什么?
EBS 有一些问题,但是如果我使用本地实例存储,我将丢失死节点数据,但是副本是否获得了所有主数据,因此 replaca 是否足以恢复所有内容(在带日志功能的 mongo 1.8 上),或者我是否这样做必须只使用EBS吗?
我应该如何启动 mongo 实例,如果我应该从修复选项开始,如何从故障转移重新启动中分离节点的第一次运行?
问候,
I need the proper way of failover mechanism for mongodb on aws ec2. I know failover can be accomplished by replica sets, but what is the best way to fire a new mongo installed ubuntu-ec2 ami node and add it to replica set again automatically (with zero manual operation) and return the replica set to it's proper state ?
EBS has some problems, but if I use local instance storage, I will lost the dead nodes data, but does the replica got all the master data and so is replaca is enough to recover everthing (on mongo 1.8 with journaling), or do I have to use only EBS ?
How should I start mongo instances, If I should start with repair option, how can I sperate node's first run from failover restart ?
Regards,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
启动新节点的最简单方法是启动具有最近备份的新节点。
所以现在的问题是如何进行备份以及如何快速从备份中恢复。
MongoDB 站点有一篇关于备份(一般情况)和备份的文章EC2 具体。还有一篇关于添加新集合成员。
您可以使用实例存储或 EBS 驱动器来实现此目的,但您需要针对每种存储采取不同的策略。实际上没有单一的方法可以做到这一点,所以我会查看我链接到的文档以获取入门知识。
The easiest way to bring up new nodes is to bring up a new node with a recent backup.
So now it's a question of how you do your backup and how you restore from the backup quickly.
The MongoDB site has a write up for backups (in general) and backups on EC2 specifically. There's also a write-up for adding a new set member.
You can do this with instance storage or EBS drives, but you'll need different strategies for each. There's really no single way to do this, so I would check out the docs I've linked to for a primer.
强烈建议阅读 Sean Coates 关于多节点的文章 MongoDB Elections,故障转移和 AWS - 具体来说,分布式仲裁节点的微妙之处(例如,确保在可用区出现故障时为自己提供多数投票权)。类似的建议可以在对此的评论中找到(现已关闭)MongoDB vs. Cassandra 线程。
Highly recommend reading Sean Coates' article on mutli-node MongoDB Elections, failover and AWS - specifically, the subtlety on distributed arbiter nodes (e.g., make sure to give yourself a voting majority when an AZ goes down). A similar recommendation can be found in a comment on this (now-closed) MongoDB vs. Cassandra thread.