Home  >  Article  >  Database  >  一种MongoDB分片集群迁移的方案

一种MongoDB分片集群迁移的方案

WBOY
WBOYOriginal
2016-06-07 16:39:291237browse

场景: 生产环境,所有机器全部更换。需要短暂的影响或暂停业务(迁移config servers的时间) 步骤: 迁移3台config servers ,建议不换主机名迁移,迁移过程中及迁移后后老的mongos仍能访问,详见 Migrate Config Servers with the Same Hostname,以hosts

场景:
生产环境,所有机器全部更换。需要短暂的影响或暂停业务(迁移config servers的时间)
步骤:

  1. 迁移3台config servers ,建议不换主机名迁移,迁移过程中及迁移后后老的mongos仍能访问,详见 Migrate Config Servers with the Same Hostname,以hosts文件配置为例,更改config server对应域名指向的ip为新的ip即可。新的config servers启动正常后,业务可开启。
  2. 在新的机器启动新的mongos。
  3. 各片添加新的数据节点。
  4. 各片删除老的数据节点。
  5. 删除老的mongos。

总结:总体步骤清晰简单,但要注意细节的处理,集群很大的话,过程比较缓慢。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn