可以在AWS DMS任务设置中配置load-order和parallel-load参数,使得两者联合使用。
例如,以下代码设置了一个DMS任务,使用load-order和parallel-load:
{
"Type": "AWS::DMS::ReplicationTask",
"Properties": {
"MigrationType": "full-load-and-cdc",
"ReplicationInstanceArn": "arn:aws:dms:us-west-2:123456789012:rep:QVKV55HLW4F3R3UJ7W7YBCWYBI",
"ReplicationTaskIdentifier": "my-full-load-task",
"SourceEndpointArn": "arn:aws:dms:us-west-2:123456789012:endpoint:45IIOFJZ43H6QVDY4BBPT6UREE",
"TableMappings": "{\"TableMappings\":\"{\\\"rules\\\": []}\"}",
"TargetEndpointArn": "arn:aws:dms:us-west-2:123456789012:endpoint:7WVVV28RYZSQQZYUW7ENFTQJXI",
"FullLoadSettings": {
"TargetTablePrepMode": "DO_NOTHING",
"MaxFullLoadSubTasks": 4,
"TransactionConsistencyTimeout": 600,
"ParallelLoadThreads": 8,
"LoadOrder": [
"Customers",
"Orders",
"Payment",
"Shipment"
],
"ControlTablesSettings": {
"historyTimeslot": "30",
"controlSchema": "cdc",
"historyTableEnabled": "Y",
"intervalMillis": "5000",
"suspendedTablesTableEnabled": "Y",
"statusTableEnabled": "Y"
},
"Logging": {
"EnableLogging": false
}
}
}
}
在FullLoadSettings中,load-order指定了在全量加载过程中表格的加载顺序,而parallel-load指定了在每个子任务中同时加载的线程数。通过同时使用这两个参数,可以最大化DMS任务的效率。