Cluster Update Settings
editCluster Update Settings
editAllows to update cluster wide specific settings. Settings updated can either be persistent (applied across restarts) or transient (will not survive a full cluster restart). Here is an example:
PUT /_cluster/settings { "persistent" : { "indices.recovery.max_bytes_per_sec" : "50mb" } }
Or:
PUT /_cluster/settings?flat_settings=true { "transient" : { "indices.recovery.max_bytes_per_sec" : "20mb" } }
The cluster responds with the settings updated. So the response for the last example will be:
{ ... "persistent" : { }, "transient" : { "indices.recovery.max_bytes_per_sec" : "20mb" } }
Resetting persistent or transient settings can be done by assigning a
null
value. If a transient setting is reset, the persistent setting
is applied if available. Otherwise Elasticsearch will fallback to the setting
defined at the configuration file or, if not existent, to the default
value. Here is an example:
PUT /_cluster/settings { "transient" : { "indices.recovery.max_bytes_per_sec" : null } }
Reset settings will not be included in the cluster response. So the response for the last example will be:
{ ... "persistent" : {}, "transient" : {} }
Settings can also be reset using simple wildcards. For instance to reset
all dynamic indices.recovery
setting a prefix can be used:
PUT /_cluster/settings { "transient" : { "indices.recovery.*" : null } }
Cluster wide settings can be returned using:
GET /_cluster/settings
Precedence of settings
editTransient cluster settings take precedence over persistent cluster settings,
which take precedence over settings configured in the elasticsearch.yml
config file.
It’s best to set all cluster-wide settings with the settings
API and use the
elasticsearch.yml
file only for local configurations. This way you can be sure that
the setting is the same on all nodes. If, on the other hand, you define different
settings on different nodes by accident using the configuration file, it is very
difficult to notice these discrepancies.
A list of dynamically updatable settings can be found in the Modules documentation.