1 {%- from "elasticsearch/map.jinja" import server with context %}
3 ##################### Elasticsearch Configuration Example #####################
5 # This file contains an overview of various configuration settings,
6 # targeted at operations staff. Application developers should
7 # consult the guide at <http://elasticsearch.org/guide>.
9 # The installation procedure is covered at
10 # <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup.html>.
12 # Elasticsearch comes with reasonable defaults for most settings,
13 # so you can try it out without bothering with configuration.
15 # Most of the time, these defaults are just fine for running a production
16 # cluster. If you're fine-tuning your cluster, or wondering about the
17 # effect of certain configuration option, please _do ask_ on the
18 # mailing list or IRC channel [http://elasticsearch.org/community].
20 # Any element in the configuration can be replaced with environment variables
21 # by placing them in ${...} notation. For example:
23 # node.rack: ${RACK_ENV_VAR}
25 # For information on supported formats and syntax for the config file, see
26 # <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup-configuration.html>
29 ################################### Cluster ###################################
31 # Cluster name identifies your cluster for auto-discovery. If you're running
32 # multiple clusters on the same network, make sure you're using unique names.
34 # cluster.name: elasticsearch
35 {%- if server.get('cluster', {}).name is defined %}
36 cluster.name: {{ server.cluster.name }}
38 #################################### Node #####################################
40 # Node names are generated dynamically on startup, so you're relieved
41 # from configuring them manually. You can tie this node to a specific name:
43 # node.name: "Franz Kafka"
44 node.name: {{ server.get('name', '${HOSTNAME}') }}
46 # Every node can be configured to allow or deny being eligible as the master,
47 # and to allow or deny to store the data.
49 # Allow this node to be eligible as a master node (enabled by default):
51 node.master: {{ server.get('master', True)|lower }}
53 # Allow this node to store data (enabled by default):
55 node.data: {{ server.get('data', True)|lower }}
56 node.ingest: {{ server.get('ingest', True)|lower }}
58 {%- if server.attrs is defined %}
59 {%- for name, values in server.attrs.iteritems() %}
60 {%- if values.get('enabled', True) %}
61 node.attr.{{ name }}: {{ values.get('value', True) | lower }}
65 # You can exploit these settings to design advanced cluster topologies.
67 # 1. You want this node to never become a master node, only to hold data.
68 # This will be the "workhorse" of your cluster.
73 # 2. You want this node to only serve as a master: to not store any data and
74 # to have free resources. This will be the "coordinator" of your cluster.
79 # 3. You want this node to be neither master nor data node, but
80 # to act as a "search load balancer" (fetching data from nodes,
81 # aggregating results, etc.)
86 # Use the Cluster Health API [http://localhost:9200/_cluster/health], the
87 # Node Info API [http://localhost:9200/_nodes] or GUI tools
88 # such as <http://www.elasticsearch.org/overview/marvel/>,
89 # <http://github.com/karmi/elasticsearch-paramedic>,
90 # <http://github.com/lukas-vlcek/bigdesk> and
91 # <http://mobz.github.com/elasticsearch-head> to inspect the cluster state.
93 # A node can have generic attributes associated with it, which can later be used
94 # for customized shard allocation filtering, or allocation awareness. An attribute
95 # is a simple key value pair, similar to node.key: value, here is an example:
98 {%- if server.rack is defined %}
99 node.rack: {{ server.rack }}
102 # By default, multiple nodes are allowed to start from the same installation location
103 # to disable it, set the following:
104 # node.max_local_storage_nodes: 1
106 {%- if server.get('threadpool', {}).get('bulk', {}).queue_size is defined %}
107 # For bulk operations. Thread pool type is fixed with a size of # of available processors.
108 thread_pool.bulk.queue_size: {{ server.threadpool.bulk.queue_size }}
111 ############################### Remote Search #################################
113 {%- if server.get("search", {}).get("remote", {}).connect is defined %}
114 search.remote.connect: {{ server.search.connect | lower }}
117 {%- if server.get("search", {}).get("remote", {}).attr is defined %}
118 search.remote.node.attr: {{ server.search.remote.attr }}
121 {%- if server.get("search", {}).get("remote", {}).clusters is defined %}
122 {%- for name, values in server.search.remote.clusters.iteritems() %}
123 {%- if values.get("enabled", True) %}
124 search.remote.{{ name }}.seeds: {{ values.seeds | json }}
129 #################################### Index ####################################
131 # You can set a number of options (such as shard/replica options, mapping
132 # or analyzer definitions, translog settings, ...) for indices globally,
135 # Note, that it makes more sense to configure index settings specifically for
136 # a certain index, either when creating it or by using the index templates API.
138 # See <http://elasticsearch.org/guide/en/elasticsearch/reference/current/index-modules.html> and
139 # <http://elasticsearch.org/guide/en/elasticsearch/reference/current/indices-create-index.html>
140 # for more information.
142 # Set the number of shards (splits) of an index (5 by default):
144 #index.number_of_shards: {{ server.get('index', {}).get('shards', 5) }}
146 # Set the number of replicas (additional copies) of an index (1 by default):
148 #index.number_of_replicas: {{ server.get('index', {}).get('replicas', 1) }}
150 # Note, that for development on a local machine, with small indices, it usually
151 # makes sense to "disable" the distributed features:
153 # index.number_of_shards: 1
154 # index.number_of_replicas: 0
156 # These settings directly affect the performance of index and search operations
157 # in your cluster. Assuming you have enough machines to hold shards and
158 # replicas, the rule of thumb is:
160 # 1. Having more *shards* enhances the _indexing_ performance and allows to
161 # _distribute_ a big index across machines.
162 # 2. Having more *replicas* enhances the _search_ performance and improves the
163 # cluster _availability_.
165 # The "number_of_shards" is a one-time setting for an index.
167 # The "number_of_replicas" can be increased or decreased anytime,
168 # by using the Index Update Settings API.
170 # Elasticsearch takes care about load balancing, relocating, gathering the
171 # results from nodes, etc. Experiment with different settings to fine-tune
174 # Use the Index Status API (<http://localhost:9200/A/_status>) to inspect
178 #################################### Paths ####################################
180 # Path to directory containing configuration (this file and log4j2.properties):
182 # path.conf: /path/to/conf
184 # Path to directory where to store index data allocated for this node.
186 # path.data: /path/to/data
187 path.data: {{ server.get('path', {}).get('data', '/var/lib/elasticsearch') }}
189 # Can optionally include more than one location, causing data to be striped across
190 # the locations (a la RAID 0) on a file level, favouring locations with most free
191 # space on creation. For example:
193 # path.data: /path/to/data1,/path/to/data2
195 # Path to temporary files:
197 # path.work: /path/to/work
201 # path.logs: /path/to/logs
202 path.logs: {{ server.get('path', {}).get('logs', '/var/log/elasticsearch') }}
204 # Path to where plugins are installed:
206 # path.plugins: /path/to/plugins
208 {%- if server.snapshot is defined %}
210 {%- for repo_name, repo in server.snapshot.iteritems() %}
216 #################################### Plugin ###################################
218 # If a plugin listed here is not installed for current node, the node will not start.
220 # plugin.mandatory: mapper-attachments,lang-groovy
223 ################################### Memory ####################################
225 # Elasticsearch performs poorly when JVM starts swapping: you should ensure that
228 # Set this property to true to lock the memory:
230 # bootstrap.mlockall: true
231 {%- if server.mlockall is defined %}
232 bootstrap.memory_lock: {{ server.mlockall|lower }}
235 # Make sure that the ES_MIN_MEM and ES_MAX_MEM environment variables are set
236 # to the same value, and that the machine has enough memory to allocate
237 # for Elasticsearch, leaving enough memory for the operating system itself.
239 # You should also make sure that the Elasticsearch process is allowed to lock
240 # the memory, eg. by using `ulimit -l unlimited`.
243 ############################## Network And HTTP ###############################
245 # Elasticsearch, by default, binds itself to the 0.0.0.0 address, and listens
246 # on port [9200-9300] for HTTP traffic and on port [9300-9400] for node-to-node
247 # communication. (the range means that if the port is busy, it will automatically
248 # try the next port).
250 # Set both 'bind_host' and 'publish_host':
252 # network.host: 192.168.0.1
254 {%- if server.get('bind', {}).address is defined %}
255 network.host: {{ server.bind.address }}
258 # Set specifically the address other nodes will use to communicate with this
259 # node. If not set, it is automatically derived. It must point to an actual
261 {%- if server.publish_host is defined %}
262 network.publish_host: {{ server.publish_host }}
266 # Set a custom port for the node to node communication (9300 by default):
268 # transport.tcp.port: 9300
269 {%- if server.get("transport", {}).get("tcp", {}).port is defined %}
270 transport.tcp.port: {{ server.transport.tcp.port }}
273 # Enable compression for all communication between nodes (disabled by default):
275 # transport.tcp.compress: true
276 {%- if server.get("transport", {}).get("tcp", {}).compress is defined %}
277 transport.tcp.compress: {{ server.transport.tcp.compress | lower }}
280 # Set a custom port to listen for HTTP traffic:
283 {%- if server.get('bind', {}).port is defined %}
284 http.port: {{ server.bind.port }}
287 # Set a custom allowed content length:
289 # http.max_content_length: 100mb
291 # Enable or disable cross-origin resource sharing
292 {%- if server.get('cors', {}).enabled is defined %}
293 http.cors.enabled: {{ server.cors.enabled|lower }}
296 # Which origins to allow.
297 {%- if server.get('cors', {}).allow_origin is defined %}
298 http.cors.allow-origin: {{ server.cors.allow_origin }}
301 # Disable HTTP completely:
303 # http.enabled: false
307 ################################### Gateway ###################################
309 # The gateway allows for persisting the cluster state between full cluster
310 # restarts. Every change to the state (such as adding an index) will be stored
311 # in the gateway, and when the cluster starts up for the first time,
312 # it will read its state from the gateway.
314 # There are several types of gateway implementations. For more information, see
315 # <http://elasticsearch.org/guide/en/elasticsearch/reference/current/modules-gateway.html>.
317 # The default gateway type is the "local" gateway (recommended):
319 # gateway.type: local
321 # Settings below control how and when to start the initial recovery process on
322 # a full cluster restart (to reuse as much local data as possible when using shared
325 # Allow recovery process after N nodes in a cluster are up:
327 # gateway.recover_after_nodes: 1
328 {%- if server.get('gateway', {}).recover_after_nodes is defined %}
329 gateway.recover_after_nodes: {{ server.gateway.recover_after_nodes }}
332 # Set the timeout to initiate the recovery process, once the N nodes
333 # from previous setting are up (accepts time value):
335 # gateway.recover_after_time: 5m
336 {%- if server.get('gateway', {}).recover_after_time is defined %}
337 gateway.recover_after_time: {{ server.gateway.recover_after_time }}
340 # Set how many nodes are expected in this cluster. Once these N nodes
341 # are up (and recover_after_nodes is met), begin recovery process immediately
342 # (without waiting for recover_after_time to expire):
344 # gateway.expected_nodes: 2
345 {%- if server.get('gateway', {}).expected_nodes is defined %}
346 gateway.expected_nodes: {{ server.gateway.expected_nodes }}
350 ############################# Recovery Throttling #############################
352 # These settings allow to control the process of shards allocation between
353 # nodes during initial recovery, replica allocation, rebalancing,
354 # or when adding and removing nodes.
356 # Set the number of concurrent recoveries happening on a node:
358 # 1. During the initial recovery
360 # cluster.routing.allocation.node_initial_primaries_recoveries: 4
362 # 2. During adding/removing nodes, rebalancing, etc
364 # cluster.routing.allocation.node_concurrent_recoveries: 2
366 # Set to throttle throughput when recovering (eg. 100mb, by default 20mb):
368 # indices.recovery.max_bytes_per_sec: 20mb
370 # Set to limit the number of open concurrent streams when
371 # recovering a shard from a peer:
373 # indices.recovery.concurrent_streams: 5
376 ################################## Discovery ##################################
378 # Discovery infrastructure ensures nodes can be found within a cluster
379 # and master node is elected. Multicast discovery is the default.
381 # Set to ensure a node sees N other master eligible nodes to be considered
382 # operational within the cluster. Its recommended to set it to a higher value
383 # than 1 when running more than 2 nodes in the cluster.
385 discovery.zen.minimum_master_nodes: {{ server.get('cluster', {}).minimum_master_nodes|default(1) }}
387 # Set the time to wait for ping responses from other nodes when discovering.
388 # Set this option to a higher value on a slow or congested network
389 # to minimize discovery failures:
391 # discovery.zen.ping.timeout: 3s
393 # For more information, see
394 # <http://elasticsearch.org/guide/en/elasticsearch/reference/current/modules-discovery-zen.html>
396 # Unicast discovery allows to explicitly control which nodes will be used
397 # to discover the cluster. It can be used when multicast is not present,
398 # or to restrict the cluster communication-wise.
400 # 1. Disable multicast discovery (enabled by default):
402 #discovery.zen.ping.multicast.enabled: {{ server.get('cluster', {}).get('multicast', True)|lower }}
404 # 2. Configure an initial list of master nodes in the cluster
405 # to perform discovery when new nodes (master or data) are started:
407 {%- if server.get('cluster', {}).members is defined %}
408 discovery.zen.ping.unicast.hosts: [{% for member in server.cluster.members %}"{{ member.host }}:{{ member.get('port', 9300) }}"{% if not loop.last %}, {% endif %}{% endfor %}]
411 # EC2 discovery allows to use AWS EC2 API in order to perform discovery.
413 # You have to install the cloud-aws plugin for enabling the EC2 discovery.
415 # For more information, see
416 # <http://elasticsearch.org/guide/en/elasticsearch/reference/current/modules-discovery-ec2.html>
418 # See <http://elasticsearch.org/tutorials/elasticsearch-on-ec2/>
419 # for a step-by-step tutorial.
421 # GCE discovery allows to use Google Compute Engine API in order to perform discovery.
423 # You have to install the cloud-gce plugin for enabling the GCE discovery.
425 # For more information, see <https://github.com/elasticsearch/elasticsearch-cloud-gce>.
427 # Azure discovery allows to use Azure API in order to perform discovery.
429 # You have to install the cloud-azure plugin for enabling the Azure discovery.
431 # For more information, see <https://github.com/elasticsearch/elasticsearch-cloud-azure>.
433 ################################## Slow Log ##################################
435 # Shard level query and fetch threshold logging.
437 #index.search.slowlog.threshold.query.warn: 10s
438 #index.search.slowlog.threshold.query.info: 5s
439 #index.search.slowlog.threshold.query.debug: 2s
440 #index.search.slowlog.threshold.query.trace: 500ms
442 #index.search.slowlog.threshold.fetch.warn: 1s
443 #index.search.slowlog.threshold.fetch.info: 800ms
444 #index.search.slowlog.threshold.fetch.debug: 500ms
445 #index.search.slowlog.threshold.fetch.trace: 200ms
447 #index.indexing.slowlog.threshold.index.warn: 10s
448 #index.indexing.slowlog.threshold.index.info: 5s
449 #index.indexing.slowlog.threshold.index.debug: 2s
450 #index.indexing.slowlog.threshold.index.trace: 500ms
452 ################################## GC Logging ################################
454 #monitor.jvm.gc.young.warn: 1000ms
455 #monitor.jvm.gc.young.info: 700ms
456 #monitor.jvm.gc.young.debug: 400ms
458 #monitor.jvm.gc.old.warn: 10s
459 #monitor.jvm.gc.old.info: 5s
460 #monitor.jvm.gc.old.debug: 2s
462 {%- if server.script is mapping %}
463 script: {{ server.script|yaml }}
466 ################################### X-Pack ###################################
468 xpack.ml.enabled: false
469 xpack.monitoring.enabled: false
470 xpack.security.enabled: false
471 xpack.security.audit.enabled: false
472 xpack.watcher.enabled: false