最近更新时间:2024-05-08 15:03:19
在正式迁移数据库之前,对源实例和目标实例进行预检查,以便在迁移正式开始前发现可能存在的配置类错误。
注意:目前仅支持在VPC机房创建预检查任务。
POST
英文名称 | 中文名称 | 类型 | 是否必须 | 备注 |
---|---|---|---|---|
Action | 调用接口名称 | String | 是 | 固定值:CreatePrecheck |
Version | API版本号 | String | 是 | 固定值:2018-01-08 |
POST 参数 参数格式:JSON
英文名称 | 中文名称 | 类型 | 是否必须 | 备注 |
---|---|---|---|---|
SourceType | 源端库类型 | String | 是 | 云数据库
自建数据库
|
TargetType | 目标端库类型 | String | 是 | 与源端类似 |
TargetRegion | 目标端可用区 | String | 是 | - |
SourceRegion | 源端可用区 | String | 是 | - |
DbSchema | 需要同步的源数据库结构 | json字符串 | 是 | 例如:"{\"is_full\":true}"表示为全部同步 |
SubTasks | dts子任务 | String | 是 | Mysql支持:SchemaMigration,BackupRecovery,RunReplication 双向同步支持:BackupRecovery,ForwardRunReplication,ReverseRunReplication Redis支持:FullSync mongo支持:MgoBackupRecovery,MgoRunReplication 数据订阅:Subscription |
SourceInstanceId | 源端实例id | String | 是 | - |
TargetInstanceId | 目标端实例id | String | 是 | - |
SourceUsername | 源端数据库连接账号 | String | 是 | - |
SourcePassword | 源端数据库连接密码 | String | 是 | - |
Type | dts任务类型 | String | 是 | 范围: Synchronous数据同步 Transmission数据迁移 Subscription数据订阅 Bisynchronous双向同步 |
DTSParameter | 需要迁移的参数信息 | 否 | 详见下表DTSParameter。 | |
SourceUser | 需要迁移的账号信息 | 否 | 详见下表SourceUser。 |
英文名称 | 中文名称 | 类型 | 备注 |
---|---|---|---|
PrecheckId | 预检查ID | String | - |
http://dts.{{region}}.api.ksyun.com/api?Action=CreatePrecheck&Version=2018-01-08
{
"SourceType": "Krds",
"TargetType": "Krds",
"TargetRegion": "cn-beijing-6",
"region": "cn-beijing-6",
"DbSchema": "{\"is_full\":true}",
"SubTasks": "BackupRecovery,RunReplication",
"SourceRegion": "cn-beijing-6",
"SourceInstanceId": "******",
"TargetInstanceId": "******",
"SourceUsername": "admin",
"SourceUser": [
{
"Username":"testuser",
"SourceHost":"%"
}
],
"DTSParameter": [
{
"DBParameter": "log_bin_trust_function_creators",
"TargetDBParameterValue": "OFF"
},
{
"DBParameter": "binlog_format",
"TargetDBParameterValue": "ROW"
}
],
"SourcePassword": "******",
"Type": "Transmission"
}
{
"Data": {
"PrecheckId": "******"//预检查id
},
"RequestId": "16aa33cb-d215-4a59-8769-6197374e9255"
}
查看预检查结果。
GET
英文名称 | 中文名称 | 类型 | 是否必填 | 备注 |
---|---|---|---|---|
Action | 调用接口名称 | String | 是 | 取固定值:DescribePrecheck |
Version | API版本号 | String | 是 | 取固定值:2018-01-08 |
PrecheckId | 预检查ID | String | 是 | - |
英文名称 | 中文名称 | 类型 | 备注 |
---|---|---|---|
Id | 预检查子ID | String | - |
PrecheckId | 预检查ID | String | - |
Name | 预检查子项名称 | String | - |
Status | 预检查状态 | String | PASSED: 检查通过 FAILED: 检查失败 ERROR: 检查错误 CHECKING: 检查中 |
Data | 附加信息 | String | 一般为检查失败的原因 |
http://dts.cn-shanghai-2.api.ksyun.com/?Action=DescribePrecheck&Version=2018-01-08&PrecheckId=bcd408c7-c6ea-4c18-8977-e6dfa0046f68
{
"Data": {
"Progress": 100,
"SubPrecheck": [
{
"Id": "6c2f43ff-5e2f-4a97-9296-291482bda45c",
"PrecheckId": "bcd408c7-c6ea-4c18-8977-e6dfa0046f68",
"Name": "srcconn",
"Status": "PASSED"
},
{
"Id": "faf070a8-2847-403a-8d21-f7033ccdd492",
"PrecheckId": "bcd408c7-c6ea-4c18-8977-e6dfa0046f68",
"Name": "dstconn",
"Status": "PASSED"
},
{
"Id": "0a0f73b0-6f53-4cdc-a860-458299b53eec",
"PrecheckId": "bcd408c7-c6ea-4c18-8977-e6dfa0046f68",
"Name": "version",
"Status": "PASSED"
},
{
"Id": "a1b00e23-4019-4c51-900e-488181074f9b",
"PrecheckId": "bcd408c7-c6ea-4c18-8977-e6dfa0046f68",
"Name": "serverid",
"Status": "PASSED"
},
{
"Id": "34fda4b5-41d6-4fe5-8eae-2a8344421429",
"PrecheckId": "bcd408c7-c6ea-4c18-8977-e6dfa0046f68",
"Name": "binlogon",
"Status": "PASSED"
},
{
"Id": "02ab815a-b4fc-466e-9290-ef3441ce8b31",
"PrecheckId": "bcd408c7-c6ea-4c18-8977-e6dfa0046f68",
"Name": "logmode",
"Status": "PASSED"
},
{
"Id": "47ea07f7-db87-4d0f-8580-6de44acd1b12",
"PrecheckId": "bcd408c7-c6ea-4c18-8977-e6dfa0046f68",
"Name": "passwdmode",
"Status": "PASSED"
},
{
"Id": "4696ae4c-8490-4682-9cb3-ae3ceaf8bf6b",
"PrecheckId": "bcd408c7-c6ea-4c18-8977-e6dfa0046f68",
"Name": "srcauth",
"Status": "WARNING",
"Data": {
"privlist": "Super_priv"
}
},
{
"Id": "bed45684-c246-4df9-b38c-18f22f694ad8",
"PrecheckId": "bcd408c7-c6ea-4c18-8977-e6dfa0046f68",
"Name": "dstauth",
"Status": "PASSED"
},
{
"Id": "dcf076c6-4b04-4966-ae80-69d2291b1962",
"PrecheckId": "bcd408c7-c6ea-4c18-8977-e6dfa0046f68",
"Name": "srcdup",
"Status": "PASSED"
},
{
"Id": "96c07f21-6444-4543-9238-c061ff236c4b",
"PrecheckId": "bcd408c7-c6ea-4c18-8977-e6dfa0046f68",
"Name": "dstdup",
"Status": "PASSED"
},
{
"Id": "53ea03ec-34bd-48da-959d-4ae066bb53a9",
"PrecheckId": "bcd408c7-c6ea-4c18-8977-e6dfa0046f68",
"Name": "restriction",
"Status": "PASSED"
},
{
"Id": "ca010f8d-ae93-4edd-a4b2-26655b314b4c",
"PrecheckId": "bcd408c7-c6ea-4c18-8977-e6dfa0046f68",
"Name": "engine",
"Status": "PASSED"
},
{
"Id": "ee1d0a14-e98f-4c8d-aaca-dea8a62c6e1f",
"PrecheckId": "bcd408c7-c6ea-4c18-8977-e6dfa0046f68",
"Name": "maxconn",
"Status": "PASSED"
}
]
},
"RequestId": "d655492c-b01f-4d54-b4ff-97c9fd05ae29"
}
纯净模式