dm同步策略更新
/data/dm-v1.0.6/bin/dmctl --master-addr 192.168.0.3:8261
pause-task dmtaskjustme
query-status dmtaskjustme
vi task_justme.yaml
update-task task_justme.yaml
query-status dmtaskjustme
resume-task dmtaskjustme
query-status dmtaskjustme
» pause-task dmtaskjustme
{
"op": "Pause",
"result": true,
"msg": "",
"workers": [
{
"meta": {
"result": true,
"worker": "192.168.0.3:8262",
"msg": ""
},
"op": "Pause",
"logID": "71"
}
]
}
»
» query-status dmtaskjustme
{
"result": true,
"msg": "",
"workers": [
{
"result": true,
"worker": "192.168.0.3:8262",
"msg": "",
"subTaskStatus": [
{
"name": "dmtaskjustme",
"stage": "Paused",
"unit": "Sync",
"result": null,
"unresolvedDDLLockID": "",
"sync": {
"totalEvents": "1828",
"totalTps": "0",
"recentTps": "0",
"masterBinlog": "(mysql-bin.000007, 539104435)",
"masterBinlogGtid": "7038f66f-e1ec-11ea-8025-fa163ecdce25:1-2959712",
"syncerBinlog": "(mysql-bin|000001.000007, 539103442)",
"syncerBinlogGtid": "",
"blockingDDLs": [
],
"unresolvedGroups": [
],
"synced": false
}
}
],
"relayStatus": {
"masterBinlog": "(mysql-bin.000007, 539104435)",
"masterBinlogGtid": "7038f66f-e1ec-11ea-8025-fa163ecdce25:1-2959712",
"relaySubDir": "7038f66f-e1ec-11ea-8025-fa163ecdce25.000001",
"relayBinlog": "(mysql-bin.000007, 539104435)",
"relayBinlogGtid": "",
"relayCatchUpMaster": true,
"stage": "Running",
"result": null
},
"sourceID": "mysql-replica-02"
}
]
}
»
» exit
[tidb@db-tidb conf]$
[tidb@db-tidb conf]$ ls
dm-master.toml dm-worker.toml task1.yaml task_advanced.yaml task_justme2.yaml task_justme.yaml.20200819 task.yaml.bak
dm-master.toml.bak dm-worker.toml.bak task2.yaml task_basic.yaml.bak task_justme.yaml task.yaml
[tidb@db-tidb conf]$
[tidb@db-tidb conf]$ ls -rlth
total 56K
-rw-r----- 1 tidb tidb 602 Sep 8 15:07 task.yaml.bak
-rw-r----- 1 tidb tidb 759 Sep 8 15:07 task.yaml
-rw-r----- 1 tidb tidb 1.1K Sep 8 15:07 task_justme.yaml
-rw-r----- 1 tidb tidb 480 Sep 8 15:07 task_justme2.yaml
-rw-r----- 1 tidb tidb 882 Sep 8 15:07 dm-worker.toml.bak
-rw-r----- 1 tidb tidb 1.1K Sep 8 15:07 dm-master.toml.bak
-rw-r----- 1 tidb tidb 307 Sep 8 15:07 dm-master.toml
-rw-r----- 1 tidb tidb 1.1K Sep 8 15:07 task_justme.yaml.20200819
-rw-r----- 1 tidb tidb 1.4K Sep 8 15:07 task_basic.yaml.bak
-rw-r----- 1 tidb tidb 6.0K Sep 8 15:07 task_advanced.yaml
-rw-r----- 1 tidb tidb 470 Sep 8 15:07 task2.yaml
-rw-r----- 1 tidb tidb 1.7K Sep 8 15:07 task1.yaml
-rw-r----- 1 tidb tidb 304 Sep 8 15:07 dm-worker.toml
[tidb@db-tidb conf]$
[tidb@db-tidb conf]$ vi task_justme.yaml
name: dmtaskjustme
task-mode: all
enable-heartbeat: true
ignore-checking-items: ["auto_increment_ID"]
target-database:
host: "192.168.0.3"
port: 4000
user: "root"
password: "xL4Dvy8DCKMIZrM28k"
mysql-instances:
- source-id: "mysql-replica-02"
black-white-list: "bw-rule-1"
mydumper-thread: 4
loader-thread: 16
syncer-thread: 16
black-white-list:
bw-rule-1:
do-dbs: ["mmststdb"]
do-tables:
- db-name: "mmststdb"
tbl-name: "mms"
- db-name: "mmststdb"
tbl-name: "mms_gw"
- db-name: "mmststdb"
tbl-name: "gw"
- db-name: "mmststdb"
tbl-name: "task"
- db-name: "mmststdb"
tbl-name: "product"
- db-name: "mmststdb"
tbl-name: "product_as_gw"
- db-name: "mmststdb"
tbl-name: "product_as_bboss"
- db-name: "mmststdb"
tbl-name: "ec"
- db-name: "mmststdb"
tbl-name: "ec_as_bboss"
- db-name: "mmststdb"
tbl-name: "ec_as_ed"
- db-name: "mmststdb"
tbl-name: "city_as_bboss"
- db-name: "mmststdb"
tbl-name: "test1"
ignore-tables:
- db-name: "mmststdb"
tbl-name: "ug_mobile"
"task_justme.yaml" 49L, 1131C written
[tidb@db-tidb conf]$
[tidb@db-tidb conf]$ /data/dm-v1.0.6/bin/dmctl --master-addr 192.168.0.3:8261
Welcome to dmctl
Release Version: v1.0.6
Git Commit Hash: eaf2683c05ab44143bfb286bfbbc3ba157c555cc
Git Branch: release-1.0
UTC Build Time: 2020-06-17 10:22:01
Go Version: go version go1.13 linux/amd64
» update-task task_justme.yaml
{
"result": true,
"msg": "",
"workers": [
{
"result": true,
"worker": "192.168.0.3:8262",
"msg": ""
}
]
}
» query-status dmtaskjustme
{
"result": true,
"msg": "",
"workers": [
{
"result": true,
"worker": "192.168.0.3:8262",
"msg": "",
"subTaskStatus": [
{
"name": "dmtaskjustme",
"stage": "Paused",
"unit": "Sync",
"result": null,
"unresolvedDDLLockID": "",
"sync": {
"totalEvents": "1828",
"totalTps": "0",
"recentTps": "0",
"masterBinlog": "(mysql-bin.000007, 539140487)",
"masterBinlogGtid": "7038f66f-e1ec-11ea-8025-fa163ecdce25:1-2959820",
"syncerBinlog": "(mysql-bin|000001.000007, 539103442)",
"syncerBinlogGtid": "",
"blockingDDLs": [
],
"unresolvedGroups": [
],
"synced": false
}
}
],
"relayStatus": {
"masterBinlog": "(mysql-bin.000007, 539140487)",
"masterBinlogGtid": "7038f66f-e1ec-11ea-8025-fa163ecdce25:1-2959820",
"relaySubDir": "7038f66f-e1ec-11ea-8025-fa163ecdce25.000001",
"relayBinlog": "(mysql-bin.000007, 539140487)",
"relayBinlogGtid": "",
"relayCatchUpMaster": true,
"stage": "Running",
"result": null
},
"sourceID": "mysql-replica-02"
}
]
}
»
» resume-task dmtaskjustme
{
"op": "Resume",
"result": true,
"msg": "",
"workers": [
{
"meta": {
"result": true,
"worker": "192.168.0.3:8262",
"msg": ""
},
"op": "Resume",
"logID": "73"
}
]
}
»
» query-status dmtaskjustme
{
"result": true,
"msg": "",
"workers": [
{
"result": true,
"worker": "192.168.0.3:8262",
"msg": "",
"subTaskStatus": [
{
"name": "dmtaskjustme",
"stage": "Running",
"unit": "Sync",
"result": null,
"unresolvedDDLLockID": "",
"sync": {
"totalEvents": "1829",
"totalTps": "0",
"recentTps": "0",
"masterBinlog": "(mysql-bin.000007, 539143466)",
"masterBinlogGtid": "7038f66f-e1ec-11ea-8025-fa163ecdce25:1-2959829",
"syncerBinlog": "(mysql-bin|000001.000007, 539103442)",
"syncerBinlogGtid": "",
"blockingDDLs": [
],
"unresolvedGroups": [
],
"synced": false
}
}
],
"relayStatus": {
"masterBinlog": "(mysql-bin.000007, 539143466)",
"masterBinlogGtid": "7038f66f-e1ec-11ea-8025-fa163ecdce25:1-2959829",
"relaySubDir": "7038f66f-e1ec-11ea-8025-fa163ecdce25.000001",
"relayBinlog": "(mysql-bin.000007, 539143466)",
"relayBinlogGtid": "",
"relayCatchUpMaster": true,
"stage": "Running",
"result": null
},
"sourceID": "mysql-replica-02"
}
]
}
»
/data/dm-v1.0.6/bin/dmctl --master-addr 192.168.0.3:8261
pause-task dmtaskjustme
query-status dmtaskjustme
vi task_justme.yaml
update-task task_justme.yaml
query-status dmtaskjustme
resume-task dmtaskjustme
query-status dmtaskjustme
» pause-task dmtaskjustme
{
"op": "Pause",
"result": true,
"msg": "",
"workers": [
{
"meta": {
"result": true,
"worker": "192.168.0.3:8262",
"msg": ""
},
"op": "Pause",
"logID": "71"
}
]
}
»
» query-status dmtaskjustme
{
"result": true,
"msg": "",
"workers": [
{
"result": true,
"worker": "192.168.0.3:8262",
"msg": "",
"subTaskStatus": [
{
"name": "dmtaskjustme",
"stage": "Paused",
"unit": "Sync",
"result": null,
"unresolvedDDLLockID": "",
"sync": {
"totalEvents": "1828",
"totalTps": "0",
"recentTps": "0",
"masterBinlog": "(mysql-bin.000007, 539104435)",
"masterBinlogGtid": "7038f66f-e1ec-11ea-8025-fa163ecdce25:1-2959712",
"syncerBinlog": "(mysql-bin|000001.000007, 539103442)",
"syncerBinlogGtid": "",
"blockingDDLs": [
],
"unresolvedGroups": [
],
"synced": false
}
}
],
"relayStatus": {
"masterBinlog": "(mysql-bin.000007, 539104435)",
"masterBinlogGtid": "7038f66f-e1ec-11ea-8025-fa163ecdce25:1-2959712",
"relaySubDir": "7038f66f-e1ec-11ea-8025-fa163ecdce25.000001",
"relayBinlog": "(mysql-bin.000007, 539104435)",
"relayBinlogGtid": "",
"relayCatchUpMaster": true,
"stage": "Running",
"result": null
},
"sourceID": "mysql-replica-02"
}
]
}
»
» exit
[tidb@db-tidb conf]$
[tidb@db-tidb conf]$ ls
dm-master.toml dm-worker.toml task1.yaml task_advanced.yaml task_justme2.yaml task_justme.yaml.20200819 task.yaml.bak
dm-master.toml.bak dm-worker.toml.bak task2.yaml task_basic.yaml.bak task_justme.yaml task.yaml
[tidb@db-tidb conf]$
[tidb@db-tidb conf]$ ls -rlth
total 56K
-rw-r----- 1 tidb tidb 602 Sep 8 15:07 task.yaml.bak
-rw-r----- 1 tidb tidb 759 Sep 8 15:07 task.yaml
-rw-r----- 1 tidb tidb 1.1K Sep 8 15:07 task_justme.yaml
-rw-r----- 1 tidb tidb 480 Sep 8 15:07 task_justme2.yaml
-rw-r----- 1 tidb tidb 882 Sep 8 15:07 dm-worker.toml.bak
-rw-r----- 1 tidb tidb 1.1K Sep 8 15:07 dm-master.toml.bak
-rw-r----- 1 tidb tidb 307 Sep 8 15:07 dm-master.toml
-rw-r----- 1 tidb tidb 1.1K Sep 8 15:07 task_justme.yaml.20200819
-rw-r----- 1 tidb tidb 1.4K Sep 8 15:07 task_basic.yaml.bak
-rw-r----- 1 tidb tidb 6.0K Sep 8 15:07 task_advanced.yaml
-rw-r----- 1 tidb tidb 470 Sep 8 15:07 task2.yaml
-rw-r----- 1 tidb tidb 1.7K Sep 8 15:07 task1.yaml
-rw-r----- 1 tidb tidb 304 Sep 8 15:07 dm-worker.toml
[tidb@db-tidb conf]$
[tidb@db-tidb conf]$ vi task_justme.yaml
name: dmtaskjustme
task-mode: all
enable-heartbeat: true
ignore-checking-items: ["auto_increment_ID"]
target-database:
host: "192.168.0.3"
port: 4000
user: "root"
password: "xL4Dvy8DCKMIZrM28k"
mysql-instances:
- source-id: "mysql-replica-02"
black-white-list: "bw-rule-1"
mydumper-thread: 4
loader-thread: 16
syncer-thread: 16
black-white-list:
bw-rule-1:
do-dbs: ["mmststdb"]
do-tables:
- db-name: "mmststdb"
tbl-name: "mms"
- db-name: "mmststdb"
tbl-name: "mms_gw"
- db-name: "mmststdb"
tbl-name: "gw"
- db-name: "mmststdb"
tbl-name: "task"
- db-name: "mmststdb"
tbl-name: "product"
- db-name: "mmststdb"
tbl-name: "product_as_gw"
- db-name: "mmststdb"
tbl-name: "product_as_bboss"
- db-name: "mmststdb"
tbl-name: "ec"
- db-name: "mmststdb"
tbl-name: "ec_as_bboss"
- db-name: "mmststdb"
tbl-name: "ec_as_ed"
- db-name: "mmststdb"
tbl-name: "city_as_bboss"
- db-name: "mmststdb"
tbl-name: "test1"
ignore-tables:
- db-name: "mmststdb"
tbl-name: "ug_mobile"
"task_justme.yaml" 49L, 1131C written
[tidb@db-tidb conf]$
[tidb@db-tidb conf]$ /data/dm-v1.0.6/bin/dmctl --master-addr 192.168.0.3:8261
Welcome to dmctl
Release Version: v1.0.6
Git Commit Hash: eaf2683c05ab44143bfb286bfbbc3ba157c555cc
Git Branch: release-1.0
UTC Build Time: 2020-06-17 10:22:01
Go Version: go version go1.13 linux/amd64
» update-task task_justme.yaml
{
"result": true,
"msg": "",
"workers": [
{
"result": true,
"worker": "192.168.0.3:8262",
"msg": ""
}
]
}
» query-status dmtaskjustme
{
"result": true,
"msg": "",
"workers": [
{
"result": true,
"worker": "192.168.0.3:8262",
"msg": "",
"subTaskStatus": [
{
"name": "dmtaskjustme",
"stage": "Paused",
"unit": "Sync",
"result": null,
"unresolvedDDLLockID": "",
"sync": {
"totalEvents": "1828",
"totalTps": "0",
"recentTps": "0",
"masterBinlog": "(mysql-bin.000007, 539140487)",
"masterBinlogGtid": "7038f66f-e1ec-11ea-8025-fa163ecdce25:1-2959820",
"syncerBinlog": "(mysql-bin|000001.000007, 539103442)",
"syncerBinlogGtid": "",
"blockingDDLs": [
],
"unresolvedGroups": [
],
"synced": false
}
}
],
"relayStatus": {
"masterBinlog": "(mysql-bin.000007, 539140487)",
"masterBinlogGtid": "7038f66f-e1ec-11ea-8025-fa163ecdce25:1-2959820",
"relaySubDir": "7038f66f-e1ec-11ea-8025-fa163ecdce25.000001",
"relayBinlog": "(mysql-bin.000007, 539140487)",
"relayBinlogGtid": "",
"relayCatchUpMaster": true,
"stage": "Running",
"result": null
},
"sourceID": "mysql-replica-02"
}
]
}
»
» resume-task dmtaskjustme
{
"op": "Resume",
"result": true,
"msg": "",
"workers": [
{
"meta": {
"result": true,
"worker": "192.168.0.3:8262",
"msg": ""
},
"op": "Resume",
"logID": "73"
}
]
}
»
» query-status dmtaskjustme
{
"result": true,
"msg": "",
"workers": [
{
"result": true,
"worker": "192.168.0.3:8262",
"msg": "",
"subTaskStatus": [
{
"name": "dmtaskjustme",
"stage": "Running",
"unit": "Sync",
"result": null,
"unresolvedDDLLockID": "",
"sync": {
"totalEvents": "1829",
"totalTps": "0",
"recentTps": "0",
"masterBinlog": "(mysql-bin.000007, 539143466)",
"masterBinlogGtid": "7038f66f-e1ec-11ea-8025-fa163ecdce25:1-2959829",
"syncerBinlog": "(mysql-bin|000001.000007, 539103442)",
"syncerBinlogGtid": "",
"blockingDDLs": [
],
"unresolvedGroups": [
],
"synced": false
}
}
],
"relayStatus": {
"masterBinlog": "(mysql-bin.000007, 539143466)",
"masterBinlogGtid": "7038f66f-e1ec-11ea-8025-fa163ecdce25:1-2959829",
"relaySubDir": "7038f66f-e1ec-11ea-8025-fa163ecdce25.000001",
"relayBinlog": "(mysql-bin.000007, 539143466)",
"relayBinlogGtid": "",
"relayCatchUpMaster": true,
"stage": "Running",
"result": null
},
"sourceID": "mysql-replica-02"
}
]
}
»