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
{"msg": "success","code": 0,"data": {"set": {"key": "value"},"err": [{"config_name": "","config_value": "","err_info": ""}],"persist":""},"count": 0}
set 字段表示设置成功的配置。err 字段表示设置失败的配置。 persist 字段表示持久化信息。
Examples
设置
storage_min_left_capacity_bytes、replica_ack_policy和agent_task_resend_wait_time_ms三个配置的值。GET /api/_set_config?storage_min_left_capacity_bytes=1024&replica_ack_policy=SIMPLE_MAJORITY&agent_task_resend_wait_time_ms=trueResponse:{"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并持久化GET /api/_set_config?max_bytes_per_broker_scanner=21474836480&persist=true&reset_persist=falseResponse:{"msg": "success","code": 0,"data": {"set": {"max_bytes_per_broker_scanner": "21474836480"},"err": [],"persist": "ok"},"count": 0}
fe/conf 目录生成fe_custom.conf:
#THIS IS AN AUTO GENERATED CONFIG FILE.#You can modify this file manually, and the configurations in this file#will overwrite the configurations in fe.conf#Wed Jul 28 12:43:14 CST 2021max_bytes_per_broker_scanner=21474836480