blob: fcea2a99407b472bfb99b96642d8e6ab38452cc9 [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
98
99#################################### Index ####################################
100
101# You can set a number of options (such as shard/replica options, mapping
102# or analyzer definitions, translog settings, ...) for indices globally,
103# in this file.
104#
105# Note, that it makes more sense to configure index settings specifically for
106# a certain index, either when creating it or by using the index templates API.
107#
108# See <http://elasticsearch.org/guide/en/elasticsearch/reference/current/index-modules.html> and
109# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/indices-create-index.html>
110# for more information.
111
112# Set the number of shards (splits) of an index (5 by default):
113#
Filip Pytloun63c8c252016-05-05 16:14:02 +0200114index.number_of_shards: {{ server.get('index', {}).get('shards', 5) }}
Filip Pytloun5163dfb2015-10-06 16:28:31 +0200115
116# Set the number of replicas (additional copies) of an index (1 by default):
117#
Filip Pytloun63c8c252016-05-05 16:14:02 +0200118index.number_of_replicas: {{ server.get('index', {}).get('replicas', 1) }}
Filip Pytloun5163dfb2015-10-06 16:28:31 +0200119
120# Note, that for development on a local machine, with small indices, it usually
121# makes sense to "disable" the distributed features:
122#
123# index.number_of_shards: 1
124# index.number_of_replicas: 0
125
126# These settings directly affect the performance of index and search operations
127# in your cluster. Assuming you have enough machines to hold shards and
128# replicas, the rule of thumb is:
129#
130# 1. Having more *shards* enhances the _indexing_ performance and allows to
131# _distribute_ a big index across machines.
132# 2. Having more *replicas* enhances the _search_ performance and improves the
133# cluster _availability_.
134#
135# The "number_of_shards" is a one-time setting for an index.
136#
137# The "number_of_replicas" can be increased or decreased anytime,
138# by using the Index Update Settings API.
139#
140# Elasticsearch takes care about load balancing, relocating, gathering the
141# results from nodes, etc. Experiment with different settings to fine-tune
142# your setup.
143
144# Use the Index Status API (<http://localhost:9200/A/_status>) to inspect
145# the index status.
146
147
148#################################### Paths ####################################
149
150# Path to directory containing configuration (this file and logging.yml):
151#
152# path.conf: /path/to/conf
153
154# Path to directory where to store index data allocated for this node.
155#
156# path.data: /path/to/data
157#
158# Can optionally include more than one location, causing data to be striped across
159# the locations (a la RAID 0) on a file level, favouring locations with most free
160# space on creation. For example:
161#
162# path.data: /path/to/data1,/path/to/data2
163
164# Path to temporary files:
165#
166# path.work: /path/to/work
167
168# Path to log files:
169#
170# path.logs: /path/to/logs
171
172# Path to where plugins are installed:
173#
174# path.plugins: /path/to/plugins
175
176
177#################################### Plugin ###################################
178
179# If a plugin listed here is not installed for current node, the node will not start.
180#
181# plugin.mandatory: mapper-attachments,lang-groovy
182
183
184################################### Memory ####################################
185
186# Elasticsearch performs poorly when JVM starts swapping: you should ensure that
187# it _never_ swaps.
188#
189# Set this property to true to lock the memory:
190#
191# bootstrap.mlockall: true
192
193# Make sure that the ES_MIN_MEM and ES_MAX_MEM environment variables are set
194# to the same value, and that the machine has enough memory to allocate
195# for Elasticsearch, leaving enough memory for the operating system itself.
196#
197# You should also make sure that the Elasticsearch process is allowed to lock
198# the memory, eg. by using `ulimit -l unlimited`.
199
200
201############################## Network And HTTP ###############################
202
203# Elasticsearch, by default, binds itself to the 0.0.0.0 address, and listens
204# on port [9200-9300] for HTTP traffic and on port [9300-9400] for node-to-node
205# communication. (the range means that if the port is busy, it will automatically
206# try the next port).
207
208# Set the bind address specifically (IPv4 or IPv6):
209#
210#
211network.bind_host: {{ server.bind.address }}
212http.port: {{ server.bind.port }}
213http.enabled: true
214# Set the address other nodes will use to communicate with this node. If not
215# set, it is automatically derived. It must point to an actual IP address.
216#
Filip Pytloun63c8c252016-05-05 16:14:02 +0200217{%- if server.publish_host is defined %}
218network.publish_host: {{ server.publish_host }}
219{%- endif %}
Filip Pytloun5163dfb2015-10-06 16:28:31 +0200220
221# Set both 'bind_host' and 'publish_host':
222#
223# network.host: 192.168.0.1
224
225# Set a custom port for the node to node communication (9300 by default):
226#
227# transport.tcp.port: 9300
228
229# Enable compression for all communication between nodes (disabled by default):
230#
231# transport.tcp.compress: true
232
233# Set a custom port to listen for HTTP traffic:
234#
235# http.port: 9200
236
237# Set a custom allowed content length:
238#
239# http.max_content_length: 100mb
240
241# Disable HTTP completely:
242#
243# http.enabled: false
244
245
246################################### Gateway ###################################
247
248# The gateway allows for persisting the cluster state between full cluster
249# restarts. Every change to the state (such as adding an index) will be stored
250# in the gateway, and when the cluster starts up for the first time,
251# it will read its state from the gateway.
252
253# There are several types of gateway implementations. For more information, see
254# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/modules-gateway.html>.
255
256# The default gateway type is the "local" gateway (recommended):
257#
258# gateway.type: local
259
260# Settings below control how and when to start the initial recovery process on
261# a full cluster restart (to reuse as much local data as possible when using shared
262# gateway).
263
264# Allow recovery process after N nodes in a cluster are up:
265#
266# gateway.recover_after_nodes: 1
267
268# Set the timeout to initiate the recovery process, once the N nodes
269# from previous setting are up (accepts time value):
270#
271# gateway.recover_after_time: 5m
272
273# Set how many nodes are expected in this cluster. Once these N nodes
274# are up (and recover_after_nodes is met), begin recovery process immediately
275# (without waiting for recover_after_time to expire):
276#
277# gateway.expected_nodes: 2
278
279
280############################# Recovery Throttling #############################
281
282# These settings allow to control the process of shards allocation between
283# nodes during initial recovery, replica allocation, rebalancing,
284# or when adding and removing nodes.
285
286# Set the number of concurrent recoveries happening on a node:
287#
288# 1. During the initial recovery
289#
290# cluster.routing.allocation.node_initial_primaries_recoveries: 4
291#
292# 2. During adding/removing nodes, rebalancing, etc
293#
294# cluster.routing.allocation.node_concurrent_recoveries: 2
295
296# Set to throttle throughput when recovering (eg. 100mb, by default 20mb):
297#
298# indices.recovery.max_bytes_per_sec: 20mb
299
300# Set to limit the number of open concurrent streams when
301# recovering a shard from a peer:
302#
303# indices.recovery.concurrent_streams: 5
304
305
306################################## Discovery ##################################
307
308# Discovery infrastructure ensures nodes can be found within a cluster
309# and master node is elected. Multicast discovery is the default.
310
311# Set to ensure a node sees N other master eligible nodes to be considered
312# operational within the cluster. Its recommended to set it to a higher value
313# than 1 when running more than 2 nodes in the cluster.
314#
315# discovery.zen.minimum_master_nodes: 1
316
317# Set the time to wait for ping responses from other nodes when discovering.
318# Set this option to a higher value on a slow or congested network
319# to minimize discovery failures:
320#
321# discovery.zen.ping.timeout: 3s
322
323# For more information, see
324# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/modules-discovery-zen.html>
325
326# Unicast discovery allows to explicitly control which nodes will be used
327# to discover the cluster. It can be used when multicast is not present,
328# or to restrict the cluster communication-wise.
329#
330# 1. Disable multicast discovery (enabled by default):
331#
Filip Pytloun63c8c252016-05-05 16:14:02 +0200332discovery.zen.ping.multicast.enabled: {{ server.get('cluster', {}).get('multicast', True)|lower }}
Filip Pytloun5163dfb2015-10-06 16:28:31 +0200333#
334# 2. Configure an initial list of master nodes in the cluster
335# to perform discovery when new nodes (master or data) are started:
336#
Filip Pytloun63c8c252016-05-05 16:14:02 +0200337{%- if server.get('cluster', {}).members is defined %}
338discovery.zen.ping.unicast.hosts: [{% for member in server.cluster.members %}"{{ member.host }}:{{ member.get('port', 9300) }}"{% if not loop.last %}, {% endif %}{% endfor %}]
339{%- endif %}
Filip Pytloun5163dfb2015-10-06 16:28:31 +0200340
341# EC2 discovery allows to use AWS EC2 API in order to perform discovery.
342#
343# You have to install the cloud-aws plugin for enabling the EC2 discovery.
344#
345# For more information, see
346# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/modules-discovery-ec2.html>
347#
348# See <http://elasticsearch.org/tutorials/elasticsearch-on-ec2/>
349# for a step-by-step tutorial.
350
351# GCE discovery allows to use Google Compute Engine API in order to perform discovery.
352#
353# You have to install the cloud-gce plugin for enabling the GCE discovery.
354#
355# For more information, see <https://github.com/elasticsearch/elasticsearch-cloud-gce>.
356
357# Azure discovery allows to use Azure API in order to perform discovery.
358#
359# You have to install the cloud-azure plugin for enabling the Azure discovery.
360#
361# For more information, see <https://github.com/elasticsearch/elasticsearch-cloud-azure>.
362
363################################## Slow Log ##################################
364
365# Shard level query and fetch threshold logging.
366
367#index.search.slowlog.threshold.query.warn: 10s
368#index.search.slowlog.threshold.query.info: 5s
369#index.search.slowlog.threshold.query.debug: 2s
370#index.search.slowlog.threshold.query.trace: 500ms
371
372#index.search.slowlog.threshold.fetch.warn: 1s
373#index.search.slowlog.threshold.fetch.info: 800ms
374#index.search.slowlog.threshold.fetch.debug: 500ms
375#index.search.slowlog.threshold.fetch.trace: 200ms
376
377#index.indexing.slowlog.threshold.index.warn: 10s
378#index.indexing.slowlog.threshold.index.info: 5s
379#index.indexing.slowlog.threshold.index.debug: 2s
380#index.indexing.slowlog.threshold.index.trace: 500ms
381
382################################## GC Logging ################################
383
384#monitor.jvm.gc.young.warn: 1000ms
385#monitor.jvm.gc.young.info: 700ms
386#monitor.jvm.gc.young.debug: 400ms
387
388#monitor.jvm.gc.old.warn: 10s
389#monitor.jvm.gc.old.info: 5s
390#monitor.jvm.gc.old.debug: 2s