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_bytes 、 replica_ack_policy 和 agent_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

  1. Response:
  2. {
  3. "msg": "success",
  4. "code": 0,
  5. "data": {
  6. "set": {
  7. "storage_min_left_capacity_bytes": "1024"
  8. },
  9. "err": [
  10. {
  11. "config_name": "replica_ack_policy",
  12. "config_value": "SIMPLE_MAJORITY",
  13. "err_info": "Not support dynamic modification."
  14. },
  15. {
  16. "config_name": "agent_task_resend_wait_time_ms",
  17. "config_value": "true",
  18. "err_info": "Unsupported configuration value type."
  19. }
  20. ],
  21. "persist": ""
  22. },
  23. "count": 0
  24. }

  25. storage_min_left_capacity_bytes 设置成功;

  26. replica_ack_policy 设置失败,原因是该配置项不支持动态修改;
  27. agent_task_resend_wait_time_ms 设置失败,因为该配置项类型为long, 设置boolean类型失败。 ```
  28. 设置 max_bytes_per_broker_scanner 并持久化

``` 1. GET /api/_set_config?max_bytes_per_broker_scanner=21474836480&persist=true&reset_persist=false

  1. Response:
  2. {
  3. "msg": "success",
  4. "code": 0,
  5. "data": {
  6. "set": {
  7. "max_bytes_per_broker_scanner": "21474836480"
  8. },
  9. "err": [],
  10. "persist": "ok"
  11. },
  12. "count": 0
  13. } ```

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