OpenSearch/docs/reference/cluster/update-settings.asciidoc

90 lines
2.5 KiB
Plaintext
Raw Normal View History

[[cluster-update-settings]]
== Cluster Update Settings
Allows 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:
[source,js]
--------------------------------------------------
curl -XPUT localhost:9200/_cluster/settings -d '{
"persistent" : {
"discovery.zen.minimum_master_nodes" : 2
}
}'
--------------------------------------------------
Or:
[source,js]
--------------------------------------------------
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:
[source,js]
--------------------------------------------------
{
"persistent" : {},
"transient" : {
"discovery.zen.minimum_master_nodes" : "2"
}
}'
--------------------------------------------------
2015-12-07 15:19:40 -05:00
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:
[source,js]
--------------------------------------------------
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:
[source,js]
--------------------------------------------------
{
"persistent" : {},
"transient" : {}
}
2015-12-09 06:24:40 -05:00
--------------------------------------------------
Settings can also be reset using simple wildcards. For instance to reset
all dynamic `discovery.zen` setting a prefix can be used:
[source,js]
--------------------------------------------------
curl -XPUT localhost:9200/_cluster/settings -d '{
"transient" : {
"discovery.zen.*" : null
}
}'
--------------------------------------------------
2015-12-07 15:19:40 -05:00
Cluster wide settings can be returned using:
[source,js]
--------------------------------------------------
curl -XGET localhost:9200/_cluster/settings
--------------------------------------------------
A list of dynamically updatable settings can be found in the
<<modules,Modules>> documentation.