Cluster settings

The cluster settings operation lets you check the current settings for your cluster, review default settings, and change settings. When you update a setting using the API, OpenSearch applies it to all nodes in the cluster.

Examples

  1. GET _cluster/settings?include_defaults=true
  1. PUT _cluster/settings
  2. {
  3. "persistent": {
  4. "action": {
  5. "auto_create_index": false
  6. }
  7. }
  8. }

Path and HTTP methods

  1. GET _cluster/settings
  2. PUT _cluster/settings

URL parameters

All cluster settings parameters are optional.

ParameterTypeDescription
flat_settingsBooleanWhether to return settings in the flat form, which can improve readability, especially for heavily nested settings. For example, the flat form of “cluster”: { “max_shards_per_node”: 500 } is “cluster.max_shards_per_node”: “500”.
include_defaults (GET only)BooleanWhether to include default settings as part of the response. This parameter is useful for identifying the names and current values of settings you want to update.
master_timeoutTimeThe amount of time to wait for a response from the master node. Default is 30 seconds.
timeout (PUT only)TimeThe amount of time to wait for a response from the cluster. Default is 30 seconds.

Request body

The GET operation has no request body options.

For a PUT operation, the request body must contain transient or persistent, along with the setting you want to update:

  1. PUT _cluster/settings
  2. {
  3. "persistent": {
  4. "cluster": {
  5. "max_shards_per_node": 500
  6. }
  7. }
  8. }

For more information about transient settings, persistent settings, and precedence, see OpenSearch configuration.

Response

  1. {
  2. "acknowledged": true,
  3. "persistent": {
  4. "cluster": {
  5. "max_shards_per_node": "500"
  6. }
  7. },
  8. "transient": {}
  9. }