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
- 设置
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
- Response:
- {
- "msg": "success",
- "code": 0,
- "data": {
- "set": {
- "storage_min_left_capacity_bytes": "1024"
- },
- "err": [
- {
- "config_name": "replica_ack_policy",
- "config_value": "SIMPLE_MAJORITY",
- "err_info": "Not support dynamic modification."
- },
- {
- "config_name": "agent_task_resend_wait_time_ms",
- "config_value": "true",
- "err_info": "Unsupported configuration value type."
- }
- ],
- "persist": ""
- },
- "count": 0
-
}
-
storage_min_left_capacity_bytes 设置成功;
- replica_ack_policy 设置失败,原因是该配置项不支持动态修改;
- agent_task_resend_wait_time_ms 设置失败,因为该配置项类型为long, 设置boolean类型失败。 ```
- 设置
max_bytes_per_broker_scanner并持久化
``` 1. GET /api/_set_config?max_bytes_per_broker_scanner=21474836480&persist=true&reset_persist=false
- Response:
- {
- "msg": "success",
- "code": 0,
- "data": {
- "set": {
- "max_bytes_per_broker_scanner": "21474836480"
- },
- "err": [],
- "persist": "ok"
- },
- "count": 0
- } ```
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
