機能の概要
このAPIは、OceanBaseクラスタを作成するために使用されます。
呼び出しの説明
インターフェース制約
呼び出し元には、OceanBaseクラスタを作成する権限が付与されていなければなりません。
呼び出し元の権限について詳細は、ユーザーと権限の概要を参照してください。
呼び出し元は、OCPアプリケーションサービスの認証を通過している必要があります。
リクエストパス
POST /api/v2/ob/clusters
リクエストパラメータ
body:
パラメータ |
タイプ |
必須 |
サンプル値 |
説明 |
|---|---|---|---|---|
| name | String | はい | foo | クラスタ名。 |
| vpcName | String | いいえ | - | このパラメータは廃止されました。今後のバージョンで削除されます。 |
| vpcId | Long | いいえ | 1L | クラスタが存在するVPCのIDです。クラシックネットワークでは値は1に設定します。スタンバイクラスタ作成時は、このフィールドは無効です。 |
| obClusterId | Integer | いいえ | 1L | OceanBaseクラスタID。 |
| fullVersion | String | いいえ | 4.3.3.0-200000142024073011 | 対象バージョンの完全なバージョン番号。 |
| rpmName | String | はい | oceanbase-2.2.76-20210219154519.el7.x86_64.rpm | RPMパッケージ名。 |
| type | String | はい | PRIMARY | クラスタタイプ。取り得る範囲: |
| password | String | はい | bar | クラスタのsysテナント内rootアカウントのパスワード。 |
| primaryZone | String | いいえ | Zone1 | ゾーンの優先順位。 |
| zones | Object | はい | - | ゾーンの情報。 |
| ├─name | String | はい | zone1 | ゾーン名。 |
| ├─idcName | String | はい | idc1 | データセンター名。 |
| ├─servers | Array | はい | [1,2] | ホストIDのリスト。 |
| ├─architecture | String | いいえ | x86_64 | ソフトウェアパッケージがサポートするシステムアーキテクチャ。 |
| ├─rpmName | String | いいえ | oceanbase-3.2.0-20210813141857.el7.x86_64.rpm | RPMパッケージ名。 |
| ├─rootServer | Long | いいえ | - | Root Server。 |
| startupParameters | Array | いいえ | - | 起動パラメータ。 |
| ├─name | String | いいえ | - | パラメータ名。 |
| ├─value | String | いいえ | - | パラメータ値。 |
| obproxyClusterIds | Array | いいえ | [1,2] | 関連するOBProxyクラスタIDのリスト。 |
| obproxyClusterKeyList | Array | いいえ | - | マルチクラスタモードで有効です。OBProxyクラスタのリスト。 |
| ├─ocpClusterId | Long | いいえ | 1L | OBProxyクラスタが属するOCPクラスタID。 |
| ├─obproxyClusterId | Long | いいえ | 1L | OBProxyクラスタID。 |
| obproxyUserName | String | いいえ | proxyro | OBProxyユーザー名。 |
| obproxyUserPassword | String | いいえ | ****** | proxyroユーザーのパスワード。指定しない場合、OCPがランダムに生成します(マルチクラウドシナリオでのみ使用)。 |
| attributes | Object | いいえ | - | クラスタ属性。 |
| ├─installPath | String | いいえ | /home/admin/oceanbase |
クラスタのインストールパス。 |
| ├─runPath | String | いいえ | /home/admin/oceanbase |
実行パス。 |
| ├─dataDiskPath | String | いいえ | /data/1 |
データディスクのパス。 |
| ├─logDiskPath | String | いいえ | /data/log1 |
ログディスクのパス。 |
| ├─diskPathStyle | Enum | いいえ | DEAULT | |
| ├─operatingSystemUser | String | いいえ | admin | ホストOSのユーザー。 |
| ├─svrPort | Integer | いいえ | 2882 | RPCポート番号。 |
| primaryClusterInfo | Object | いいえ | - | プライマリクラスタ情報。 |
| ├─rootSysPassword | String | いいえ | ****** | root@sysユーザーのパスワード。 |
| ├─obClusterId | Long | いいえ | 1L | OceanBaseクラスタID。 |
| ├─vpcName | String | いいえ | - | OceanBaseクラスタが属するVPC名。 |
| ├─vpcId | Long | いいえ | 1L | OceanBaseクラスタが属するVPCのID。 |
| arbitrationServiceId | Long | いいえ | 1L | アービトレーションサービスID。 |
| oversellingFactor | Integer | いいえ | 100 | リソースオーバーコミット係数。[100, 200]の範囲で、オーバーコミット率[100%, 200%]を表します。デフォルト値は100で、オーバーコミットを行わないことを意味します。 |
| cgroupEnabled | Boolean | いいえ | true | クラスタでCgroupが有効になっているかどうか。無効の場合、テナント内のリソース制限は適用されません。このパラメータはOceanBase V4.0以降のバージョンでのみ有効です。 |
| createExtraTenant | Boolean | いいえ | false | スタンドアロンモードで新しいテナントを作成するかどうかを選択します。 |
| supportObsBackup | Boolean | いいえ | false | Huawei Cloud OBSに基づくバックアップ・リストアをサポートするかどうか。 |
| simplifiedCreateTenantParam | Object | いいえ | - | スタンドアロン構成でテナントを作成するための簡略化パラメータ。 |
| ├─name | String | いいえ | - | テナント名。 |
| ├─mode | Enum | いいえ | MYSQL | テナントモード。 |
| loadType | Enum | いいえ | EXPRESS_OLTP | ロードタイプ。 |
| jvmEnvConfig | Object | いいえ | - | JVM環境依存サービスの設定情報。 |
| ├─jvmEnvServices | Array | はい | 環境依存サービス。 | |
| ├─maxJvmMemoryGiB | Integer | はい | 1 | ユーザー入力の最大メモリサイズ。単位はGiBです。 |
| ├─javaHomePath | String | はい | /usr/local/java/jdk-17.0.8 |
JAVA_HOMEのパス。 |
戻り値
基本データ構造
パラメータ |
型 |
説明 |
|---|---|---|
| data | Object | 非同期タスク情報。詳細については、タスク情報を参照してください。 |
| successful | Boolean | リクエストが成功したかどうかを示します。 |
| timestamp | Datetime | サーバーがリクエストを完了したタイムスタンプです。 |
| duration | Integer | サーバーがリクエストを処理した時間(ミリ秒)。 |
| status | Integer | HTTP Status仕様に準拠したコード。 |
| traceId | String | リクエストのTrace ID。問題のトラブルシューティングに使用されます。 |
| server | String | リクエストに応答したアプリケーションサービスのアドレスです。 |
例
リクエスト例
POST /api/v2/ob/clusters
body:
{
"jvmEnvConfig": {
"jvmEnvServices": [
"ODPS External Table",
"HDFS External Table",
"Java UDF",
"ODPS Catalog",
"MySQL Plugin"
],
"maxJvmMemoryGiB": 1,
"javaHomePath": "/usr/local/java/jdk-17.0.8"
},
"type": "PRIMARY",
"name": "cluster178",
"cgroupEnabled": false,
"fullVersion": "4.4.1.0-100010032025101417",
"zones": [
{
"rpmName": "oceanbase-4.4.1.0-100010032025101417.el7.x86_64.rpm",
"name": "zone1",
"idcName": "jf",
"servers": [
2
],
"rootServer": 2,
"architecture": "x86_64"
}
],
"startupParameters": [
{
"name": "enable_record_trace_log",
"value": "false"
},
{
"name": "enable_syslog_recycle",
"value": "1"
},
{
"name": "large_query_threshold",
"value": "600s"
},
{
"name": "max_syslog_file_count",
"value": "300"
}
],
"attributes": {
"InstallPath": "/home/admin/oceanbase",
"DataDiskPath": "/data/1",
"LogDiskPath": "/data/log1",
"SqlPort": 2881,
"SvrPort": 2882
},
"runUser": "admin",
"loadType": "HTAP",
"password": "******"
}
レスポンス例
{
"data": {
"cluster": {
"id": 22,
"name": "terran",
"obClusterId": 1
},
"context": "Context(parallelIdx=-1, stringMap={cluster_version=2.2.73, cluster_name=terran, startup_option_string=system_memory=5G, ob_version=2.2.73, service_name=terran:1, ob_connect_address=xxx.xxx.xxx.xxx, cluster_type=PRIMARY, ob_cluster_id=1, link_obproxy=false, zone1.idc=hz2, primary_zone=, sql_port=2881, service_type=OB_CLUSTER, cluster_id=22, rpm_name=oceanbase-2.2.73-20201211175814.el7.x86_64.rpm, target_cluster_status=RUNNING}, listMap={root_servers=[1], root_server_ips=[xxx.xxx.xxx.xxx], host_ids=[1], zone1.host_ids=[1], zone_names=[zone1]})",
"creator": {
"id": 100,
"name": "admin"
},
"id": 108088,
"name": "Create primary OB cluster",
"startTime": "2021-03-02T11:39:34.508+08:00",
"status": "RUNNING",
"tasks": [
{
"description": "Trigger compaction",
"downstreams": [
129864
],
"id": 129848,
"name": "Trigger compaction",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129859
]
},
{
"description": "Set sys primary zone",
"downstreams": [
129855
],
"id": 129849,
"name": "Set sys primary zone",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129850
]
},
{
"description": "Create default user",
"downstreams": [
129849
],
"id": 129850,
"name": "Create default user",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129866
]
},
{
"description": "Wait node",
"downstreams": [
129865
],
"id": 129851,
"name": "Wait node",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129853
]
},
{
"description": "Wait node",
"downstreams": [
129870
],
"id": 129852,
"name": "Wait node",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129867
]
},
{
"description": "Make dir for ob",
"downstreams": [
129851
],
"id": 129853,
"name": "Make dir for ob",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129868
]
},
{
"description": "Wait node",
"downstreams": [
129869
],
"id": 129854,
"name": "Wait node",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129862
]
},
{
"description": "Wait cluster accessible",
"downstreams": [
129867
],
"id": 129855,
"name": "Wait cluster accessible",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129849
]
},
{
"description": "Sync all tenant information",
"downstreams": [
129859
],
"id": 129856,
"name": "Sync all tenant information",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129857
]
},
{
"description": "Sync cluster info",
"downstreams": [
129856
],
"id": 129857,
"name": "Sync cluster info",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129870
]
},
{
"description": "Prepare install cluster",
"downstreams": [
129862
],
"id": 129858,
"name": "Prepare install cluster",
"operation": "EXECUTE",
"status": "RUNNING",
"upstreams": [
]
},
{
"description": "Update OB cluster status",
"downstreams": [
129848
],
"id": 129859,
"name": "Update OB cluster status",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129856
]
},
{
"description": "Restart observer process",
"downstreams": [
129861
],
"id": 129860,
"name": "Restart observer process",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129863
]
},
{
"description": "Wait observer accessible",
"downstreams": [
129866
],
"id": 129861,
"name": "Wait observer accessible",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129860
]
},
{
"description": "Pre check for install OB",
"downstreams": [
129854
],
"id": 129862,
"name": "Pre check for install OB",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129858
]
},
{
"description": "Bootstrap ob",
"downstreams": [
129860
],
"id": 129863,
"name": "Bootstrap ob",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129865
]
},
{
"description": "Link obproxy",
"downstreams": [
],
"id": 129864,
"name": "Link obproxy",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129848
]
},
{
"description": "Do io bench",
"downstreams": [
129863
],
"id": 129865,
"name": "Do io bench",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129851
]
},
{
"description": "Set sys password",
"downstreams": [
129850
],
"id": 129866,
"name": "Set sys password",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129861
]
},
{
"description": "Refresh ocp agent config",
"downstreams": [
129852
],
"id": 129867,
"name": "Refresh ocp agent config",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129855
]
},
{
"description": "Wait node",
"downstreams": [
129853
],
"id": 129868,
"name": "Wait node",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129869
]
},
{
"description": "Install rpm",
"downstreams": [
129868
],
"id": 129869,
"name": "Install rpm",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129854
]
},
{
"description": "Start ocp agent service",
"downstreams": [
129857
],
"id": 129870,
"name": "Start ocp agent service",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129852
]
}
]
},
"duration": 446,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2021-03-02T11:39:34.614+08:00",
"traceId": "ec3bd39a90c748d4"
}