caosiyang / py-mongo-sync

Oplog-based data sync tool that synchronizes data from a replica set to another deployment, e.g.: standalone, replica set, and sharded cluster.
http://caosiyang.github.io/py-mongo-sync/
MIT License
108 stars 46 forks source link

可不可以改变目标库的名字 #1

Closed heroWang closed 8 years ago

heroWang commented 8 years ago

你好,我们有个需求是要把同一集群中的一个库,从一个复制集迁移到另一个复制集。我知道可以用moveprimary实现。但是这样就要停止读写,会影响线上业务。我现在想到的一个方法是,实时同步源复制集和目标复制集的两个库,然后在运维时间两个库的差异非常小的时候,通过改名字的方法,快速切换到目标库上。 我看了你的使用说明里没有指定目标库的名字,那我是否可以定制出满足我的需求的py-mongo-sync?或者说我的想法是否可行?

heroWang commented 8 years ago

文档说没有办法改数据库名字.除掉这个其他的我认为是可行的.

caosiyang commented 8 years ago

你好,不知为何没有收到github通知,才看到你的issue,不好意思! 目前不支持指定目标db名称,但我看到其他人也有同样的需求,并且已经做了改进,你看看 https://github.com/mignev/py-mongo-sync/tree/dev ,应该是你需要的。