文档地址:https://github.com/Qihoo360/mongosync/wiki/%E4%BD%BF%E7%94%A8%E6%A0%B7%E4%BE%8B

 

#数据全量备份
mongodump --authenticationDatabase admin -u root -p root  --port 27017-h 192.168.10.125 -o /opt/mongo-backup/
#数据全量恢复
#staging
mongorestore -h 192.168.10.123:27017--authenticationDatabase admin -u root -p root --dir /opt/mongo-backup/


安装mongosync
yum install gcc-c++ scons
yum install boost boost-devel boost-doc
yum install openssl-devel
cd mongosync && make

 

1、带索引实时同步
/opt/server/mongosync/output/mongosync --src_srv 192.168.10.125:27017--src_user root --src_passwd root --src_auth_db admin --dst_srv 192.168.10.123:27017--dst_user root --dst_passwd root --dst_auth_db admin --bg_num 2 --oplog

 

相关文章:

  • 2021-05-25
  • 2022-02-05
  • 2021-11-14
  • 2021-07-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-25
猜你喜欢
  • 2021-11-21
  • 2022-12-23
  • 2021-05-21
  • 2022-12-23
  • 2022-12-23
  • 2022-02-02
相关资源
相似解决方案