MongoDB 到 MongoDB Atlas
| 功能 | 说明 |
|---|---|
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: 通用参数配置请参考 通用参数及功能