Docs
ues
Elasticsearch
Development Guide
Configuration management

Configuration Management

This chapter lists the static configuration items that can be modified in the console and the configuration items that can be dynamically updated through API.

The console supports modifying common static configuration parameters to the elasticsearch.yml configuration file. These configurations do not support dynamic updates and need to restart the cluster after modification.

Configuration itemDefault valueConfiguration description
cluster.nameinstance_idCluster name
discovery.zen.ping.unicast.hosts[]Unicast address, default master node IP or the first three node IPs, example [127.0.0.1,127.0.0.2,127.0.0.3]
gateway.recover_after_nodesN - 2Recovery can be performed when the expected number of nodes is reached
gateway.expected_nodesNExpected number of cluster nodes. When the expected number of nodes join the cluster, shard recovery will begin
gateway.recover_after_time5mIf the expected number of nodes is not reached, no attempt to recovery, and the recovery process will wait the configured time
http.cors.enabledtrueAllow cross-domain access
http.cors.allow-origin*Domains that allow cross-domain access by default support all domains
rest.action.multi.allow_explicit_indextrueAllow the index parameter in the body to override the index parameter in the URL
node.attr.tagNode tag, not set by default
gateway.expected_master_nodes0Expected number of master nodes in the cluster. When the expected number of masters join the cluster, shard recovery will begin
gateway.expected_data_nodes0Expected number of data nodes in the cluster. When the expected number of data nodes join the cluster, shard recovery will begin
gateway.recover_after_master_nodes0Recovery can be performed when the expected number of master nodes is reached
gateway.recover_after_data_nodes0Recovery can be performed when the expected number of data nodes is reached
http.max_content_length100mbMaximum content of the HTTP request, default 100mb. If set to greater than Integer.MAX_VALUE, it will be reset to 100mb
http.max_initial_line_length4kbMaximum length of the HTTP URL, default 4kb
http.max_header_size8kbMaximum value of the allowed headers, default 8kb
http.compressiontrueSupports compression as much as possible (using Accept-Encoding)
http.compression_level3Defines the compression level of the HTTP response. Valid values range between 1 (minimum compression) and 9 (maximum compression)
http.cors.max-age1728000Browser sends “preflight” requests to determine CORS settings. Max-age defines how long the result should be cached. Default is 20 days
http.cors.allow-methodsOPTIONS, HEAD, GET, POST, PUT, DELETEAllowed methods
http.cors.allow-headersX-Requested-With, Content-Type, Content-LengthAllowed headers
http.cors.allow-credentialsfalseWhether the Access-Control-Allow-Credentials header should be returned. Note: This header will only be returned when set to true
http.detailed_errors.enabledtrueEnable or disable the output of detailed error messages and stack traces in response output. Note: If set to false, and the error_trace request parameter is specified, an error will be returned; when error_trace is not specified, a simple message will be returned
http.pipeliningtrueEnable or disable HTTP pipelining
http.pipelining.max_events10000Maximum number of events queued in memory before an HTTP connection closes
indices.fielddata.cache.sizeunlimitedMaximum value of field data cache, for example, 30% of node heap space, or absolute value, like 12GB
indices.queries.cache.size10%Controls the memory size of the filter cache, default 10%. Accepts percentage values (such as 5%) or precise values (such as 512mb)
index.queries.cache.enabledtrueControls whether to enable the query cache, the setting can be on the basis of each configurable index setting
indices.memory.index_buffer_size10%Accepts percentage or byte size value. Default 10%, meaning that 10% of the total heap allocated to the node will be used as the shared index buffer across all shards
indices.memory.min_index_buffer_size48mbIf specifying index_buffer_size as a percentage, you can use this setting to specify the absolute minimum
indices.memory.max_index_buffer_sizeunlimitedIf you specify index_buffer_size as a percentage, you can use this setting to specify the absolute maximum
indices.requests.cache.size1%Cache is managed at the node level, default maximum is 1% of heap
node.ingesttrueIngest qualifications
search.remote.connecttrueCross-cluster search
index.number_of_shards5Number of primary shards an index should have, this setting can be dynamically set when creating the index
index.shard.check_on_startupfalseWhether to check for damage before opening the shard; when damage is detected, it will prevent the shard from being opened
index.routing_partition_size1Number of shards a custom routing value can go to, default 1, can only be set when creating the index. This value must be less than index.number_of_shards unless the value of index.number_of_shards is also 1
  • Note: N is the number of nodes

Most of the configuration items not listed above can be dynamically modified through cluster-update-settings. For a detailed description of the dynamic configuration items, please refer to Modules

Below are common dynamically updatable configuration parameters.

