alibaba / MongoShake

MongoShake is a universal data replication platform based on MongoDB's oplog. Redundant replication and active-active replication are two most important functions. 基于mongodb oplog的集群复制工具,可以满足迁移和同步的需求,进一步实现灾备和多活功能。
GNU General Public License v3.0
1.72k stars 441 forks source link

upgrade MongoShake to version >= 2.4.0] error on V2.4.1 #328

Closed k-nuhdim closed 4 years ago

k-nuhdim commented 4 years ago

Below are snippet of collecter.log

[2020/04/18 13:39:55 IST] [CRIT] [collector.(*OplogSyncer).Start:194] load checkpoint[testdb] failed[current required checkpoint version[1] > input[0], please upgrade MongoShake to version >= 2.4.0]

Please help me on this.

vinllen commented 4 years ago

You should remove the old checkpoint which locates on the source MongoDB by default, 'cause the checkpoint format is changed since v2.4.0

k-nuhdim commented 4 years ago

Deleted all monoshake dbs from source database , but still egtting same issue, does that saving checkpoint anywhere else?

vinllen commented 4 years ago

if the source MongoDB is replica, the address is mongoshake.ckpt_default on the source MongoDB. if the source MongoDB is sharding, the address is admin.ckpt_default on config-server. Once delete the checkpoint, if you start with sync_mode = all, MongoShake will run full-sync and then incremental sync; if you start with sync_mode = oplog, MongoShake will run incremental sync only to fetch the oldest oplog from souce MongoDB.

k-nuhdim commented 4 years ago

Hi vinellen, Just want to know how the " sync_mode = all " works , is it useful to sync all data from one replicaset to another ?

vinllen commented 4 years ago

If you want to sync all data from one replica to another, please set sync_mode = all. There're two stages of syncing:

  1. full sync. Scan all data on the source replica/sharding and then write to the target mongodb.
  2. incremental sync. Fetch the oplog from the source and then apply it to the target.

So sync_mode = all means full+incremental, sync_mode = full means only full sync, sync_mode = incr means only incremental sync.

k-nuhdim commented 4 years ago

@vinllen - Thanks ! my use case is to replicate Production server data -----> DR Server and once its fail-over to DR happen then I need to change syncing direction from DR ----> PROD . so i hope if i make sync mode as full + increment it will sync all missing data first the later oplog will replaying based on the source write.

vinllen commented 4 years ago

Currently, MongoShake only supports failover in the incremental stage which means if you restart MongoShake or MongoDB crash in full sync stage, you need to restart MongoShake to run full+incrmental sync again. But in the incremental stage, MongoShake supports resume-from-break-point.

k-nuhdim commented 4 years ago

@vinllen - Thanks for the confirmation - Closing this.