Doc Menu

Manage Upstream MySQL Instances

This document introduces how to manage upstream MySQL instances, including encrypting the MySQL password and managing data source configurations using dmctl.

Encrypt the database password

In DM configuration files, it is recommended to use the password encrypted with dmctl. For one original password, the encrypted password is different after each encryption.

./dmctl -encrypt 'abc!@#123'
MKxn0Qo3m3XOyjCnhEMtsUCm83EhGQDZ/T4=

Load the data source configurations

You can use the operate-source command to load the data source configurations to the DM cluster.

help operate-source
create/update/stop/show upstream MySQL/MariaDB source

Usage:
  dmctl operate-source <operate-type> [config-file ...] [--print-sample-config] [flags]

Flags:
  -h, --help                  help for operate-source
  -p, --print-sample-config   print sample config file of source

Global Flags:
  -s, --source strings   MySQL Source ID

Usage example

operate-source create ./source.yaml

For the configuration of source.yaml, refer to Upstream Database Configuration File Introduction.

Flags description

  • create: Creates one or more upstream database source(s). When creating multiple data sources fails, DM rolls back to the state where the command was not executed.

  • update: Updates an upstream database source.

  • stop: Stops one or more upstream database source(s). When stopping multiple data sources fails, some data sources might be stopped.

  • show: Shows the added data source and the corresponding DM-worker.

  • config-file: Specifies the file path of source.yaml and can pass multiple file paths.

  • --print-sample-config: Prints the sample configuration file. This parameter ignores other parameters.

Returned results

operate-source create ./source.yaml
{
    "result": true,
    "msg": "",
    "sources": [
        {
            "result": true,
            "msg": "",
            "source": "mysql-replica-01",
            "worker": "dm-worker-1"
        }
    ]
}