Upstream Database Configuration File of TiDB Data Migration
This document introduces the configuration file of the upstream database, including a configuration file template and the description of each configuration parameter in this file.
Configuration file template
The following is a configuration file template of the upstream database:
source-id: "mysql-replica-01"
# Whether to enable GTID.
enable-gtid: false
# Whether to enable relay log.
enable-relay: false
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
Configuration parameters
This section describes each configuration parameter in the configuration file.
Global configuration
Relay log cleanup strategy configuration (purge)
Generally, there is no need to manually configure these parameters unless there is a large amount of relay logs and disk capacity is insufficient.
Task status checker configuration (checker)
DM periodically checks the current task status and error message to determine if resuming the task will eliminate the error. If needed, DM automatically retries to resume the task. DM adjusts the checking interval using the exponential backoff strategy. Its behaviors can be adjusted by the following configuration.
Binlog event filter
Starting from DM v2.0.2, you can configure binlog event filters in the source configuration file.