Set Config Action

Request

GET /api/_set_config

Description

Used to dynamically set the configuration of FE. This command is passed through the ADMIN SET FRONTEND CONFIG command. But this command will only set the configuration of the corresponding FE node. And it will not automatically forward the MasterOnly configuration item to the Master FE node.

Path parameters

None

Query parameters

  • confkey1=confvalue1

    Specify the configuration name to be set, and its value is the configuration value to be modified.

  • persist

    Whether to persist the modified configuration. The default is false, which means it is not persisted. If it is true, the modified configuration item will be written into the fe_custom.conf file and will still take effect after FE is restarted.

  • reset_persist Whether or not to clear the original persist configuration only takes effect when the persist parameter is true. For compatibility with the original version, reset_persist defaults to true.
    If persist is set to true and reset_persist is not set or reset_persist is true, the configuration in the fe_custom.conf file will be cleared before this modified configuration is written to fe_custom.conf.
    If persist is set to true and reset_persist is false, this modified configuration item will be incrementally added to fe_custom.conf.

Request body

None

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. }

The set field indicates the successfully set configuration. The err field indicates the configuration that failed to be set. The persist field indicates persistent information.

Examples

  1. Set the values of storage_min_left_capacity_bytes, replica_ack_policy and 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
    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 Successfully;
    27. replica_ack_policy Failed, because the configuration item does not support dynamic modification.
    28. agent_task_resend_wait_time_ms Failed, failed to set the boolean type because the configuration item is of type long.
  2. Set max_bytes_per_broker_scanner and persist it.

    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. }

    The fe/conf directory generates the fe_custom.conf file:

    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