码农知识堂 - 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

  • 相关阅读:
    2023年Q4软件测试一般性趋势
    文件分卷压缩和压缩的区别是什么
    C语言与内存息息相关的重要概念有哪些?
    初识Cpp之 二、IO与文件
    Comparable接口与Comparator接口
    计算机基础之虚拟内存概述
    【正点原子STM32连载】 第六十四章 综合测试实验摘自【正点原子】MiniPro STM32H750 开发指南_V1.1
    百度第三季度财报前瞻:财务业绩预计将超预期
    仿细胞膜结构交联改性聚乳酸纳米颗粒PLA NPs/红细胞膜包裹盘状纳米载体
    图增强与图对比学习
  • 原文地址:https://blog.csdn.net/Linux_newbie_rookie/article/details/126405981
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号