Name: ansible-role-elasticsearch
Owner: npm
Description: Ansible Role - Installs and configures Elasticsearch (forked from Traakr)
Forked from: mediapeers/ansible-role-elasticsearch
Created: 2016-10-28 23:33:37.0
Updated: 2018-01-22 18:47:49.0
Pushed: 2017-01-30 21:53:16.0
Size: 102
Language: Ruby
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This is an Ansible role for Elasticsearch.
Note: Not tested with Elasticsearch versions below 1.5.2
See vars/sample.yml
and vars/vagrant.yml
for exmaple variable files.
These are the files where you specify Elasticsearch settings and apply certain features such as plugins,
custom JARs or monitoring. The best way to enable configurations is to look at templates/elasticsearch.yml.j2
and see which variables you want to defile in your vars/my-vars.yml
.
See below for configurations regarding EC2, plugins and custom JARs.
The following variables need to be defined in your playbook or inventory:
See https://github.com/elasticsearch/elasticsearch-cloud-aws for the version that most accurately matches your installation.
The following variables provide a for now limited configuration for the plugin. More options may be available in the future (see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-discovery-ec2.html):
You will need to define an array called elasticsearch_plugins
in your playbook or inventory, such that:
ticsearch_plugins:
name: '<plugin name>', url: '<[optional] plugin url>' }
..
where if you were to install the plugin via bin/plugin, you would type:
bin/plugin -install <plugin name>
or bin/plugin -install <plugin name> -url <plugin url>
Example for https://github.com/elasticsearch/elasticsearch-mapper-attachments
(bin/plugin -install elasticsearch/elasticsearch-mapper-attachments/1.9.0
):
ticsearch_plugins:
name: 'elasticsearch/elasticsearch-mapper-attachments/1.9.0' }
Example for https://github.com/richardwilly98/elasticsearch-river-mongodb
(bin/plugin -i com.github.richardwilly98.elasticsearch/elasticsearch-river-mongodb/1.7.1
):
ticsearch_plugins:
name: 'com.github.richardwilly98.elasticsearch/elasticsearch-river-mongodb/1.7.1' }
Example for https://github.com/imotov/elasticsearch-facet-script
(bin/plugin -install facet-script -url http://dl.bintray.com/content/imotov/elasticsearch-plugins/elasticsearch-facet-script-1.1.2.zip
):
ticsearch_plugins:
name: 'facet-script', url: 'http://dl.bintray.com/content/imotov/elasticsearch-plugins/elasticsearch-facet-script-1.1.2.zip' }
Custom jars are made available to the Elasticsearch classpath by being downloaded into the elasticsearch_home_dir/lib folder.
An example of a custom jar can include a custom Lucene Similarity Provider. You will need to define an array called elasticsearch_custom_jars
in your playbook or inventory, such that:
ticsearch_custom_jars:
uri: '<URL where JAR can be downloaded from: required>', filename: '<alternative name for final JAR if different from file downladed: leave blank to use same filename>', user: '<BASIC auth username: leave blank of not needed>', passwd: '<BASIC auth password: leave blank of not needed>' }
..
Elasticsearch thread pools can be configured using the elasticsearch_thread_pools
list variable:
ticsearch_thread_pools:
"threadpool.bulk.type: fixed"
"threadpool.bulk.size: 50"
"threadpool.bulk.queue_size: 1000"
Enable the SPM task in your playbook:
s:
- include: tasks/spm.yml
- ...
Set the spm_client_token variable in your inventory.ini to your SPM key.
The following variables need to be defined in your playbook or inventory:
The following variables provide configuration for the plugin. More options may be available in the future (see http://www.elasticsearch.org/guide/en/marvel/current/#stats-export):
If you prefer to skip the built-in installation of the Oracle JRE, use the elasticsearch_install_java
flag:
ticsearch_install_java: "false"
Checkout this project as a submodule under roles/:
it submodule add git@github.com:mediapeers/ansible-role-elasticsearch.git roles/mediapeers.elasticsearch
Example playbook setup:
sts: all_nodes
er: ubuntu
do: yes
les:
- mediapeers.elasticsearch
rs_files:
- vars/my-vars.yml
This software is provided as is. Having said that, if you see an issue, feel free to log a ticket. No guarantees are made that any requested feature will be implemented. If you'd like to contribute, feel free to clone and submit a pull request.
None
MIT
George Stathis - gstathis [at] traackr.com