码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • mongodb跨数据中心备份


    可以使用mongoshake工具进行备份。

    You can use the mongoshake utility for backups.

     

    地址为:GitHub - 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的集群复制工具,可以满足迁移和同步的需求,进一步实现灾备和多活功能。

    GitHub- 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. The cluster replication tool based on mongodb oplog can meet the requirements of migration and synchronization, and further realize disaster recovery and multi-activity functions.

    mongodbShake可以应用在实例间复制,机房间、跨数据中心复制。

    MongodbShake can be used for inter-instance replication, inter-machine room replication, and cross-data center replication.

    mongodbshake是通过读取MongoDB集群的Oplog操作日志,对MongoDB的数据进行复制,后续通过操作日志实现特定需求。

    Mongodbshake is to copy the data of MongoDB by reading the Oplog operation log of MongoDB cluster, and then realize specific requirements through the operation log.

    下载mongoshake安装包:

    Download the mongoshake installation package:

    GitHub - 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的集群复制工具,可以满足迁移和同步的需求,进一步实现灾备和多活功能。

    GitHub - 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. The cluster replication tool based on mongodb oplog can meet the requirements of migration and synchronization, and further realize disaster recovery and multi-activity functions.

    解压:

    Decompression:

    tar zxf mongo-shake-v2.7.4.tgz

    cd mongo-shake-v2.7.4/

    内容如下所示:

    The contents are as follows:

    修改collector.conf文件(针对有密码验证的情况):

    Modify the collector.conf file (with password authentication):

    修改

    modification

    mongo_urls,代表源端mongo

    mongo_urls, representing the source mongo

    tunnel.address  目的端mongo

    tunnel.address  destination mongo

    sync_mode = all (视情况而定,有all 全量+增量同步,full表示全量同步,incr表示增量同步)

    sync_mode = all (depending on the situation, there are all full + incremental synchronization, full means full synchronization, incr means incremental synchronization)

    filter.pass.special.db = admin   

    #指定特殊的namespace通过,比如admin,system.views,mongoshake,config。正常情况下,这几个都会被过滤,但是有可能有比较特殊的情况,例如,由于历史原因,用户的数据写入到admin库了,现在希望对这部分数据也进行同步,那么就可以执行filter.pass.special.db=admin。默认空。

    #Specify special namespaces via, for example, admin, system.views, mongoshake, config. Under normal circumstances, these data will be filtered, but there may be special cases. For example, due to historical reasons, the user's data has been written into the admin library, and now you want to synchronize this part of data, you can execute filter.pass.special.db =admin. Default is empty.

    格式如下:

    The format is as follows:

    备注:需要注意,源端与目的端的账号需要对mongo里面的库有全部权限(可以把权限设置为root)

    Note: Note that the accounts of the source and destination terminals need to have all permissions on the libraries in mongo (the permissions can be set to root).

    启动mongoshake

    Start mongoshake

    nohub ./collector.linux -conf ./collector.conf &

    mongoshake的配置文件

    Configuration file for mongoshake

    (2.4版本之后mongoshake参考如下配置文件释义)

    (After version 2.4, refer to the following configuration file for explanation of mongoshake)

    配置参数说明 · alibaba/MongoShake Wiki · GitHub

    · alibaba/MongoShake Wiki · GitHub

  • 相关阅读:
    Vscode screen 模式终端窗口查看历史信息
    人工智能将如何改变敏捷项目管理?
    高德地图API-通过经纬度获取当前位置附近的建筑
    c++的4中类型转换操作符(static_cast,reinterpret_cast,dynamic_cast,const_cast),RTTI
    LeetCode3-无重复字符的最长子串
    Node.js -- fs模块
    【必知必会的MySQL知识】③DML语言
    JVM经典五十问,这下面试稳了
    LED高精度体重秤方案规格书
    【课程作业经验】基于MindSpore的YOLOv3-Darknet53的车辆检测计数实现
  • 原文地址:https://blog.csdn.net/Linux_newbie_rookie/article/details/126405981
  • 最新文章
  • 沪漂五周年了:我越来越迷茫了
    Agentic Skill Routing 实战:别再把所有 Skill 塞进 AI Agent 上下文
    MySQL-Seconds_behind_master的精度误差
    [MAF预定义ChatClient中间件-03]CachingChatClient——利用缓存省钱省时间
    AI的至暗历史:从万众期待到被政府撤资,AI的两次死亡徘徊
    Agent OS :五种驯服不确定性的范式
    PortSwigger SQL注入LAB11
    数据库即时编译JIT
    [Begin]AI Learn Data Day 0
    深度学习进阶(二十七)现代 LLM 的核心架构设计其二:SwiGLU
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
小工具 小游戏
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1

京公网安备 11010502049817号