DM-worker Configuration File

This document introduces the basic configuration of DM worker, which provisions DM-worker's deployment in most scenarios. Refer to DM-worker Advanced Configuration File to see more parameters in detail.

Configuration file template

# Worker Configuration.

# Log configuration.
log-file = "dm-worker.log"

# DM-worker listen address.
worker-addr = ":8262"

# Represents a MySQL/MariaDB instance or a migration group.
source-id = "mysql-replica-01"

# Server ID of secondary library for binlog replication.
# Each instance (primary and secondary) in migration groups should have a different server ID.
server-id = 101

# flavor: mysql/mariadb
flavor = "mysql"

# The directory that used to store relay log.
relay-dir = "./relay_log"

[from]
host = "127.0.0.1"
user = "root"
password = "Up8156jArvIPymkVC+5LxkAT6rek"
port = 3306

Configuration parameters

Global

ParameterDescriptionDefault value
log-fileSpecifies the log file directory. If not specified, the logs are printed onto the standard output.
worker-addrSpecifies the address of DM-worker which provides services. You can omit the IP address and specify the port number only, such as ":8262".
source-idUniquely identifies a MySQL or MariaDB instance, or a replication group
server-idIdentifies the server ID of DM-worker as a MySQL or MariaDB secondary library, used when pulling binlogs from the upstream. In a replication group, each instance (primary and secondary included) must have a unique server ID. In v1.0.2 and later versions, the server_id is automatically generated by DM.
flavorIndicates the release type of MySQL: "Percona", "mysql" or "mariadb". In v1.0.2 and later versions, DM automatically detects and fills in the release type."mysql"
relay-dirSpecifies the relay log directory."./relay_log"

[from]

The [from] section contains parameters that affect the connection to the upstream database.

ParameterDescription
hostThe host name of the upstream database.
portThe port number of the upstream database.
userThe username used to connect to the database.
passwordThe password used to connect to the database. Note: Use the password encrypted by dmctl.