Node Action

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

SinceVersion dev

POST /rest/v2/manager/node/{action}/be

POST /rest/v2/manager/node/{action}/fe

获取fe, be, broker节点信息

GET /rest/v2/manager/node/frontends

GET /rest/v2/manager/node/backends

GET /rest/v2/manager/node/brokers

Description

用于获取集群获取fe, be, broker节点信息。

Response

  1. frontends:
  2. {
  3. "msg": "success",
  4. "code": 0,
  5. "data": {
  6. "column_names": [
  7. "Name",
  8. "IP",
  9. "HostName",
  10. "EditLogPort",
  11. "HttpPort",
  12. "QueryPort",
  13. "RpcPort",
  14. "ArrowFlightSqlPort",
  15. "Role",
  16. "IsMaster",
  17. "ClusterId",
  18. "Join",
  19. "Alive",
  20. "ReplayedJournalId",
  21. "LastHeartbeat",
  22. "IsHelper",
  23. "ErrMsg",
  24. "Version"
  25. ],
  26. "rows": [
  27. [
  28. ...
  29. ]
  30. ]
  31. },
  32. "count": 0
  33. }
  1. backends:
  2. {
  3. "msg": "success",
  4. "code": 0,
  5. "data": {
  6. "column_names": [
  7. "BackendId",
  8. "Cluster",
  9. "IP",
  10. "HostName",
  11. "HeartbeatPort",
  12. "BePort",
  13. "HttpPort",
  14. "BrpcPort",
  15. "LastStartTime",
  16. "LastHeartbeat",
  17. "Alive",
  18. "SystemDecommissioned",
  19. "ClusterDecommissioned",
  20. "TabletNum",
  21. "DataUsedCapacity",
  22. "AvailCapacity",
  23. "TotalCapacity",
  24. "UsedPct",
  25. "MaxDiskUsedPct",
  26. "ErrMsg",
  27. "Version",
  28. "Status"
  29. ],
  30. "rows": [
  31. [
  32. ...
  33. ]
  34. ]
  35. },
  36. "count": 0
  37. }
  1. brokers:
  2. {
  3. "msg": "success",
  4. "code": 0,
  5. "data": {
  6. "column_names": [
  7. "Name",
  8. "IP",
  9. "HostName",
  10. "Port",
  11. "Alive",
  12. "LastStartTime",
  13. "LastUpdateTime",
  14. "ErrMsg"
  15. ],
  16. "rows": [
  17. [
  18. ...
  19. ]
  20. ]
  21. },
  22. "count": 0
  23. }

获取节点配置信息

GET /rest/v2/manager/node/configuration_name

GET /rest/v2/manager/node/node_list

POST /rest/v2/manager/node/configuration_info

Description

configuration_name 用于获取节点配置项名称。
node_list 用于获取节点列表。
configuration_info 用于获取节点配置详细信息。

Query parameters

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的配置信息。

Request body

GET /rest/v2/manager/node/configuration_name

GET /rest/v2/manager/node/node_list

POST /rest/v2/manager/node/configuration_info

  1. {
  2. "conf_name": [
  3. ""
  4. ],
  5. "node": [
  6. ""
  7. ]
  8. }
  9. 若不带bodybody中的参数都使用默认值。
  10. conf_name 用于指定返回哪些配置项的信息, 默认返回所有配置项信息;
  11. node 用于指定返回哪些节点的配置项信息,默认为全部fe节点或be节点配置项信息。

Response

GET /rest/v2/manager/node/configuration_name

  1. {
  2. "msg": "success",
  3. "code": 0,
  4. "data": {
  5. "backend":[
  6. ""
  7. ],
  8. "frontend":[
  9. ""
  10. ]
  11. },
  12. "count": 0
  13. }

GET /rest/v2/manager/node/node_list

  1. {
  2. "msg": "success",
  3. "code": 0,
  4. "data": {
  5. "backend": [
  6. ""
  7. ],
  8. "frontend": [
  9. ""
  10. ]
  11. },
  12. "count": 0
  13. }

POST /rest/v2/manager/node/configuration_info?type=fe

  1. {
  2. "msg": "success",
  3. "code": 0,
  4. "data": {
  5. "column_names": [
  6. "配置项",
  7. "节点",
  8. "节点类型",
  9. "配置值类型",
  10. "MasterOnly",
  11. "配置值",
  12. "可修改"
  13. ],
  14. "rows": [
  15. [
  16. ""
  17. ]
  18. ]
  19. },
  20. "count": 0
  21. }

POST /rest/v2/manager/node/configuration_info?type=be

  1. {
  2. "msg": "success",
  3. "code": 0,
  4. "data": {
  5. "column_names": [
  6. "配置项",
  7. "节点",
  8. "节点类型",
  9. "配置值类型",
  10. "配置值",
  11. "可修改"
  12. ],
  13. "rows": [
  14. [
  15. ""
  16. ]
  17. ]
  18. },
  19. "count": 0
  20. }

Examples

  1. 获取fe agent_task_resend_wait_time_ms 配置项信息:

    POST /rest/v2/manager/node/configuration_info?type=fe
    body:

    1. {
    2. "conf_name":[
    3. "agent_task_resend_wait_time_ms"
    4. ]
    5. }

    Response:

    1. {
    2. "msg": "success",
    3. "code": 0,
    4. "data": {
    5. "column_names": [
    6. "配置项",
    7. "节点",
    8. "节点类型",
    9. "配置值类型",
    10. "MasterOnly",
    11. "配置值",
    12. "可修改"
    13. ],
    14. "rows": [
    15. [
    16. "agent_task_resend_wait_time_ms",
    17. "127.0.0.1:8030",
    18. "FE",
    19. "long",
    20. "true",
    21. "50000",
    22. "true"
    23. ]
    24. ]
    25. },
    26. "count": 0
    27. }

