blob: 966b6b7174bf7ca866bde5fd2eac4acd6c2a2cdc [file] [log] [blame]
Filip Pytloun5163dfb2015-10-06 16:28:31 +02001
2=============
Ales Komarekdd881a62015-12-08 11:03:49 +01003Elasticsearch
Filip Pytloun5163dfb2015-10-06 16:28:31 +02004=============
5
Ales Komarekdd881a62015-12-08 11:03:49 +01006Elasticsearch provides a distributed, multitenant-capable full-text search engine with a HTTP web interface and schema-free JSON documents.
7
Filip Pytloun5163dfb2015-10-06 16:28:31 +02008Sample pillars
9==============
10
Filip Pytloun63c8c252016-05-05 16:14:02 +020011Single-node elasticsearch with clustering disabled:
12
Filip Pytloun5163dfb2015-10-06 16:28:31 +020013.. code-block:: yaml
14
15 elasticsearch:
16 server:
17 enabled: true
Filip Pytloun5163dfb2015-10-06 16:28:31 +020018 bind:
19 address: 0.0.0.0
20 port: 9200
Filip Pytloun63c8c252016-05-05 16:14:02 +020021 cluster:
22 multicast: false
23 index:
24 shards: 1
25 replicas: 0
26
Filip Pytloundf5209c2016-09-23 11:55:56 +020027Setup shared repository for snapshots:
28
29.. code-block:: bash
30
31 elasticsearch:
32 server:
33 snapshot:
34 reponame:
35 path: /var/lib/glusterfs/repo
36 compress: true
37
Filip Pytloun63c8c252016-05-05 16:14:02 +020038Cluster with manually defined members:
39
40.. code-block:: yaml
41
42 elasticsearch:
43 server:
44 enabled: true
45 bind:
46 address: 0.0.0.0
47 port: 9200
48 cluster:
49 multicast: false
50 members:
51 - host: elastic01
52 port: 9300
53 - host: elastic02
54 port: 9300
55 - host: elastic03
56 port: 9300
57 index:
58 shards: 5
59 replicas: 1
Filip Pytloun5163dfb2015-10-06 16:28:31 +020060
Filip Pytloun911588c2016-06-29 16:27:53 +020061Common definition for curator:
62
63.. code-block:: yaml
64
65 elasticsearch:
66 server:
67 curator:
68 timeout: 900
69 logfile: /var/log/elasticsearch/curator.log
70 logformat: json
Simon Pasquier0b138142016-12-02 09:56:08 +010071 master_only: true
Filip Pytloun911588c2016-06-29 16:27:53 +020072 actions:
73 - action: delete_indices
74 description: >-
75 Delete indices older than 45 days (based on index name).
76 Ignore the error if the filter does not result in an actionable
77 list of indices (ignore_empty_list) and exit cleanly.
78 options:
79 ignore_empty_list: True
80 continue_if_exception: False
81 disable_action: False
82 filters:
83 - filtertype: pattern
84 kind: regex
85 value: '.*\-\d\d\d\d\.\d\d\.\d\d$'
86 - filtertype: age
87 source: name
88 direction: older
89 timestring: '%Y.%m.%d'
90 unit: days
91 unit_count: 90
92 - action: replicas
93 description: >-
94 Reduce the replica count to 0 for indices older than 30 days
95 (based on index creation_date)
96 options:
97 count: 0
98 wait_for_completion: False
99 continue_if_exception: False
100 disable_action: False
101 filters:
102 - filtertype: pattern
103 kind: regex
104 value: '.*\-\d\d\d\d\.\d\d\.\d\d$'
105 - filtertype: age
106 source: creation_date
107 direction: older
108 unit: days
109 unit_count: 30
110 - action: forcemerge
111 description: >-
112 forceMerge indices older than 2 days (based on index
113 creation_date) to 2 segments per shard. Delay 120 seconds
114 between each forceMerge operation to allow the cluster to
115 quiesce.
116 This action will ignore indices already forceMerged to the same
117 or fewer number of segments per shard, so the 'forcemerged'
118 filter is unneeded.
119 options:
120 max_num_segments: 2
121 delay: 120
122 continue_if_exception: False
123 disable_action: True
124 filters:
125 - filtertype: pattern
126 kind: regex
127 value: '.*\-\d\d\d\d\.\d\d\.\d\d$'
128 - filtertype: age
129 source: creation_date
130 direction: older
131 unit: days
132 unit_count: 2
133
Guillaume Thouvenind39b3522016-11-17 10:49:58 +0100134Client setup
135------------
136
Guillaume Thouvenin126eef82016-11-17 15:59:28 +0100137Client with host and port:
Guillaume Thouvenind39b3522016-11-17 10:49:58 +0100138
139.. code-block:: yaml
140
141 elasticsearch:
142 client:
143 enabled: true
144 server:
145 host: elasticsearch.host
146 port: 9200
147
Guillaume Thouvenin126eef82016-11-17 15:59:28 +0100148Client where you download an index template that is stored in the direcotry
149*files/*:
150
151.. code-block:: yaml
152
153 elasticsearch:
154 client:
155 enabled: true
156 server:
157 host: elasticsearch.host
158 port: 9200
159 index:
160 my_index:
161 enabled: true
162 template: elasticsearch/files/my_index_template.json
163
Filip Pytloun5163dfb2015-10-06 16:28:31 +0200164Read more
165=========
166
Ales Komarekdd881a62015-12-08 11:03:49 +0100167
168* https://www.elastic.co/
Filip Pytloun5163dfb2015-10-06 16:28:31 +0200169* http://alex.nederlof.com/blog/2012/11/19/installing-elasticsearch-with-jenkins-on-ubuntu/
170* http://websightdesigns.com/wiki/Setting_up_Centralized_Event_Parsing_on_Ubuntu_12.04
171* https://gist.github.com/wingdspur/2026107