Skip to content

Ansible role to install and configure Elasticsearch 6.0 on RHEL/CentOS 7.

License

Notifications You must be signed in to change notification settings

genialis/ansible-elasticsearch-role

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elasticsearch

Ansible Role

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:

Requirements

This role requires Ansible 2.4 or higher.

Role Variables

Variables in defaults/main.yml:

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"
"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. _local_, _site_, since the variable is also used by Ansible which doesn't understand Elasticsearch's special syntax.

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

Variables in distribution-specific files under vars/:

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

Dependencies

None.

Example Playbook

- hosts: all

  vars:
    elasticsearch_data_dir: /mnt/fast_storage/elasticsearch

  roles:
    - ansible-elasticsearch-role

License

GPLv3

Author Information

Tadej Janež
Domen Blenkuš

About

Ansible role to install and configure Elasticsearch 6.0 on RHEL/CentOS 7.

Resources

License

Stars

Watchers

Forks

Packages

No packages published