DM レプリケーション シナリオでのデータ チェック

TiDB データ移行などの複製ツールを使用する場合、複製プロセスの前後でデータの整合性を確認する必要があります。 DM-masterからtask-nameの特定の構成を設定して、データチェックを実行できます。

以下は簡単な構成例です。完全な構成については、 Sync-diff-inspector ユーザーガイドを参照してください。

# Diff Configuration.

######################### Global config #########################

# The number of goroutines created to check data. The number of connections between upstream and downstream databases are slightly greater than this value.
check-thread-count = 4

# If enabled, SQL statements is exported to fix inconsistent tables.
export-fix-sql = true

# Only compares the table structure instead of the data.
check-struct-only = false

# The IP address of dm-master and the format is "http://127.0.0.1:8261".
dm-addr = "http://127.0.0.1:8261"

# Specifies the `task-name` of DM.
dm-task = "test"

######################### Task config #########################
[task]
    output-dir = "./output"

    # The tables of downstream databases to be compared. Each table needs to contain the schema name and the table name, separated by '.'
    target-check-tables = ["hb_test.*"]

この例は、dm-task = "test" で構成され、"test" タスクの下にある hb_test スキーマのすべてのテーブルをチェックします。アップストリーム データベースとダウンストリーム データベースの間でスキーマの定期的な一致を自動的に取得し、DM レプリケーション後のデータの整合性を検証します。

製品
TiDB Cloud
TiDB
価格
PoC お問い合わせ
エコシステム
TiKV
TiFlash
OSS Insight
© 2023 PingCAP. All Rights Reserved.