Prerequisites
- You have purchased the Lindorm Tunnel Service (LTS) data migration and synchronization service. For more information, see Activate LTS.
- You have added the client IP addresses to the LTS whitelist. For more information, see Configure a whitelist.
HBase full data migration API reference
Create a task
- API (POST):
http://{BDSMaster}:12311/hbase/fulldata/create, where {BDSMaster} is the Master hostname of the instance. - Parameters:
- @FormParam(“src”) String srcName: The name of the source cluster.
- @FormParam(“dst”) String sinkName: The name of the destination cluster.
- @FormParam(“tableNames”) String tableNames: The tables to migrate. To migrate multiple tables, separate the table names with a comma.
- @FormParam(“bulkload”) boolean bulkload: Specifies whether to perform a bulk load.
- @FormParam(“createTable”) boolean createTable: Specifies whether to create the destination table.
- @FormParam(“extraAttrs”) String extraAttrs: The advanced configuration. This parameter is optional.
Example:curl -d "src=hbase1&dst=hbase2&tableNames=t1,t2,t3&bulkload=true&createTable=true" -H "Content-Type: application/x-www-form-urlencoded" -X POST http://{LTSMaster}:12311/hbase/fulldata/createReturn value:{ "success":"true", // Indicates whether the request is successful. "message":"workflow-36c61d1240f84ecfbb472751a29b6deb" // The task ID. }
View all tasks
API endpoint (GET): http://{BDSMaster}:12311/hbase/fulldata. Replace
{BDSMaster}with the Master hostname of the instance.Example:
curl http://{BDSMaster}:12311/hbase/fulldataResponse:{ "tunnels": [ // Lists all task information { "jobName": "workflow-779298e682a44d5f9c226cea0e6f4dfd", "tableNames": [ "t1" ], "dst": "*.*.*.*", "fullJobs": [ { "jobName": "fulldata-104f42d9bbf341099ae02c0b61a70f4c", "state": "SUCCEEDED", "table": "t1" } ], "bulkloadJobs": [ { "TaskName": "bulkload-73bf97f03f6140da91c3183e3d4fc1d8", "state": "SUCCEEDED" } ], "src": "*.*.*.*", "mergeTasks": [], "state": "SUCCEEDED", "inrcJobs": [], "schemeTasks": [ { "TaskName": "360338ff-abfb-4f78-9b73-580cc9fd48be", "state": "SKIPPED", "table": "t1" } ] }, { "jobName": "workflow-36c61d1240f84ecfbb472751a29b6deb", "tableNames": [ "t1", "t2" ], "dst": "*.*.*.*", "fullJobs": [ { "jobName": "fulldata-9014e168fccd433dbd56bcc61ba4ccbb", "state": "SUCCEEDED", "table": "t2" }, { "jobName": "fulldata-114cc535693344238572583268ae4c67", "state": "SUCCEEDED", "table": "t1" } ], "bulkloadJobs": [ { "TaskName": "bulkload-92402af7ef544f6182af892fe4b35c65", "state": "SUCCEEDED" }, { "TaskName": "bulkload-f7580e9ebf734c999656c1aaad41f67b", "state": "SUCCEEDED" } ], "src": "*.*.*.*", "mergeTasks": [], "state": "SUCCEEDED", "inrcJobs": [], "schemeTasks": [ { "TaskName": "b31b8f7c-9a74-4840-814a-6cd62d2b08c9", "state": "SKIPPED", "table": "t1" }, { "TaskName": "b1968a67-6684-4dd5-ba07-dbd7a52af24f", "state": "SKIPPED", "table": "t2" } ] } ], "success": "true", "message": "ok" }
View a task by ID
- GET API endpoint:
http://{BDSMaster}:12311/hbase/fulldata/{jobId}/detail. Replace {BDSMaster} with the hostname of the master instance.
- GET API endpoint:
Abort a job
- Endpoint (GET):
http://{BDSMaster}:12311/hbase/fulldata/{jobId}/abort. Replace {BDSMaster} with the hostname of the master instance.
- Endpoint (GET):
Delete a task
- API endpoint (GET):
http://{LTSMaster}:12311/hbase/fulldata/{jobId}/del. Replace {LTSMaster} with the hostname of the master node in your instance.Return value:{ "success": "true", "message": "ok" }
- API endpoint (GET):
Retry job
- API (GET):
http://{BDSMaster}:12311/hbase/fulldata/{jobId}/retry. Replace {BDSMaster} with the instance's master hostname.Return value:{ "success": "true", "message": "ok" }
- API (GET):
HBase incremental data synchronization API reference
Create a task
- API endpoint (POST):
http://{LTSMaster}:12311/hbase/incr/create. Replace {LTSMaster} with the hostname of the master node in your instance.Parameters:- @FormParam(“name”) String name: The name of the synchronization channel.
- @FormParam(“src”) String srcName: The name of the source cluster.
- @FormParam(“dst”) String sinkName: The name of the destination cluster.
- @FormParam(“tableNames”) String tableNames: The tables to migrate. To migrate multiple tables, separate the table names with a comma.
- @FormParam(“createTable”) boolean createTable: Specifies whether to create the destination table.
- @FormParam(“extraAttrs”) String extraAttrs: The advanced configuration.
curl -d "name=test1&src=hbase1&dst=hbase2&tableNames=t1,t2,t3&createTable=true" -H "Content-Type: application/x-www-form-urlencoded" -X POST http://{LTSMaster}:12311/hbase/incr/createReturn value:{ "success":"true", "message":"wal-08a087da488349969ff4a4b78efbceba" // The ID of the synchronization channel. }
- API endpoint (POST):
Update a job
API (POST):
http://{BDSMaster}:12311/hbase/incr/update. Replace {BDSMaster} with the hostname of the master instance.Parameters:- @FormParam("jobId") final String jobId: The ID of the job to update.
- @FormParam("tableNames") final String tableNames: The names of the tables to update. To specify multiple tables, separate the names with commas (,).
Example:curl -d "jobId=xxx&tableNames=t1,t2,t3" -H "Content-Type: application/x-www-form-urlencoded" -X POST http://{LTSMaster}:12311/hbase/incr/update
View all tasks
- API (GET):
http://{BDSMaster}:12311/hbase/incr. Replace {BDSMaster} with the Master hostname of the instance.Return value:{ "tunnels": [ { "jobId": "wal-2be4c2c89b7140a7b42c050916b3f5bb", "tableNames": [ "default:t1" ], "dst": "*.*.*.*", "offset": 1573560272951, "src": "*.*.*.*", "name": "wal-2be4c2c89b7140a7b42c050916b3f5bb", "syncDate": "2019-11-12 20:04:32", "state": "KILLED", "synctime": 1573560272951 }, { "jobId": "wal-08a087da488349969ff4a4b78efbceba", "tableNames": [ "default:t1", "default:t2", "default:t3" ], "dst": "*.*.*.*", "offset": 1573651478405, "src": "*.*.*.*", "name": "test1", "syncDate": "2019-11-13 21:31:46", "state": "RUNNING", "synctime": 1573651906518 } ], "success": "true", "message": "ok" }
- API (GET):
View a task by ID
- API (GET):
http://{BDSMaster}:12311/hbase/incr/{jobId}/detail, where {BDSMaster} is the instance's master hostname.
- API (GET):
Pause a task
- API endpoint (GET):
http://{LTSMaster}:12311/hbase/incr/{jobId}/abort. Replace {LTSMaster} with the hostname of the master node in your instance.Return value:{ "success": "true", "message": "ok" }
- API endpoint (GET):
Delete a task
- API endpoint (GET):
http://{LTSMaster}:12311/hbase/incr/{jobId}/del. Replace {LTSMaster} with the hostname of the master node in your instance.Return value:{ "success": "true", "message": "ok" }
- API endpoint (GET):
Retry a task
- API endpoint (GET):
http://{LTSMaster}:12311/hbase/incr/{jobId}/retry. Replace {LTSMaster} with the hostname of the master node in your instance.Return value:{ "success": "true", "message": "ok" }
- API endpoint (GET):
该文章对您有帮助吗?