TiDB データ移行のアップストリーム データベースコンフィグレーションファイル
このドキュメントでは、構成ファイル テンプレートと、このファイル内の各構成パラメーターの説明を含む、アップストリーム データベースの構成ファイルを紹介します。
コンフィグレーションファイルのテンプレート
以下は、アップストリーム データベースの構成ファイル テンプレートです。
source-id: "mysql-replica-01"
# Whether to enable GTID.
enable-gtid: false
# Whether to enable relay log.
enable-relay: false # Since DM v2.0.2, this configuration item is deprecated. To enable the relay log feature, use the `start-relay` command instead.
relay-binlog-name: "" # The file name from which DM-worker starts to pull the binlog.
relay-binlog-gtid: "" # The GTID from which DM-worker starts to pull the binlog.
# relay-dir: "relay-dir" # The directory used to store relay log. The default value is "relay-dir". This configuration item is marked as deprecated since v6.1 and replaced by a parameter of the same name in the dm-worker configuration.
from:
host: "127.0.0.1"
port: 3306
user: "root"
password: "ZqMLjZ2j5khNelDEfDoUhkD5aV5fIJOe0fiog9w=" # The user password of the upstream database. It is recommended to use the password encrypted with dmctl.
security: # The TLS configuration of the upstream database
ssl-ca: "/path/to/ca.pem"
ssl-cert: "/path/to/cert.pem"
ssl-key: "/path/to/key.pem"
# purge:
# interval: 3600
# expires: 0
# remain-space: 15
# checker:
# check-enable: true
# backoff-rollback: 5m0s
# backoff-max: 5m0s # The maximum value of backoff, should be larger than 1s
# Configure binlog event filters. New in DM v2.0.2
# case-sensitive: false
# filters:
# - schema-pattern: dmctl
# table-pattern: t_1
# events: []
# sql-pattern:
# - alter table .* add column `aaa` int
# action: Ignore
ノート:
DM v2.0.1 では、
enable-gtidとenable-relay~true同時に設定しないでください。そうしないと、増分データが失われる可能性があります。
コンフィグレーションパラメータ
このセクションでは、構成ファイル内の各構成パラメーターについて説明します。
グローバル構成
リレー ログのクリーンアップ戦略の構成 ( purge )
通常、大量のリレー ログがあり、ディスク容量が不十分でない限り、これらのパラメータを手動で設定する必要はありません。
ノート:
自動データ消去戦略は、
intervalが 0 ではなく、2 つの構成アイテムexpiresとremain-spaceの少なくとも 1 つが 0 でない場合にのみ有効になります。
タスクステータスチェッカー構成 ( checker )
DM は、現在のタスクのステータスとエラー メッセージを定期的にチェックして、タスクを再開することでエラーが解消されるかどうかを判断します。必要に応じて、DM はタスクの再開を自動的に再試行します。 DM は、指数バックオフ戦略を使用してチェック間隔を調整します。その動作は、次の構成によって調整できます。
Binlogイベント フィルター
DM v2.0.2 以降では、ソース構成ファイルでbinlogイベント フィルターを構成できます。