MongoDB 到 DocumentDB
| 功能 | 说明 |
|---|---|
Full Data Migration | Migrate data by sequentially scanning data in tables and writing it in batches to the target database. Supported _id types: ObjectId, Long, Integer. |
Incremental Data Sync | Sync of INSERT, UPDATE, DELETE is supported. |
Data Verification and Correction | Verify all existing data. Optionally, you can correct the inconsistent data based on verification results. Scheduled DataTasks are supported. |
Subscription Modification | Add, delete, or modify the subscribed tables with support for historical data migration. For more information, see Modify Subscription. |
Position Resetting | Reset positions by timestamp to consume the oplog in a past period again. |
Supported Deployment | Support master-slave, replica set, sharded cluster. |
限制和注意点
| 限制项 | 说明 |
|---|---|
oplog 大小和保留时间设置 | MongoDB 默认配置 replication.oplogSizeMB 过小 或 storage.oplogMinRetentionHours 过小,如数据同步延迟过大,可能导致未消费的 oplog 被清除,需调大此参数 |
MongoDB 主备架构的任务设置 | 源端 MongoDB 主备架构模式,需要将源端任务参数 oplogCollection 设置为 oplog.$main |
changeStream 模式 | MongoDB 3.6 以上支持 changeStream 获取增量变更,同步任务可以设置源端参数 captureMode 为 CHANGE_STREAM,MongoDB 分片集群可以填写 Mongos 连接串进行同步 |
oplog 模式 | 当使用 oplog 模式进行 MongoDB 源端同步时,需要确保该能够访问到 local 库 |
任务参数
| 参数名称 | 说明 |
|---|---|
captureMode | 配置 MongoDB 增量源端模式,支持 OP_LOG 和 CHANGE_STREAM 模式 |
changeStreamBatchSize | 配置 MongoDB Change Stream 每一批拉取变更事件的最大条数 |
oplogCollection | 配置 MongoDB oplog 的集合名,默认是 oplog.rs |
timezone | 需要转换的源端时区(默认 UTC) |
Tips: 通用参数配置请参考 通用参数及功能
任务参数
| 参数名称 | 说明 |
|---|---|
totalDataInMemMb | 攒批写入,内存中最大数据容量,超过此容量或超过 asyncFlushIntervalSec 则刷出数据到写入队列 |
asyncFlushIntervalSec | 攒批写入,等待刷出的间隔时间,超过此时间或超过 totalDataInMemMb 则刷出数据到写入队列 |
flushBatchMb | 单表最大攒批容量,超过此容量则刷出数据到写入队列 |
realFlushPauseSec | 刷出数据到 MongoDB 的等待时间,0 则不等待 |
enableTimeZoneProcess | 是否对时间字段进行时区转换 |
timezone | 需要转换的目标时区(默认 UTC) |
enableBatchApply | 启用批量写入模式 (默认关闭) |
Tips: 通用参数配置请参考 通用参数及功能