Configuration itemDefault valueConfiguration description
cluster.routing.allocation.enableallEnable or disable allocation of specific kinds of shards
cluster.routing.allocation.node_concurrent_incoming_recoveries2How many concurrent incoming shard recoveries are allowed to occur on a node
cluster.routing.allocation.node_concurrent_outgoing_recoveries2How many concurrent outgoing shard recoveries are allowed to occur on a node
cluster.routing.allocation.node_concurrent_recoveries2Shortcut setting for node_concurrent_incoming_recoveries and node_concurrent_outgoing_recoveries
cluster.routing.allocation.node_initial_primaries_recoveries4After the node starts, recovery of unassigned master nodes will use data on the local disk
cluster.routing.allocation.same_shard.hostfalseAllows to check for allocating multiple instances of the same shard on a single host
cluster.routing.rebalance.enableallEnable or disable rebalancing of specific kinds of shards
cluster.routing.allocation.allow_rebalanceindices_all_activeSpecifies when shard rebalancing is allowed
cluster.routing.allocation.cluster_concurrent_rebalance2Allows control of how many concurrent shard rebalances are allowed for the cluster-wide
cluster.routing.allocation.balance.shard0.45fDefines the weight factor for the total number of shards allocated on the node (floating point number)
cluster.routing.allocation.balance.index0.55fDefines the weight factor for the number of shards of each index allocated on a specific node (floating point number)
cluster.routing.allocation.balance.threshold1.0fThe minimum optimization value (non-negative floating point number) for the action should be performed
cluster.routing.allocation.disk.threshold_enabledtrueSet to false to disable the disk allocation decider
cluster.routing.allocation.disk.watermark.low85%Controls the low watermark of disk usage, default 85%. Beyond that, ES will not allocate new shards to the node
cluster.routing.allocation.disk.watermark.high90%Controls the high watermark, default 90%. Beyond that, ES will try to relocate shards to another node
cluster.routing.allocation.disk.watermark.flood_stage95%Controls flood stage, default 95%, beyond which ES forces a read-only index block on each index of one or multiple shards allocated on a node where at least one disk is exceeded. Once there is enough disk space available for index operations to continue, the index block must be manually released
cluster.info.update.interval30sES should check the disk usage of each node in the cluster
cluster.routing.allocation.disk.include_relocationstrueES will consider the shards currently being relocated to the target node when calculating the disk usage of the node
cluster.routing.allocation.awareness.attributes.*Shard allocation awareness settings allow you to tell ES about your hardware configuration
cluster.routing.allocation.include.{attribute}Allocate shards to nodes with at least one comma-separated value for {attribute}, attribute could be _name, _ip, _host
cluster.routing.allocation.require.{attribute}Only assign shards to nodes that have all comma-separated values for {attribute}, attribute might be _name, _ip, _host
cluster.routing.allocation.exclude.{attribute}Don’t assign shards to nodes without the comma-separated values for {attribute}, attribute might be _name, _ip, _host
cluster.blocks.read_onlyfalseMakes the entire cluster read-only (index does not accept write operations), data is not allowed to be modified (create or delete the index)
cluster.blocks.read_only_allow_deletefalseThe same as cluster.blocks.read_only, but allows index deletion to free up resources
cluster.indices.tombstones.size500The cluster status maintains index tombstones to explicitly represent deleted indexes
logger.org.elasticsearch.indices.recoveryINFOLog recording level
discovery.zen.ping.unicast.hosts.resolve_timeout5sWait time for DNS lookup before each round of ping
discovery.zen.ping_timeout3sPing timeout time
discovery.zen.join_timeout60sDefault timeout is 20 times the ping timeout
discovery.zen.minimum_master_nodesN/2 + 1Minimum number of master node qualifications, N is the number of master nodes
discovery.zen.no_master_blockwriteA setting that controls which operations should be rejected when there is no active master node, default is write
indices.breaker.total.limit70%Starting limit of the overall parent breaker, default is 70% of JVM heap
indices.breaker.fielddata.limit60%Limit of the fielddata breaker, default is 60% of JVM heap
indices.breaker.fielddata.overhead1.03A constant, all fielddata estimates are multiplied to decide the final estimate
indices.breaker.request.limit60%Limit of the request breaker, default is 60% of JVM heap
indices.breaker.request.overhead1A constant, all request estimates are multiplied to decide the final estimate
network.breaker.inflight_requests.limit100%Limit of the inflight_requests breaker, default is 100% of JVM heap
network.breaker.inflight_requests.overhead1A constant, all inflight requests estimates are multiplied to decide the final
script.max_compilations_rate75/5mLimit of the number of unique dynamic scripts allowed to be compiled within a certain interval
index.requests.cache.enabletrueEnable or disable index cache
indices.recovery.max_bytes_per_sec40mbMaximum bandwidth for data transmission between nodes
indices.store.throttle.max_bytes_per_sec20mbMaximum bandwidth for writing to disk
index.merge.scheduler.max_thread_countMaximum number of threads for index merge, default is max(1, min(4, availableProcessors / 2))
index.number_of_replicas1Number of replicas each primary shard has
index.auto_expand_replicasdefault is false (i.e, disabled)Automatically expands the number of replicas according to the number of available nodes. Set to a range delimited by a hyphen for the lower and upper limit (e.g., 0-5)
index.refresh_interval1sHow often to perform a refresh operation, which makes the recent changes to the index visible for search. Can be set to -1 to disable refresh
index.max_result_window10000The maximum value of from + size for searching the index
index.max_inner_result_window100The maximum value of from + size for internal hits defined and top aggregated to this index
index.max_rescore_window10000Maximum window_size for rescore requests used for searching this index. Default is index.max_result_window
index.max_docvalue_fields_search100Maximum number of docvalue_fields_allowed in a query
index.max_script_fields32Maximum number of script_fields allowed in a query
index.max_ngram_diff1Maximum allowed difference between min_gram and max_gram for NGramTokenizer and NGramTokenFilter
index.max_shingle_diff3Maximum allowed difference between max_shingle_size and min_shingle_size
index.blocks.read_onlyfalseSet to true to make the index and index data read-only, otherwise allow write and data changes
index.blocks.read_only_allow_deletefalseThe same as index.blocks.read_only, but allows index deletion to free up resources
index.blocks.readfalseSet to true to disallow read operations on the index
index.blocks.writefalseSet to true to disallow write operations on the index
index.blocks.metadatafalseSet to true to disable reading and writing of index data
index.max_refresh_listenersThe maximum number of refresh listeners available on each shard of the index. These listeners are used to implement refresh = wait_for