Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: DM备份启动报错
TiDB 5.4.0
When starting the DM backup, the following error is reported:
“msg”: “[code=20003:class=dm-master:scope=internal:level=medium], Message: decode task config failed, RawCause: yaml: unmarshal errors:
line 37: field import-mode not found in type config.rawLoaderConfig
line 38: field on-duplicate not found in type config.rawLoaderConfig, Workaround: Please check the configuration file has correct YAML format.”
The configuration file has the following additional configuration:
loaders:
global:
import-mode: “sql”
on-duplicate: “ignore”
The entire YAML configuration file is as follows:
name: “ailearn_statistic-kaifa”
task-mode: “all”
shard-mode: “pessimistic”
meta-schema: “dm_meta” # A schema will be created in the downstream database to store metadata
ignore-checking-items: [“auto_increment_ID”] # In this example, there is an auto-increment primary key upstream, so it needs to be ignored
target-database:
host: “10.60.0.9”
port: 4000
user: “dm_worker”
password: “FslwxcUfxXBLFd1NV8yr5EBupFdiZEl2BTkx0g==”
mysql-instances:
- source-id: “mysql-ailearn-kaifa” # Data source ID, which is the source-id in source1.yaml
route-rules: [“sale-route-rule”] # Table route rules applied to this data source
block-allow-list: “log-bak-ignored” # Block & Allow list applied to this data source
loader-config-name: “global” # Name of the loaders configuration
Shard merge configuration
routes:
sale-route-rule:
schema-pattern: “ailearn_statistic”
table-pattern: “okminicourse_learn_record_*”
target-schema: “ailearn_statistic”
target-table: “okminicourse_learn_record”
Block and allow list
block-allow-list:
log-bak-ignored:
do-tables:
- db-name: “ailearn_statistic”
tbl-name: “okminicourse_learn_record_*”
loaders:
global:
import-mode: “sql”
on-duplicate: “ignore”