| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 | [[cluster-update-settings]]== Cluster Update SettingsAllows to update cluster wide specific settings. Settings updated caneither be persistent (applied across restarts) or transient (will notsurvive a full cluster restart). Here is an example:[source,js]--------------------------------------------------PUT /_cluster/settings{    "persistent" : {        "indices.recovery.max_bytes_per_sec" : "50mb"    }}--------------------------------------------------// CONSOLEOr:[source,js]--------------------------------------------------PUT /_cluster/settings?flat_settings=true{    "transient" : {        "indices.recovery.max_bytes_per_sec" : "20mb"    }}--------------------------------------------------// CONSOLEThe cluster responds with the settings updated. So the response for thelast example will be:[source,js]--------------------------------------------------{    ...    "persistent" : { },    "transient" : {        "indices.recovery.max_bytes_per_sec" : "20mb"    }}--------------------------------------------------// TESTRESPONSE[s/\.\.\./"acknowledged": true,/]Resetting persistent or transient settings can be done by assigning a`null` value. If a transient setting is reset, the persistent settingis applied if available. Otherwise Elasticsearch will fallback to the settingdefined at the configuration file or, if not existent, to the defaultvalue. Here is an example:[source,js]--------------------------------------------------PUT /_cluster/settings{    "transient" : {        "indices.recovery.max_bytes_per_sec" : null    }}--------------------------------------------------// CONSOLEReset settings will not be included in the cluster response. Sothe response for the last example will be:[source,js]--------------------------------------------------{    ...    "persistent" : {},    "transient" : {}}--------------------------------------------------// TESTRESPONSE[s/\.\.\./"acknowledged": true,/]Settings can also be reset using simple wildcards. For instance to resetall dynamic `indices.recovery` setting a prefix can be used:[source,js]--------------------------------------------------PUT /_cluster/settings{    "transient" : {        "indices.recovery.*" : null    }}--------------------------------------------------// CONSOLECluster wide settings can be returned using:[source,js]--------------------------------------------------GET /_cluster/settings--------------------------------------------------// CONSOLE[float]=== Precedence of settingsTransient cluster settings take precedence over persistent cluster settings,which take precedence over settings configured in the `elasticsearch.yml`config file.For this reason it is preferrable to  use the `elasticsearch.yml` file onlyfor local configurations, and set all cluster-wider settings with the`settings` API.A list of dynamically updatable settings can be found in the<<modules,Modules>> documentation.
 |