blob: 5c4bc3ed92c635f56e146811d7d1025ede5dbf15 [file] [log] [blame]
Filip Pytloun5163dfb2015-10-06 16:28:31 +02001{%- from "elasticsearch/map.jinja" import server with context %}
2
3##################### Elasticsearch Configuration Example #####################
4
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>.
8#
9# The installation procedure is covered at
10# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup.html>.
11#
12# Elasticsearch comes with reasonable defaults for most settings,
13# so you can try it out without bothering with configuration.
14#
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].
19
20# Any element in the configuration can be replaced with environment variables
21# by placing them in ${...} notation. For example:
22#
23# node.rack: ${RACK_ENV_VAR}
24
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>
27
28
29################################### Cluster ###################################
30
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.
33#
34# cluster.name: elasticsearch
Filip Pytloun63c8c252016-05-05 16:14:02 +020035{%- if server.get('cluster', {}).name is defined %}
36cluster.name: {{ server.cluster.name }}
Filip Pytloun5163dfb2015-10-06 16:28:31 +020037{% endif %}
38#################################### Node #####################################
39
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:
42#
43# node.name: "Franz Kafka"
Filip Pytloun465fa7a2016-05-05 14:39:30 +020044node.name: {{ server.get('name', '${HOSTNAME}') }}
Filip Pytloun5163dfb2015-10-06 16:28:31 +020045
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.
48#
49# Allow this node to be eligible as a master node (enabled by default):
50#
Filip Pytloun63c8c252016-05-05 16:14:02 +020051node.master: {{ server.get('master', True)|lower }}
Filip Pytloun5163dfb2015-10-06 16:28:31 +020052#
53# Allow this node to store data (enabled by default):
54#
Filip Pytloun63c8c252016-05-05 16:14:02 +020055node.data: {{ server.get('data', True)|lower }}
Filip Pytloun5163dfb2015-10-06 16:28:31 +020056
57# You can exploit these settings to design advanced cluster topologies.
58#
59# 1. You want this node to never become a master node, only to hold data.
60# This will be the "workhorse" of your cluster.
61#
62# node.master: false
63# node.data: true
64#
65# 2. You want this node to only serve as a master: to not store any data and
66# to have free resources. This will be the "coordinator" of your cluster.
67#
68# node.master: true
69# node.data: false
70#
71# 3. You want this node to be neither master nor data node, but
72# to act as a "search load balancer" (fetching data from nodes,
73# aggregating results, etc.)
74#
75# node.master: false
76# node.data: false
77
78# Use the Cluster Health API [http://localhost:9200/_cluster/health], the
79# Node Info API [http://localhost:9200/_nodes] or GUI tools
80# such as <http://www.elasticsearch.org/overview/marvel/>,
81# <http://github.com/karmi/elasticsearch-paramedic>,
82# <http://github.com/lukas-vlcek/bigdesk> and
83# <http://mobz.github.com/elasticsearch-head> to inspect the cluster state.
84
85# A node can have generic attributes associated with it, which can later be used
86# for customized shard allocation filtering, or allocation awareness. An attribute
87# is a simple key value pair, similar to node.key: value, here is an example:
88#
89# node.rack: rack314
Filip Pytloun63c8c252016-05-05 16:14:02 +020090{%- if server.rack is defined %}
91node.rack: {{ server.rack }}
92{%- endif %}
Filip Pytloun5163dfb2015-10-06 16:28:31 +020093
94# By default, multiple nodes are allowed to start from the same installation location
95# to disable it, set the following:
96# node.max_local_storage_nodes: 1
97
Guillaume Thouvenina4e640d2016-10-19 15:06:32 +020098{%- if server.get('threadpool', {}).get('bulk', {}).queue_size is defined %}
99# For bulk operations. Thread pool type is fixed with a size of # of available processors.
100threadpool.bulk.queue_size: {{ server.threadpool.bulk.queue_size }}
101{%- endif %}
Filip Pytloun5163dfb2015-10-06 16:28:31 +0200102
103#################################### Index ####################################
104
105# You can set a number of options (such as shard/replica options, mapping
106# or analyzer definitions, translog settings, ...) for indices globally,
107# in this file.
108#
109# Note, that it makes more sense to configure index settings specifically for
110# a certain index, either when creating it or by using the index templates API.
111#
112# See <http://elasticsearch.org/guide/en/elasticsearch/reference/current/index-modules.html> and
113# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/indices-create-index.html>
114# for more information.
115
116# Set the number of shards (splits) of an index (5 by default):
117#
Filip Pytloun63c8c252016-05-05 16:14:02 +0200118index.number_of_shards: {{ server.get('index', {}).get('shards', 5) }}
Filip Pytloun5163dfb2015-10-06 16:28:31 +0200119
120# Set the number of replicas (additional copies) of an index (1 by default):
121#
Filip Pytloun63c8c252016-05-05 16:14:02 +0200122index.number_of_replicas: {{ server.get('index', {}).get('replicas', 1) }}
Filip Pytloun5163dfb2015-10-06 16:28:31 +0200123
124# Note, that for development on a local machine, with small indices, it usually
125# makes sense to "disable" the distributed features:
126#
127# index.number_of_shards: 1
128# index.number_of_replicas: 0
129
130# These settings directly affect the performance of index and search operations
131# in your cluster. Assuming you have enough machines to hold shards and
132# replicas, the rule of thumb is:
133#
134# 1. Having more *shards* enhances the _indexing_ performance and allows to
135# _distribute_ a big index across machines.
136# 2. Having more *replicas* enhances the _search_ performance and improves the
137# cluster _availability_.
138#
139# The "number_of_shards" is a one-time setting for an index.
140#
141# The "number_of_replicas" can be increased or decreased anytime,
142# by using the Index Update Settings API.
143#
144# Elasticsearch takes care about load balancing, relocating, gathering the
145# results from nodes, etc. Experiment with different settings to fine-tune
146# your setup.
147
148# Use the Index Status API (<http://localhost:9200/A/_status>) to inspect
149# the index status.
150
151
152#################################### Paths ####################################
153
154# Path to directory containing configuration (this file and logging.yml):
155#
156# path.conf: /path/to/conf
157
158# Path to directory where to store index data allocated for this node.
159#
160# path.data: /path/to/data
Guillaume Thouvenin3a90b562016-10-20 15:03:56 +0200161{%- if server.get('path', {}).data is defined %}
162path.data = {{ server.path.data }}
163{%- endif %}
Filip Pytloun5163dfb2015-10-06 16:28:31 +0200164#
165# Can optionally include more than one location, causing data to be striped across
166# the locations (a la RAID 0) on a file level, favouring locations with most free
167# space on creation. For example:
168#
169# path.data: /path/to/data1,/path/to/data2
170
171# Path to temporary files:
172#
173# path.work: /path/to/work
174
175# Path to log files:
176#
177# path.logs: /path/to/logs
Guillaume Thouvenin3a90b562016-10-20 15:03:56 +0200178{%- if server.get('path', {}).logs is defined %}
179path.logs = {{ server.path.logs }}
180{%- endif %}
Filip Pytloun5163dfb2015-10-06 16:28:31 +0200181
182# Path to where plugins are installed:
183#
184# path.plugins: /path/to/plugins
Filip Pytloundf5209c2016-09-23 11:55:56 +0200185#
186{%- if server.snapshot is defined %}
187path.repo:
188 {%- for repo_name, repo in server.snapshot.iteritems() %}
189 - {{ repo.path }}
190 {%- endfor %}
191{%- endif %}
Filip Pytloun5163dfb2015-10-06 16:28:31 +0200192
193
194#################################### Plugin ###################################
195
196# If a plugin listed here is not installed for current node, the node will not start.
197#
198# plugin.mandatory: mapper-attachments,lang-groovy
199
200
201################################### Memory ####################################
202
203# Elasticsearch performs poorly when JVM starts swapping: you should ensure that
204# it _never_ swaps.
205#
206# Set this property to true to lock the memory:
207#
208# bootstrap.mlockall: true
Guillaume Thouvenina4e640d2016-10-19 15:06:32 +0200209{%- if server.mlockall is defined %}
210bootstrap.mlockall: {{ server.mlockall|lower }}
211{%- endif %}
Filip Pytloun5163dfb2015-10-06 16:28:31 +0200212
213# Make sure that the ES_MIN_MEM and ES_MAX_MEM environment variables are set
214# to the same value, and that the machine has enough memory to allocate
215# for Elasticsearch, leaving enough memory for the operating system itself.
216#
217# You should also make sure that the Elasticsearch process is allowed to lock
218# the memory, eg. by using `ulimit -l unlimited`.
219
220
221############################## Network And HTTP ###############################
222
223# Elasticsearch, by default, binds itself to the 0.0.0.0 address, and listens
224# on port [9200-9300] for HTTP traffic and on port [9300-9400] for node-to-node
225# communication. (the range means that if the port is busy, it will automatically
226# try the next port).
227
Guillaume Thouveninfc18d8c2016-10-20 14:52:25 +0200228# Set both 'bind_host' and 'publish_host':
Filip Pytloun5163dfb2015-10-06 16:28:31 +0200229#
Guillaume Thouveninfc18d8c2016-10-20 14:52:25 +0200230# network.host: 192.168.0.1
231
232{%- if server.get('bind', {}).address is defined %}
233network.host: {{ server.bind.address }}
234{%- endif %}
235
236# Set specifically the address other nodes will use to communicate with this
237# node. If not set, it is automatically derived. It must point to an actual
238# IP address.
Filip Pytloun63c8c252016-05-05 16:14:02 +0200239{%- if server.publish_host is defined %}
240network.publish_host: {{ server.publish_host }}
241{%- endif %}
Filip Pytloun5163dfb2015-10-06 16:28:31 +0200242
Filip Pytloun5163dfb2015-10-06 16:28:31 +0200243
244# Set a custom port for the node to node communication (9300 by default):
245#
246# transport.tcp.port: 9300
247
248# Enable compression for all communication between nodes (disabled by default):
249#
250# transport.tcp.compress: true
251
252# Set a custom port to listen for HTTP traffic:
253#
254# http.port: 9200
Guillaume Thouveninfc18d8c2016-10-20 14:52:25 +0200255{%- if server.get('bind', {}).port is defined %}
256http.port: {{ server.bind.port }}
257{%- endif %}
Filip Pytloun5163dfb2015-10-06 16:28:31 +0200258
259# Set a custom allowed content length:
260#
261# http.max_content_length: 100mb
262
Guillaume Thouvenina4c7ca12016-10-20 16:32:44 +0200263# Enable or disable cross-origin resource sharing
264{%- if server.get('cors', {}).enabled is defined %}
265http.cors.enabled: {{ server.cors.enabled|lower }}
266{%- endif %}
267
268# Which origins to allow.
269{%- if server.get('cors', {}).allow_origin is defined %}
270http.cors.allow-origin: {{ server.cors.allow_origin }}
271{%- endif %}
272
Filip Pytloun5163dfb2015-10-06 16:28:31 +0200273# Disable HTTP completely:
274#
275# http.enabled: false
Guillaume Thouveninfc18d8c2016-10-20 14:52:25 +0200276http.enabled: true
Filip Pytloun5163dfb2015-10-06 16:28:31 +0200277
278
279################################### Gateway ###################################
280
281# The gateway allows for persisting the cluster state between full cluster
282# restarts. Every change to the state (such as adding an index) will be stored
283# in the gateway, and when the cluster starts up for the first time,
284# it will read its state from the gateway.
285
286# There are several types of gateway implementations. For more information, see
287# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/modules-gateway.html>.
288
289# The default gateway type is the "local" gateway (recommended):
290#
291# gateway.type: local
292
293# Settings below control how and when to start the initial recovery process on
294# a full cluster restart (to reuse as much local data as possible when using shared
295# gateway).
296
297# Allow recovery process after N nodes in a cluster are up:
298#
299# gateway.recover_after_nodes: 1
Guillaume Thouvenin4b6b1072016-10-20 14:55:24 +0200300{%- if server.get('gateway', {}).recover_after_nodes is defined %}
301gateway.recover_after_nodes: {{ server.gateway.recover_after_nodes }}
302{%- endif %}
Filip Pytloun5163dfb2015-10-06 16:28:31 +0200303
304# Set the timeout to initiate the recovery process, once the N nodes
305# from previous setting are up (accepts time value):
306#
307# gateway.recover_after_time: 5m
Guillaume Thouvenin4b6b1072016-10-20 14:55:24 +0200308{%- if server.get('gateway', {}).recover_after_time is defined %}
309gateway.recover_after_time: {{ server.gateway.recover_after_time }}
310{%- endif %}
Filip Pytloun5163dfb2015-10-06 16:28:31 +0200311
312# Set how many nodes are expected in this cluster. Once these N nodes
313# are up (and recover_after_nodes is met), begin recovery process immediately
314# (without waiting for recover_after_time to expire):
315#
316# gateway.expected_nodes: 2
Guillaume Thouvenin4b6b1072016-10-20 14:55:24 +0200317{%- if server.get('gateway', {}).expected_nodes is defined %}
318gateway.expected_nodes: {{ server.gateway.expected_nodes }}
319{%- endif %}
Filip Pytloun5163dfb2015-10-06 16:28:31 +0200320
321
322############################# Recovery Throttling #############################
323
324# These settings allow to control the process of shards allocation between
325# nodes during initial recovery, replica allocation, rebalancing,
326# or when adding and removing nodes.
327
328# Set the number of concurrent recoveries happening on a node:
329#
330# 1. During the initial recovery
331#
332# cluster.routing.allocation.node_initial_primaries_recoveries: 4
333#
334# 2. During adding/removing nodes, rebalancing, etc
335#
336# cluster.routing.allocation.node_concurrent_recoveries: 2
337
338# Set to throttle throughput when recovering (eg. 100mb, by default 20mb):
339#
340# indices.recovery.max_bytes_per_sec: 20mb
341
342# Set to limit the number of open concurrent streams when
343# recovering a shard from a peer:
344#
345# indices.recovery.concurrent_streams: 5
346
347
348################################## Discovery ##################################
349
350# Discovery infrastructure ensures nodes can be found within a cluster
351# and master node is elected. Multicast discovery is the default.
352
353# Set to ensure a node sees N other master eligible nodes to be considered
354# operational within the cluster. Its recommended to set it to a higher value
355# than 1 when running more than 2 nodes in the cluster.
356#
Filip Pytloun6c815a92016-06-28 21:49:00 +0200357discovery.zen.minimum_master_nodes: {{ server.get('cluster', {}).minimum_master_nodes|default(1) }}
Filip Pytloun5163dfb2015-10-06 16:28:31 +0200358
359# Set the time to wait for ping responses from other nodes when discovering.
360# Set this option to a higher value on a slow or congested network
361# to minimize discovery failures:
362#
363# discovery.zen.ping.timeout: 3s
364
365# For more information, see
366# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/modules-discovery-zen.html>
367
368# Unicast discovery allows to explicitly control which nodes will be used
369# to discover the cluster. It can be used when multicast is not present,
370# or to restrict the cluster communication-wise.
371#
372# 1. Disable multicast discovery (enabled by default):
373#
Filip Pytloun63c8c252016-05-05 16:14:02 +0200374discovery.zen.ping.multicast.enabled: {{ server.get('cluster', {}).get('multicast', True)|lower }}
Filip Pytloun5163dfb2015-10-06 16:28:31 +0200375#
376# 2. Configure an initial list of master nodes in the cluster
377# to perform discovery when new nodes (master or data) are started:
378#
Filip Pytloun63c8c252016-05-05 16:14:02 +0200379{%- if server.get('cluster', {}).members is defined %}
380discovery.zen.ping.unicast.hosts: [{% for member in server.cluster.members %}"{{ member.host }}:{{ member.get('port', 9300) }}"{% if not loop.last %}, {% endif %}{% endfor %}]
381{%- endif %}
Filip Pytloun5163dfb2015-10-06 16:28:31 +0200382
383# EC2 discovery allows to use AWS EC2 API in order to perform discovery.
384#
385# You have to install the cloud-aws plugin for enabling the EC2 discovery.
386#
387# For more information, see
388# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/modules-discovery-ec2.html>
389#
390# See <http://elasticsearch.org/tutorials/elasticsearch-on-ec2/>
391# for a step-by-step tutorial.
392
393# GCE discovery allows to use Google Compute Engine API in order to perform discovery.
394#
395# You have to install the cloud-gce plugin for enabling the GCE discovery.
396#
397# For more information, see <https://github.com/elasticsearch/elasticsearch-cloud-gce>.
398
399# Azure discovery allows to use Azure API in order to perform discovery.
400#
401# You have to install the cloud-azure plugin for enabling the Azure discovery.
402#
403# For more information, see <https://github.com/elasticsearch/elasticsearch-cloud-azure>.
404
405################################## Slow Log ##################################
406
407# Shard level query and fetch threshold logging.
408
409#index.search.slowlog.threshold.query.warn: 10s
410#index.search.slowlog.threshold.query.info: 5s
411#index.search.slowlog.threshold.query.debug: 2s
412#index.search.slowlog.threshold.query.trace: 500ms
413
414#index.search.slowlog.threshold.fetch.warn: 1s
415#index.search.slowlog.threshold.fetch.info: 800ms
416#index.search.slowlog.threshold.fetch.debug: 500ms
417#index.search.slowlog.threshold.fetch.trace: 200ms
418
419#index.indexing.slowlog.threshold.index.warn: 10s
420#index.indexing.slowlog.threshold.index.info: 5s
421#index.indexing.slowlog.threshold.index.debug: 2s
422#index.indexing.slowlog.threshold.index.trace: 500ms
423
424################################## GC Logging ################################
425
426#monitor.jvm.gc.young.warn: 1000ms
427#monitor.jvm.gc.young.info: 700ms
428#monitor.jvm.gc.young.debug: 400ms
429
430#monitor.jvm.gc.old.warn: 10s
431#monitor.jvm.gc.old.info: 5s
432#monitor.jvm.gc.old.debug: 2s
Ilya Tyaptin8abef0d2016-12-21 14:02:25 +0400433
434{%- if server.script is mapping %}
435script: {{ server.script|yaml }}
436{%- endif %}