Ansible role to install and configure Elasticsearch 6.x on RHEL/CentOS 7.
NOTE: This version of the role only supports Elasticsearch 6.x. To use the role with Elasticsearch 2.4 or 5.6, use version 1.0.0 or 2.0.0, respectively.
Main features:
- Installs Elasticsearch from upstream's RPM repositories.
- Upgrades Elastcisearch from version 5.x (if necessary).
- Configures Elasticsearch according to the official Elasticsearch Reference for version 6.0
- Configures system's performance settings with Tuned if it is enabled (default for RHEL/CentOS 7).
- Validates important Elasticsearch system and JVM configuration.
This role requires Ansible 2.4 or higher.
Name | Type | Description | Default |
---|---|---|---|
elasticsearch_data_dir |
string | Path of Elasticsearch data directory. For more information, see: Configuring Elasticsearch. |
/var/lib/elasticsearch |
elasticsearch_log_dir |
string | Path of Elasticsearch log directory. For more information, see: Configuring Elasticsearch. |
/var/log/elasticsearch |
elasticsearch_version |
string | Major version to install. The actual version that is installed is the latest minor (and patch) version of the chosen major version. It can be one of the following:
|
"6" |
elasticsearch_sysctl_file |
string | Path of Elasticsearch's sysctl configuration file. NOTE: It should be in one of the locations that are searched for by the systemd-sysctl.service. For more information, see sysctl.d's man page. |
/etc/sysctl.d/00-elasticsearch.conf |
elasticsearch_heap_size_mem_frac |
float | Fraction of total system memory to use for JVM's heap. NOTE: Before changing this value, read the documentation on setting heap size. Regardless of the chosen fraction value, the minimal and maximal heap sizes are 256 MB and 31 GB (respectively). |
0.5 |
elasticsearch_cluster_name |
string | Name of Elasticsearch cluster. For more information, see: cluster.name documentation. NOTE: A node can only join a cluster when it shares the same cluster name with all other nodes in the cluster. |
elasticsearch |
elasticsearch_node_name |
string | Name of Elasticsearch node. For more information, see: node.name documentation. |
"{{ ansible_nodename }}" |
elasticsearch_network_host |
string | Name of host or IP address to bind to. For more information, see: network settings documentation. NOTE: One can't use special values,
e.g. |
localhost |
elasticsearch_http_port |
integer | Port to bind to. For more information, see: network settings documentation. |
9200 |
elasticsearch_discovery_zen_hosts |
list | List of nodes to contact initially to join a cluster. One can specify host names or IP addresses. For more information, see: network settings documentation. |
["127.0.0.1", "[::1]"] |
elasticsearch_only_one_node_per_system |
boolean | Limit Elasticsearch to one node per system. For more information, see: node.max_local_storage_nodes documentation. |
true |
elasticsearch_logging_to_file |
boolean | Save main logging events to a file. system. NOTE: Main logging events are always stored via systemd-journald.service. |
false |
Name | Type | Description | Default |
---|---|---|---|
elasticsearch_java_package |
string | Name of the package that provides a JVM. NOTE: Elasticsearch 6.0 requires Java 1.8. For more information, see: Product and JVM matrix. |
java-1.8.0-openjdk-headless |
None.
- hosts: all
vars:
elasticsearch_data_dir: /mnt/fast_storage/elasticsearch
roles:
- ansible-elasticsearch-role
GPLv3