Pause a Data Migration Task
You can use the pause-task command to pause a data migration task.
pause-task differs from stop-task in that:
pause-taskonly pauses a migration task. You can query the status information (retained in the memory) of the task usingquery-status.stop-taskterminates a migration task and removes all information related to this task from the memory. This means you cannot usequery-statusto query the status information.dm_metalike "checkpoint" and data that have been migrated to the downstream are not removed.- If
pause-taskis executed to pause the migration task, you cannot start a new task with the same name, neither can you get the relay log of the paused task removed, since this task does exist. Ifstop-taskis executed to stop a task, you can start a new task with the same name, and you can get the relay log of the stopped task removed, since this task no longer exists. pause-taskis usually used to pause a task for troubleshooting, whilestop-taskis to permanently remove a migration task, or to co-work withstart-taskto update the configuration information.
help pause-task
pause a specified running task
Usage:
dmctl pause-task [-s source ...] <task-name | task-file> [flags]
Flags:
-h, --help help for pause-task
Global Flags:
-s, --source strings MySQL Source ID
Usage example
pause-task [-s "mysql-replica-01"] task-name
Flags description
-s: (Optional) Specifies the MySQL source where you want to pause the subtasks of the migration task. If it is set, this command pauses only the subtasks on the specified MySQL source.task-name| task-file: (Required) Specifies the task name or task file path.
Returned results
pause-task test
{
"op": "Pause",
"result": true,
"msg": "",
"sources": [
{
"result": true,
"msg": "",
"source": "mysql-replica-01",
"worker": "worker1"
}
]
}