github.com/pingcap/tiflow@v0.0.0-20240520035814-5bf52d54e205/dm/config/subtask.toml (about)

     1  # Base Configuration.
     2  
     3  # sub task name as identifier, should be unique
     4  name = "sub-task-name"
     5  
     6  # sub task mode, can be `all`, `full`, `increment`
     7  mode = "all"
     8  
     9  # used for binlog replication 
    10  server-id = 101
    11  source-id = "mysql-replica-01"
    12  
    13  # which flavor mysql/mariadb
    14  flavor = "mysql"
    15  
    16  # meta schema in downstreaming database to store meta informaton of dm
    17  meta-schema = "dm_meta"
    18  # whether to disable heartbeat for calculating lag between master and syncer
    19  enable-heartbeat = false
    20  
    21  # replicate from relay log or remote binlog
    22  binlog-type = "local"
    23  
    24  # Mydumper configuration
    25  
    26  # -t, --threads
    27  #threads = 16
    28  
    29  # -F, --chunk-filesize
    30  #chunk-filesize = 64
    31  
    32  # --skip-tz-utc
    33  #skip-tz-utc = true
    34  
    35  # other extra args
    36  #extra-args = "-B test -T t1,t2 --no-locks"
    37  
    38  
    39  # Loader configuration
    40  
    41  # Number of threads restoring concurrently for loader worker pool. Each worker restore one file at a time, increase this as TiKV nodes increase
    42  pool-size = 16
    43  
    44  # Directory of the dump to import
    45  dir = "./dumped_data"
    46  
    47  
    48  # Syncer configuration
    49  
    50  # different sub task should have different meta
    51  meta-file = "./syncer.subTaskA.meta"
    52  
    53  worker-count = 16
    54  batch = 1000
    55  
    56  # filter
    57  
    58  # block allow list provides a library to filter replicate on schema/table by given rules
    59  # support regular expression , start with '~' declare use regular expression.
    60  # rules like replication rules in MySQL, ref document:
    61  # https://dev.mysql.com/doc/refman/8.0/en/replication-rules-db-options.html
    62  # https://dev.mysql.com/doc/refman/8.0/en/replication-rules-table-options.html
    63  #[block-allow-list]
    64  #do-dbs = ["~^b.*","s1"]
    65  #
    66  #ignore-dbs = ["~^b.*","s1"]
    67  #
    68  #[[block-allow-list.do-tables]]
    69  #db-name = "your db"
    70  #tbl-name = "your table"
    71  #
    72  #[[block-allow-list.ignore-tables]]
    73  #db-name = "~^b.*"
    74  #tbl-name = "~^a.*"
    75  
    76  
    77  # filter-rules filter binlog events
    78  #[[filter-rules]]
    79  #schema-pattern = "shard_db_*"
    80  #table-pattern  = "shard_table_*"
    81  # do all dml, ignore all ddl
    82  #events = ["all dml"]
    83  #action = "Do"
    84  
    85  #[[filter-rules]]
    86  #schema-pattern = "shard_db_*"
    87  #table-pattern  = "shard_table_*"
    88  # ignore delete sqls and drop table ddls
    89  #events = ["delete", "drop table"]
    90  # regular expression, ignore drop procedure queries
    91  # sql-pattern = ["^DROP\\s+PROCEDURE"]
    92  #action = "Ignore"
    93  
    94  
    95  # route table
    96  
    97  # applied after filter
    98  # our Selector is a two level selector (schemal level, and table level)
    99  # [[route-rules]]
   100  # schema-pattern = "shard_db_*"
   101  # target-schema = "shard_db"
   102  # [[route-rules]]
   103  # schema-pattern = "shard_db_*"
   104  # table-pattern = "shard_table_*"
   105  # target-schema = "shard_db"
   106  # target-table = "shard_table"
   107  
   108  # to: the target db
   109  # from: the source db, not in this file, auto get it from worker's config
   110  [to]
   111  host = "127.0.0.1"
   112  user = "root"
   113  password = ""
   114  port = 4000