diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index d190999fb1..10e816f3ed 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -112,6 +112,11 @@ docker_common_options: keepalived_virtual_router_id: "51" +####################### +# Elasticsearch Options +####################### +es_heap_size: "1G" + #################### # Networking options #################### diff --git a/ansible/roles/elasticsearch/defaults/main.yml b/ansible/roles/elasticsearch/defaults/main.yml index 4d7815c2d4..86d5ae9ae5 100644 --- a/ansible/roles/elasticsearch/defaults/main.yml +++ b/ansible/roles/elasticsearch/defaults/main.yml @@ -5,6 +5,8 @@ elasticsearch_services: group: elasticsearch enabled: true image: "{{ elasticsearch_image_full }}" + environment: + ES_HEAP_SIZE: "{{ es_heap_size }}" volumes: - "{{ node_config_directory }}/elasticsearch/:{{ container_config_directory }}/" - "/etc/localtime:/etc/localtime:ro" @@ -15,6 +17,7 @@ elasticsearch_services: # Elasticsearch #################### elasticsearch_cluster_name: "kolla_logging" +es_heap_size: "1g" #################### # Docker diff --git a/ansible/roles/elasticsearch/handlers/main.yml b/ansible/roles/elasticsearch/handlers/main.yml index b59917f5a2..a1a14ee082 100644 --- a/ansible/roles/elasticsearch/handlers/main.yml +++ b/ansible/roles/elasticsearch/handlers/main.yml @@ -11,6 +11,7 @@ common_options: "{{ docker_common_options }}" name: "{{ service.container_name }}" image: "{{ service.image }}" + environment: "{{ service.environment }}" volumes: "{{ service.volumes }}" when: - action != "config" diff --git a/ansible/roles/elasticsearch/tasks/config.yml b/ansible/roles/elasticsearch/tasks/config.yml index 47182787f5..e183d00bb0 100644 --- a/ansible/roles/elasticsearch/tasks/config.yml +++ b/ansible/roles/elasticsearch/tasks/config.yml @@ -40,6 +40,7 @@ name: "{{ item.value.container_name }}" image: "{{ item.value.image }}" volumes: "{{ item.value.volumes }}" + environment: "{{ item.value.environment }}" register: check_elasticsearch_containers when: - action != "config" diff --git a/ansible/roles/elasticsearch/templates/elasticsearch.yml.j2 b/ansible/roles/elasticsearch/templates/elasticsearch.yml.j2 index 9cc7d80437..d4e8fbc40d 100644 --- a/ansible/roles/elasticsearch/templates/elasticsearch.yml.j2 +++ b/ansible/roles/elasticsearch/templates/elasticsearch.yml.j2 @@ -17,3 +17,4 @@ path.conf: "/etc/elasticsearch" path.data: "/var/lib/elasticsearch/data" path.logs: "/var/log/kolla/elasticsearch" path.scripts: "/etc/elasticsearch/scripts" +indices.fielddata.cache.size: 40%