Set Config Action
Request
GET /api/_set_config
デスクリプション
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=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 Successfully;
replica_ack_policy Failed, because the configuration item does not support dynamic modification.
agent_task_resend_wait_time_ms Failed, failed to set the boolean type because the configuration item is of type long. -
max_bytes_per_broker_scannerを設定し、永続化します。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ファイルを生成します:
```
#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 2021
max_bytes_per_broker_scanner=21474836480
```