1. <strong id="7actg"></strong>
    2. <table id="7actg"></table>

    3. <address id="7actg"></address>
      <address id="7actg"></address>
      1. <object id="7actg"><tt id="7actg"></tt></object>

        TiDB Binlog準(zhǔn)實(shí)時備份同步工具

        聯(lián)合創(chuàng)作 · 2023-10-01 02:24

        TiDB Binlog 是一個用于收集 TiDB 的 binlog,并提供準(zhǔn)實(shí)時備份和同步功能的商業(yè)工具。

        TiDB Binlog 支持以下功能場景

        • 數(shù)據(jù)同步:同步 TiDB 集群數(shù)據(jù)到其他數(shù)據(jù)庫
        • 實(shí)時備份和恢復(fù):備份 TiDB 集群數(shù)據(jù),同時可以用于 TiDB 集群故障時恢復(fù)

        TiDB Binlog 整體架構(gòu)

        TiDB Binlog 集群主要分為 Pump 和 Drainer 兩個組件,以及 binlogctl 工具:

        Pump

        Pump 用于實(shí)時記錄 TiDB 產(chǎn)生的 Binlog,并將 Binlog 按照事務(wù)的提交時間進(jìn)行排序,再提供給 Drainer 進(jìn)行消費(fèi)。

        Drainer

        Drainer 從各個 Pump 中收集 Binlog 進(jìn)行歸并,再將 Binlog 轉(zhuǎn)化成 SQL 或者指定格式的數(shù)據(jù),最終同步到下游。

        binlogctl 工具

        binlogctl 是一個 TiDB Binlog 配套的運(yùn)維工具,具有如下功能:

        • 獲取 TiDB 集群當(dāng)前的 TSO
        • 查看 Pump/Drainer 狀態(tài)
        • 修改 Pump/Drainer 狀態(tài)
        • 暫停/下線 Pump/Drainer

        主要特性

        • 多個 Pump 形成一個集群,可以水平擴(kuò)容。
        • TiDB 通過內(nèi)置的 Pump Client 將 Binlog 分發(fā)到各個 Pump。
        • Pump 負(fù)責(zé)存儲 Binlog,并將 Binlog 按順序提供給 Drainer。
        • Drainer 負(fù)責(zé)讀取各個 Pump 的 Binlog,歸并排序后發(fā)送到下游。
        • Drainer 支持 relay log 功能,通過 relay log 保證下游集群的一致性狀態(tài)。

        注意事項

        • 需要使用 TiDB v2.0.8-binlog、v2.1.0-rc.5 及以上版本,否則不兼容該版本的 TiDB Binlog。

        • Drainer 支持將 Binlog 同步到 MySQL、TiDB、Kafka 或者本地文件。如果需要將 Binlog 同步到其他 Drainer 不支持的類型的系統(tǒng)中,可以設(shè)置 Drainer 將 Binlog 同步到 Kafka,然后根據(jù) binlog slave protocol 進(jìn)行定制處理,參考 binlog slave client 用戶文檔。

        • 如果 TiDB Binlog 用于增量恢復(fù),可以設(shè)置配置項 db-type="file",Drainer 會將 binlog 轉(zhuǎn)化為指定的 proto buffer 格式的數(shù)據(jù),再寫入到本地文件中。這樣就可以使用 Reparo 恢復(fù)增量數(shù)據(jù)。

          關(guān)于 db-type 的取值,應(yīng)注意:

          • 如果 TiDB 版本 < 2.1.9,則 db-type="pb"。
          • 如果 TiDB 版本 > = 2.1.9,則 db-type="file" 或 db-type="pb"。
        • 如果下游為 MySQL/TiDB,數(shù)據(jù)同步后可以使用 sync-diff-inspector 進(jìn)行數(shù)據(jù)校驗。

        瀏覽 18
        點(diǎn)贊
        評論
        收藏
        分享

        手機(jī)掃一掃分享

        編輯 分享
        舉報
        評論
        圖片
        表情
        推薦
        點(diǎn)贊
        評論
        收藏
        分享

        手機(jī)掃一掃分享

        編輯 分享
        舉報
        1. <strong id="7actg"></strong>
        2. <table id="7actg"></table>

        3. <address id="7actg"></address>
          <address id="7actg"></address>
          1. <object id="7actg"><tt id="7actg"></tt></object>
            日本午夜在线 | 亚洲影视网 | 嫦娥性艳史bd | 床戏做爰无遮挡摸亲胸 | 特级人体西西444ww… | 伊人黄| 夜夜操屄 | 少妇一级婬片免费放播放 | 久久国产成人视频 | 国产精品久久久久9999 |