機能の概要
このAPIは、OceanBaseクラスタを引き継ぐために使用します。OceanBaseクラスタを引き継ぐ前に、OceanBaseクラスタの引き継ぎに関する事前チェックを参照して、クラスタの事前チェックを実行してください。
呼び出しの説明
インターフェース制約
呼び出し元は、OceanBaseクラスタを引き継ぐ権限を持っている必要があります。
呼び出し元の権限については、詳細はユーザーと権限の概要を参照してください。
呼び出し元は、OCPアプリケーションサービスの認証を通過する必要があります。
リクエストパス
POST /api/v2/ob/clusters/takeOver
リクエストパラメータ
Bodyパラメータ:
パラメータ |
型 |
必須 |
サンプル値 |
説明 |
|---|---|---|---|---|
| rootSysPassword | String | はい | ****** | root@sysのパスワード。 |
| address | String | はい | xxx.xxx.xxx.xxx | クラスタの接続アドレス。 |
| port | Integer | はい | 2883 | クラスタの接続ポート。 |
| saveToCredential | Boolean | いいえ | true | パスワードボックスに保存するかどうか。デフォルトはtrue。 |
| connectionMode | String | いいえ | direct | 接続モード。directまたはproxyを指定できます。デフォルトはdirectです。 |
| clusterName | String | いいえ | ob01 | 接続モードがproxyの場合は必須です。 |
| obClusterId | Integer | いいえ | 1001 | 接続モードがproxyで、かつ引き継ぐクラスタがスタンバイクラスタの場合は必須です。 |
| switchConfigUrl | Boolean | いいえ | true | ターゲットクラスタのConfig URLを本OCPに切り替えるかどうか。デフォルトはtrueです。 |
| hostInfo | Object | いいえ | - | クラスタ内のすべてのホストが事前にOCPに引き継がれている場合は、この項目を指定する必要はありません。クラスタ内にOCPに引き継がれていないホストが存在する場合は、その未引き継ぎホストの以下のプロパティを指定する必要があります。 |
| ├─ kind | String | いいえ | DEDICATED_PHYSICAL_MACHINE | ホストタイプ。取り得る範囲:DEDICATED_PHYSICAL_MACHINEまたはDEDICATED_ECS。デフォルトはDEDICATED_PHYSICAL_MACHINEです。 |
| ├─ hostTypeId | Integer | はい | 281 | ホストマシンタイプID。 |
| ├─ credentialId | Integer | はい | 32765 | ホストの認証情報ID。 |
| ├─ sshPort | Integer | いいえ | 22 | ホストSSHポート。デフォルトは22です。 |
| ├─ mgragentPort | Integer | いいえ | 62889 | OCP-Agent監視データリスニングポート。デフォルトは62889です。 |
| ├─ monagentPort | Integer | いいえ | 62888 | OCP-Agent APIリスニングポート。デフォルトは62888です。 |
| ├─ monagentCpuQuota | number | いいえ | 2.0 | ocp_monagentのCPU設定。0.5C以上である必要があります。0.5Cの倍数で増やしてください。推奨される最大値は6Cです。 |
| ├─ monagentMemoryQuota | Integer | いいえ | 2 | ocp_monagentのメモリ設定。1GiB以上である必要があります。1GiBの倍数で増やしてください。推奨される最大値は12GiBです。 |
| vpcId | Long | いいえ | 1L | VPC ID。 |
| vpcName | String | いいえ | xxx | VPC名。 |
| proxyroPassword | String | いいえ | ***** | proxyro@sysユーザーのパスワード。 |
| saveToCredential | Boolean | いいえ | true | パスワードボックスに保存するかどうか。デフォルトはtrue。 |
実行結果
基本データ構造
パラメータ |
型 |
説明 |
|---|---|---|
| data | Object | 非同期タスク情報。詳細については、タスク情報を参照してください。 |
| successful | Boolean | リクエストが成功したかどうか。 |
| timestamp | Datetime | サーバーがリクエストを完了したタイムスタンプ。 |
| duration | Integer | サーバーがリクエストを処理した時間(ミリ秒)。 |
| status | Integer | HTTPステータスコード。 |
| traceId | String | リクエストのTrace ID。問題の調査に使用されます。 |
| server | String | リクエストに応答したアプリケーションサービスのアドレス。 |
例
リクエスト例
POST /api/v2/ob/clusters/takeOver
body:
{
"rootSysPassword":"xxxxx",
"address":"xxxxx",
"port":2888
}
実行結果例
{
"data": {
"clusterId": 5000034,
"creator": "admin",
"executor": "xxx.xxx.xxx.xxx",
"id": 13089035,
"name": "Take over primary OB cluster",
"operation": "EXECUTE",
"prohibitRollback": false,
"startTime": "2024-10-10T17:15:17.816+08:00",
"status": "RUNNING",
"subtasks": [
{
"description": "Mc lock ob clusters",
"downstreams": [
13104470
],
"id": 13104477,
"name": "Mc lock ob clusters",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 25,
"status": "READY",
"timeout": 60,
"upstreams": []
},
{
"description": "Create default user",
"downstreams": [
13104480
],
"id": 13104481,
"name": "Create default user",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 0,
"status": "PENDING",
"timeout": 180,
"upstreams": [
13104476
]
},
{
"description": "Update observer status",
"downstreams": [
13104471
],
"id": 13104469,
"name": "Update observer status",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": 0,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 16,
"status": "PENDING",
"timeout": 300,
"upstreams": [
13104468
]
},
{
"description": "Update OB cluster status",
"downstreams": [
13104463
],
"id": 13104465,
"name": "Update OB cluster status",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 12,
"status": "PENDING",
"timeout": 30,
"upstreams": [
13104484
]
},
{
"description": "Active agent modules",
"downstreams": [
13104485
],
"id": 13104482,
"name": "Active agent modules",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": 0,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 6,
"status": "PENDING",
"timeout": 1800,
"upstreams": [
13104461
]
},
{
"description": "Wait node",
"downstreams": [
13104482
],
"id": 13104461,
"name": "Wait node",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 3,
"status": "PENDING",
"timeout": 30,
"upstreams": [
13104475
]
},
{
"description": "Sync cluster info",
"downstreams": [
13104473
],
"id": 13104466,
"name": "Sync cluster info",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 5,
"status": "PENDING",
"timeout": 60,
"upstreams": [
13104485
]
},
{
"description": "Sync all tenant information",
"downstreams": [
13104468
],
"id": 13104473,
"name": "Sync all tenant information",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 15,
"status": "PENDING",
"timeout": 300,
"upstreams": [
13104466
]
},
{
"description": "Mc unlock ob clusters",
"downstreams": [],
"id": 13104478,
"name": "Mc unlock ob clusters",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 23,
"status": "PENDING",
"timeout": 60,
"upstreams": [
13104463
]
},
{
"description": "Prepare take over cluster",
"downstreams": [
13104476
],
"id": 13104470,
"name": "Prepare take over cluster",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 13,
"status": "PENDING",
"timeout": 30,
"upstreams": [
13104477
]
},
{
"description": "Wait node",
"downstreams": [
13104483
],
"id": 13104464,
"name": "Wait node",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 7,
"status": "PENDING",
"timeout": 30,
"upstreams": [
13104472
]
},
{
"description": "Register config url",
"downstreams": [
13104472
],
"id": 13104480,
"name": "Register config url",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 20,
"status": "PENDING",
"timeout": 60,
"upstreams": [
13104481
]
},
{
"description": "Set proxyro password to sys tenant",
"downstreams": [
13104469
],
"id": 13104468,
"name": "Set proxyro password to sys tenant",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 4,
"status": "PENDING",
"timeout": 600,
"upstreams": [
13104473
]
},
{
"description": "Run io calibration",
"downstreams": [
13104464
],
"id": 13104472,
"name": "Run io calibration",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": 0,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 14,
"status": "PENDING",
"timeout": 1800,
"upstreams": [
13104480
]
},
{
"description": "Wait cluster accessible",
"downstreams": [
13104474
],
"id": 13104462,
"name": "Wait cluster accessible",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 8,
"status": "PENDING",
"timeout": 1200,
"upstreams": [
13104483
]
},
{
"description": "Update server process info",
"downstreams": [
13104479
],
"id": 13104474,
"name": "Update server process info",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": 0,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 1,
"status": "PENDING",
"timeout": 5000,
"upstreams": [
13104462
]
},
{
"description": "Refresh ocp agent config",
"downstreams": [
13104461
],
"id": 13104475,
"name": "Refresh ocp agent config",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": 0,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 21,
"status": "PENDING",
"timeout": 3600,
"upstreams": [
13104467
]
},
{
"description": "Reserve host",
"downstreams": [
13104481
],
"id": 13104476,
"name": "Reserve host",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 2,
"status": "PENDING",
"timeout": 1800,
"upstreams": [
13104470
]
},
{
"description": "Wait node",
"downstreams": [
13104467
],
"id": 13104479,
"name": "Wait node",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 10,
"status": "PENDING",
"timeout": 30,
"upstreams": [
13104474
]
},
{
"description": "Record root service list",
"downstreams": [
13104462
],
"id": 13104483,
"name": "Record root service list",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 9,
"status": "PENDING",
"timeout": 60,
"upstreams": [
13104464
]
},
{
"description": "Create resource manager for default user",
"downstreams": [
13104478
],
"id": 13104463,
"name": "Create resource manager for default user",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 11,
"status": "PENDING",
"timeout": 180,
"upstreams": [
13104465
]
},
{
"description": "Update zone status",
"downstreams": [
13104484
],
"id": 13104460,
"name": "Update zone status",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": 0,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 19,
"status": "PENDING",
"timeout": 1800,
"upstreams": [
13104471
]
},
{
"description": "Wait node",
"downstreams": [
13104466
],
"id": 13104485,
"name": "Wait node",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 24,
"status": "PENDING",
"timeout": 30,
"upstreams": [
13104482
]
},
{
"description": "Wait node",
"downstreams": [
13104460
],
"id": 13104471,
"name": "Wait node",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 17,
"status": "PENDING",
"timeout": 30,
"upstreams": [
13104469
]
},
{
"description": "Wait node",
"downstreams": [
13104465
],
"id": 13104484,
"name": "Wait node",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 22,
"status": "PENDING",
"timeout": 30,
"upstreams": [
13104460
]
},
{
"description": "Attach cluster attributes",
"downstreams": [
13104475
],
"id": 13104467,
"name": "Attach cluster attributes",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"prohibitSkip": false,
"runTime": 1,
"seriesId": 18,
"status": "PENDING",
"timeout": 1800,
"upstreams": [
13104479
]
}
],
"taskDefinitionId": -1,
"type": "MANUAL"
},
"duration": 493,
"server": "74f95ea2f4",
"status": 200,
"successful": true,
"timestamp": "2024-10-10T17:15:17.896+08:00",
"traceId": "a555fda01af052c1"
}