Update ElasticSearch configuration - suguanyu/WechatTinyProgram GitHub Wiki
Update Cluster:
Cluster Update Settings edit
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:
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"
}
}'
https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-update-settings.html
Changing Settings Dynamicallyedit
Many settings in Elasticsearch are dynamic and can be modified through the API. Configuration changes that force a node (or cluster) restart are strenuously avoided. And while itโs possible to make the changes through the static configs, we recommend that you use the API instead.
The cluster-update API operates in two modes:
Transient These changes are in effect until the cluster restarts. Once a full cluster restart takes place, these settings are erased. Persistent These changes are permanently in place unless explicitly changed. They will survive full cluster restarts and override the static configuration files. Transient versus persistent settings are supplied in the JSON body:
PUT /_cluster/settings
{
"persistent" : {
"discovery.zen.minimum_master_nodes" : 2
},
"transient" : {
"indices.store.throttle.max_bytes_per_sec" : "50mb"
}
}
This persistent setting will survive full cluster restarts.
This transient setting will be removed after the first full cluster restart.