ノード操作
Request
GET /rest/v2/manager/node/frontends
GET /rest/v2/manager/node/backends
GET /rest/v2/manager/node/brokers
GET /rest/v2/manager/node/configuration_name
GET /rest/v2/manager/node/node_list
POST /rest/v2/manager/node/configuration_info
POST /rest/v2/manager/node/set_config/fe
POST /rest/v2/manager/node/set_config/be
POST /rest/v2/manager/node/{action}/be
POST /rest/v2/manager/node/{action}/fe
POST /rest/v2/manager/node/{action}/broker (3.0.7+)
fe、be、brokerノード情報の取得
GET /rest/v2/manager/node/frontends
GET /rest/v2/manager/node/backends
GET /rest/v2/manager/node/brokers
説明
クラスターからfe、be、brokerノード情報を取得するために使用されます。
Response
frontends:
{
"msg": "success",
"code": 0,
"data": {
"column_names": [
"Name",
"IP",
"HostName",
"EditLogPort",
"HttpPort",
"QueryPort",
"RpcPort",
"ArrowFlightSqlPort",
"Role",
"IsMaster",
"ClusterId",
"Join",
"Alive",
"ReplayedJournalId",
"LastHeartbeat",
"IsHelper",
"ErrMsg",
"Version"
],
"rows": [
[
...
]
]
},
"count": 0
}
backends:
{
"msg": "success",
"code": 0,
"data": {
"column_names": [
"BackendId",
"Cluster",
"IP",
"HostName",
"HeartbeatPort",
"BePort",
"HttpPort",
"BrpcPort",
"LastStartTime",
"LastHeartbeat",
"Alive",
"SystemDecommissioned",
"ClusterDecommissioned",
"TabletNum",
"DataUsedCapacity",
"AvailCapacity",
"TotalCapacity",
"UsedPct",
"MaxDiskUsedPct",
"ErrMsg",
"Version",
"Status"
],
"rows": [
[
...
]
]
},
"count": 0
}
brokers:
{
"msg": "success",
"code": 0,
"data": {
"column_names": [
"Name",
"IP",
"HostName",
"Port",
"Alive",
"LastStartTime",
"LastUpdateTime",
"ErrMsg"
],
"rows": [
[
...
]
]
},
"count": 0
}
ノード設定情報の取得
GET /rest/v2/manager/node/configuration_name
GET /rest/v2/manager/node/node_list
POST /rest/v2/manager/node/configuration_info
説明
configuration_nameは、ノード設定項目名の取得に使用されます。node_listは、ノードリストの取得に使用されます。configuration_infoは、詳細なノード設定情報の取得に使用されます。
クエリパラメータ
GET /rest/v2/manager/node/configuration_name
なし
GET /rest/v2/manager/node/node_list
なし
POST /rest/v2/manager/node/configuration_info
-
type
値はfeまたはbeで、fe設定情報またはbe設定情報の取得を指定するために使用されます。
リクエストボディ
GET /rest/v2/manager/node/configuration_name
なし
GET /rest/v2/manager/node/node_list
なし
POST /rest/v2/manager/node/configuration_info
{
"conf_name": [
""
],
"node": [
""
]
}
If no body is provided, all parameters in the body use default values.
conf_name is used to specify which configuration items' information to return, defaults to returning all configuration items' information;
node is used to specify which nodes' configuration item information to return, defaults to all fe nodes or be nodes configuration item information.
レスポンス
GET /rest/v2/manager/node/configuration_name
{
"msg": "success",
"code": 0,
"data": {
"backend":[
""
],
"frontend":[
""
]
},
"count": 0
}
GET /rest/v2/manager/node/node_list
{
"msg": "success",
"code": 0,
"data": {
"backend": [
""
],
"frontend": [
""
]
},
"count": 0
}
POST /rest/v2/manager/node/configuration_info?type=fe
{
"msg": "success",
"code": 0,
"data": {
"column_names": [
"配置项",
"节点",
"节点类型",
"配置值类型",
"MasterOnly",
"配置值",
"可修改"
],
"rows": [
[
""
]
]
},
"count": 0
}
POST /rest/v2/manager/node/configuration_info?type=be
{
"msg": "success",
"code": 0,
"data": {
"column_names": [
"配置项",
"节点",
"节点类型",
"配置值类型",
"配置值",
"可修改"
],
"rows": [
[
""
]
]
},
"count": 0
}
例
-
fe
agent_task_resend_wait_time_ms設定項目の情報を取得する:POST /rest/v2/manager/node/configuration_info?type=feBody:
{
"conf_name":[
"agent_task_resend_wait_time_ms"
]
}
レスポンス:
```
{
"msg": "success",
"code": 0,
"data": {
"column_names": [
"配置项",
"节点",
"节点类型",
"配置值类型",
"MasterOnly",
"配置值",
"可修改"
],
"rows": [
[
"agent_task_resend_wait_time_ms",
"127.0.0.1:8030",
"FE",
"long",
"true",
"50000",
"true"
]
]
},
"count": 0
}
```
設定値の変更
POST /rest/v2/manager/node/set_config/fe
POST /rest/v2/manager/node/set_config/be
説明
feまたはbeノードの設定値を変更するために使用されます
リクエストボディ
{
"config_name":{
"node":[
""
],
"value":"",
"persist":
}
}
config_nameは対応する設定項目です。nodeはキーワードで、変更対象となるノードのリストを示します。valueは設定値です。persistは永続的な変更の場合はtrue、一時的な変更の場合はfalseです。永続的な変更は再起動後に有効になり、一時的な変更は再起動後に無効になります。
レスポンス
GET /rest/v2/manager/node/configuration_name
{
"msg": "",
"code": 0,
"data": {
"failed":[
{
"config_name":"name",
"value"="",
"node":"",
"err_info":""
}
]
},
"count": 0
}
failedは変更に失敗した設定情報を示します。
例
-
fe 127.0.0.1:8030 ノードの
agent_task_resend_wait_time_msとalter_table_timeout_secondの設定値を変更する場合:POST /rest/v2/manager/node/set_config/feBody:
{
"agent_task_resend_wait_time_ms":{
"node":[
"127.0.0.1:8030"
],
"value":"10000",
"persist":"true"
},
"alter_table_timeout_second":{
"node":[
"127.0.0.1:8030"
],
"value":"true",
"persist":"true"
}
}
応答:
```
{
"msg": "success",
"code": 0,
"data": {
"failed": [
{
"config_name": "alter_table_timeout_second",
"node": "10.81.85.89:8837",
"err_info": "Unsupported configuration value type.",
"value": "true"
}
]
},
"count": 0
}
```
agent_task_resend_wait_time_ms 設定値の変更が正常に完了しました。alter_table_timeout_second の変更は失敗しました。
be ノードの操作
POST /rest/v2/manager/node/{action}/be
説明
be ノードの追加/削除/廃止に使用されます
action:ADD/DROP/DECOMMISSION
リクエストボディ
{
"hostPorts": ["127.0.0.1:9050"],
"properties": {
"tag.location": "test"
}
}
hostPorts操作するbeノードアドレスのグループip:heartbeat_portpropertiesノード追加時に渡される設定、現在はタグの設定にのみ使用され、渡されない場合はデフォルトタグを使用
Response
{
"msg": "Error",
"code": 1,
"data": "errCode = 2, detailMessage = Same backend already exists[127.0.0.1:9050]",
"count": 0
}
例
-
beノードを追加
POST /rest/v2/manager/node/ADD/beリクエスト
{
"hostPorts": ["127.0.0.1:9050"]
}
レスポンス
{
"msg": "success",
"code": 0,
"data": null,
"count": 0
}
-
beノードをドロップ
POST /rest/v2/manager/node/DROP/beリクエスト
{
"hostPorts": ["127.0.0.1:9050"]
}
レスポンス
{
"msg": "success",
"code": 0,
"data": null,
"count": 0
}
-
beノードを廃止する
POST /rest/v2/manager/node/DECOMMISSION/beリクエスト
{
"hostPorts": ["127.0.0.1:9050"]
}
レスポンス
{
"msg": "success",
"code": 0,
"data": null,
"count": 0
}
fe ノードの操作
POST /rest/v2/manager/node/{action}/fe
説明
fe ノードの追加/削除に使用されます
action:ADD/DROP
リクエストボディ
{
"role": "FOLLOWER",
"hostPort": "127.0.0.1:9030"
}
role FOLLOWER/OBSERVER
hostPort fe node address to operate ip:edit_log_port
レスポンス
{
"msg": "Error",
"code": 1,
"data": "errCode = 2, detailMessage = frontend already exists name: 127.0.0.1:9030_1670495889415, role: FOLLOWER, 127.0.0.1:9030",
"count": 0
}
例
-
FOLLOWERノードを追加
POST /rest/v2/manager/node/ADD/feリクエスト
{
"role": "FOLLOWER",
"hostPort": "127.0.0.1:9030"
}
レスポンス
```
{
"msg": "success",
"code": 0,
"data": null,
"count": 0
}
```
2. FOLLOWERノードを削除
POST /rest/v2/manager/node/DROP/fe
リクエスト
{
"role": "FOLLOWER",
"hostPort": "127.0.0.1:9030"
}
レスポンス
{
"msg": "success",
"code": 0,
"data": null,
"count": 0
}
brokerノードの操作
POST /rest/v2/manager/node/{action}/broker
3.0.7以降でサポートされています。
説明
brokerノードの追加/削除に使用されます
action:ADD/DROP/DROP_ALL
リクエストボディ
{
"brokerName": "your_broker_name",
"hostPortList": "broker_ip:broker_port"
}
レスポンス
{
"msg": "Error",
"code": 1,
"data": "errCode = 2, detailMessage = xxxx",
"count": 0
}
例
-
BROKERノードを追加
POST /rest/v2/manager/node/ADD/brokerリクエスト
{
"brokerName": "hdfs_broker",
"hostPortList": "127.0.0.1:8001"
}
レスポンス
```
{
"msg": "success",
"code": 0,
"data": null,
"count": 0
}
```
2. BROKER ノードのドロップ
POST /rest/v2/manager/node/DROP/broker
リクエスト
{
"brokerName": "hdfs_broker",
"hostPortList": "127.0.0.1:8001"
}
レスポンス
{
"msg": "success",
"code": 0,
"data": null,
"count": 0
}
-
BROKERノードのグループを削除
POST /rest/v2/manager/node/DROP_ALL/brokerリクエスト
{
"brokerName": "hdfs_broker",
"hostPortList": ""
}
レスポンス
{
"msg": "success",
"code": 0,
"data": null,
"count": 0
}