WARNING: Version 5.0 of Elasticsearch has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
Cluster Update Settings
editCluster Update Settings
editAllows to update cluster wide specific settings. Settings updated can either be persistent (applied cross restarts) or transient (will not survive a full cluster restart). Here is an example:
curl -XPUT localhost:9200/_cluster/settings -d '{ "persistent" : { "discovery.zen.minimum_master_nodes" : 2 } }'
Or:
curl -XPUT localhost:9200/_cluster/settings -d '{ "transient" : { "discovery.zen.minimum_master_nodes" : 2 } }'
The cluster responds with the settings updated. So the response for the last example will be:
{ "persistent" : {}, "transient" : { "discovery.zen.minimum_master_nodes" : "2" } }'
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:
curl -XPUT localhost:9200/_cluster/settings -d '{ "transient" : { "discovery.zen.minimum_master_nodes" : 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 discovery.zen
setting a prefix can be used:
curl -XPUT localhost:9200/_cluster/settings -d '{ "transient" : { "discovery.zen.*" : null } }'
Cluster wide settings can be returned using:
curl -XGET localhost:9200/_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.
For this reason it is preferrable to use the elasticsearch.yml
file only
for local configurations, and set all cluster-wider settings with the
settings
API.
A list of dynamically updatable settings can be found in the Modules documentation.