Set Config Action

Request

GET /api/_set_config

Description

用于动态设置 FE 的参数。该命令等同于通过 ADMIN SET FRONTEND CONFIG 命令。但该命令仅会设置对应 FE 节点的配置。并且不会自动转发 MasterOnly 配置项给 Master FE 节点。

Path parameters

Query parameters

  • confkey1=confvalue1

    指定要设置的配置名称,其值为要修改的配置值。

  • persist

    是否要将修改的配置持久化。默认为 false,即不持久化。如果为 true,这修改后的配置项会写入 fe_custom.conf 文件中,并在 FE 重启后仍会生效。

  • reset_persist

    是否要清空原来的持久化配置,只在 persist 参数为 true 时生效。为了兼容原来的版本,reset_persist 默认为 true。
    如果 persist 设为 true,不设置 reset_persist 或 reset_persist 为 true,将先清空fe_custom.conf文件中的配置再将本次修改的配置写入fe_custom.conf
    如果 persist 设为 true,reset_persist 为 false,本次修改的配置项将会增量添加到fe_custom.conf

Request body

Response

  1. {
  2. "msg": "success",
  3. "code": 0,
  4. "data": {
  5. "set": {
  6. "key": "value"
  7. },
  8. "err": [
  9. {
  10. "config_name": "",
  11. "config_value": "",
  12. "err_info": ""
  13. }
  14. ],
  15. "persist":""
  16. },
  17. "count": 0
  18. }

set 字段表示设置成功的配置。err 字段表示设置失败的配置。 persist 字段表示持久化信息。

Examples

  1. 设置 storage_min_left_capacity_bytesreplica_ack_policyagent_task_resend_wait_time_ms 三个配置的值。

    1. GET /api/_set_config?storage_min_left_capacity_bytes=1024&replica_ack_policy=SIMPLE_MAJORITY&agent_task_resend_wait_time_ms=true
    2. Response:
    3. {
    4. "msg": "success",
    5. "code": 0,
    6. "data": {
    7. "set": {
    8. "storage_min_left_capacity_bytes": "1024"
    9. },
    10. "err": [
    11. {
    12. "config_name": "replica_ack_policy",
    13. "config_value": "SIMPLE_MAJORITY",
    14. "err_info": "Not support dynamic modification."
    15. },
    16. {
    17. "config_name": "agent_task_resend_wait_time_ms",
    18. "config_value": "true",
    19. "err_info": "Unsupported configuration value type."
    20. }
    21. ],
    22. "persist": ""
    23. },
    24. "count": 0
    25. }
    26. storage_min_left_capacity_bytes 设置成功;
    27. replica_ack_policy 设置失败,原因是该配置项不支持动态修改;
    28. agent_task_resend_wait_time_ms 设置失败,因为该配置项类型为long 设置boolean类型失败。
  2. 设置 max_bytes_per_broker_scanner 并持久化

    1. GET /api/_set_config?max_bytes_per_broker_scanner=21474836480&persist=true&reset_persist=false
    2. Response:
    3. {
    4. "msg": "success",
    5. "code": 0,
    6. "data": {
    7. "set": {
    8. "max_bytes_per_broker_scanner": "21474836480"
    9. },
    10. "err": [],
    11. "persist": "ok"
    12. },
    13. "count": 0
    14. }

    fe/conf 目录生成fe_custom.conf:

    1. #THIS IS AN AUTO GENERATED CONFIG FILE.
    2. #You can modify this file manually, and the configurations in this file
    3. #will overwrite the configurations in fe.conf
    4. #Wed Jul 28 12:43:14 CST 2021
    5. max_bytes_per_broker_scanner=21474836480