修改配置值

POST /rest/v2/manager/node/set_config/fe

POST /rest/v2/manager/node/set_config/be

Description

用于修改fe或be节点配置值

Request body

  1. {
  2. "config_name":{
  3. "node":[
  4. ""
  5. ],
  6. "value":"",
  7. "persist":
  8. }
  9. }
  10. config_name为对应的配置项;
  11. node为关键字,表示要修改的节点列表;
  12. value为配置的值;
  13. persist true 表示永久修改, false 表示临时修改。永久修改重启后能生效, 临时修改重启后失效。

Response

GET /rest/v2/manager/node/configuration_name

  1. {
  2. "msg": "",
  3. "code": 0,
  4. "data": {
  5. "failed":[
  6. {
  7. "config_name":"name",
  8. "value"="",
  9. "node":"",
  10. "err_info":""
  11. }
  12. ]
  13. },
  14. "count": 0
  15. }
  16. failed 表示修改失败的配置信息。

Examples

  1. 修改fe 127.0.0.1:8030 节点中 agent_task_resend_wait_time_ms 和alter_table_timeout_second 配置值:

    POST /rest/v2/manager/node/set_config/fe body:

    1. {
    2. "agent_task_resend_wait_time_ms":{
    3. "node":[
    4. "127.0.0.1:8030"
    5. ],
    6. "value":"10000",
    7. "persist":"true"
    8. },
    9. "alter_table_timeout_second":{
    10. "node":[
    11. "127.0.0.1:8030"
    12. ],
    13. "value":"true",
    14. "persist":"true"
    15. }
    16. }

    Response:

    1. {
    2. "msg": "success",
    3. "code": 0,
    4. "data": {
    5. "failed": [
    6. {
    7. "config_name": "alter_table_timeout_second",
    8. "node": "10.81.85.89:8837",
    9. "err_info": "Unsupported configuration value type.",
    10. "value": "true"
    11. }
    12. ]
    13. },
    14. "count": 0
    15. }
    16. agent_task_resend_wait_time_ms 配置值修改成功,alter_table_timeout_second 修改失败。

操作 be 节点

POST /rest/v2/manager/node/{action}/be

Description

用于添加/删除/下线 be 节点

action:ADD/DROP/DECOMMISSION

Request body

  1. {
  2. "hostPorts": ["127.0.0.1:9050"],
  3. "properties": {
  4. "tag.location": "test"
  5. }
  6. }
  7. hostPorts 需要操作的一组 be 节点地址 ip:heartbeat_port
  8. properties 添加节点时传入的配置,目前只用于配置 tag, 不传使用默认 tag

Response

  1. {
  2. "msg": "Error",
  3. "code": 1,
  4. "data": "errCode = 2, detailMessage = Same backend already exists[127.0.0.1:9050]",
  5. "count": 0
  6. }
  7. msg Success/Error
  8. code 0/1
  9. data ""/报错信息

Examples

  1. 添加 be 节点

    post /rest/v2/manager/node/ADD/be Request body

    1. {
    2. "hostPorts": ["127.0.0.1:9050"]
    3. }

    Response

    1. {
    2. "msg": "success",
    3. "code": 0,
    4. "data": null,
    5. "count": 0
    6. }
  2. 删除 be 节点

    post /rest/v2/manager/node/DROP/be Request body

    1. {
    2. "hostPorts": ["127.0.0.1:9050"]
    3. }

    Response

    1. {
    2. "msg": "success",
    3. "code": 0,
    4. "data": null,
    5. "count": 0
    6. }
  3. 下线 be 节点

    post /rest/v2/manager/node/DECOMMISSION/be Request body

    1. {
    2. "hostPorts": ["127.0.0.1:9050"]
    3. }

    Response

    1. {
    2. "msg": "success",
    3. "code": 0,
    4. "data": null,
    5. "count": 0
    6. }

操作 fe 节点

POST /rest/v2/manager/node/{action}/fe

Description

用于添加/删除 fe 节点

action:ADD/DROP

Request body

  1. {
  2. "role": "FOLLOWER",
  3. "hostPort": "127.0.0.1:9030"
  4. }
  5. role FOLLOWER/OBSERVER
  6. hostPort 需要操作的 fe 节点地址 ip:edit_log_port

Response

  1. {
  2. "msg": "Error",
  3. "code": 1,
  4. "data": "errCode = 2, detailMessage = frontend already exists name: 127.0.0.1:9030_1670495889415, role: FOLLOWER, 127.0.0.1:9030",
  5. "count": 0
  6. }
  7. msg Success/Error
  8. code 0/1
  9. data ""/报错信息

Examples

  1. 添加 FOLLOWER 节点

    post /rest/v2/manager/node/ADD/fe Request body

    1. {
    2. "role": "FOLLOWER",
    3. "hostPort": "127.0.0.1:9030"
    4. }

    Response

    1. {
    2. "msg": "success",
    3. "code": 0,
    4. "data": null,
    5. "count": 0
    6. }
  2. 删除 FOLLOWER 节点

    post /rest/v2/manager/node/DROP/fe Request body

    1. {
    2. "role": "FOLLOWER",
    3. "hostPort": "127.0.0.1:9030"
    4. }

    Response

    1. {
    2. "msg": "success",
    3. "code": 0,
    4. "data": null,
    5. "count": 0
    6. }