Expand description
Mongo sync lib, which provides an easily usage api to sync data from one mongodb to another mongodb.
Provides two syncer: MongoSyncer and OplogSyncer, and one cleaner OplogCleaner.
OplogSyncer is used to sync cluster oplog, and MongoSyncer is used to sync mongodb data. OplogCleaner is used to clean too old oplog data.
§OplogSyncer example:
use mongo_sync::OplogSyncer;
let oplog_syncer = OplogSyncer::new("mongodb://localhost:27017", "mongodb://localhost:27018").unwrap();
oplog_syncer.sync_forever();
§MongoSyncer example:
use mongo_sync::{DbSyncConf, MongoSyncer};
let conf = DbSyncConf::new("mongodb://localhost:27017".to_string(), "mongodb://localhost:27018".to_string(), "mongodb://localhost:27017".to_string(), "a".to_string(), None, None, None);
let syncer = MongoSyncer::new(&conf);
syncer.sync();
§OplogCleaner example:
use mongo_sync::OplogCleaner;
let oplog_cleaner = OplogCleaner::new("mongodb://localhost:27018".to_string());
oplog_cleaner.run_clean();
Modules§
- cmd_
oplog - Provide structured command type oplog definition.
Structs§
- Connection
- A simple abstraction for mongodb syncer connection.
- DbSync
Conf - database sync configuration.
- Mongo
Syncer - Mongodb syncer to sync from one database to another database.
- Oplog
Cleaner - A cleaner to clean too old oplog, which is synced by OplogSyncer.
- Oplog
Syncer - A syncer to sync oplogs from one mongodb cluster to another mongodb.
- Oplog
Syncer Config - Global mongo syncer configuration.