b82eb1b393
In the spirit of Kolla-Ansible, we generally try to provide workable defaults. The default for Elasticsearch curator schedule was fine except for multinode deploys where it would cause all nodes to run at the same time producing broken runs (race condition in the get-delete cycle). It is easy to improve this situation by embracing poor-man's reimplementation of keystone's fernet key rotation schedule. ES Curator does not need all the complexity of the former so it can be handled very well by shifting by as many hours as the instance's index dictates. It should rarely if ever need more time (most likely still in minutes range rather than hours). Change-Id: I9d6758c8550308d13d936de1a14afbe4124e593b
102 lines
4.3 KiB
YAML
102 lines
4.3 KiB
YAML
---
|
|
project_name: "elasticsearch"
|
|
|
|
elasticsearch_services:
|
|
elasticsearch:
|
|
container_name: elasticsearch
|
|
group: elasticsearch
|
|
enabled: true
|
|
image: "{{ elasticsearch_image_full }}"
|
|
environment:
|
|
ES_JAVA_OPTS: "{{ es_java_opts }}"
|
|
volumes: "{{ elasticsearch_default_volumes + elasticsearch_extra_volumes }}"
|
|
dimensions: "{{ elasticsearch_dimensions }}"
|
|
haproxy:
|
|
elasticsearch:
|
|
enabled: "{{ enable_elasticsearch }}"
|
|
mode: "http"
|
|
external: false
|
|
port: "{{ elasticsearch_port }}"
|
|
frontend_http_extra:
|
|
- "option dontlog-normal"
|
|
elasticsearch-curator:
|
|
container_name: elasticsearch_curator
|
|
group: elasticsearch-curator
|
|
enabled: "{{ enable_elasticsearch_curator }}"
|
|
image: "{{ elasticsearch_curator_image_full }}"
|
|
volumes: "{{ elasticsearch_curator_default_volumes + elasticsearch_curator_extra_volumes }}"
|
|
dimensions: "{{ elasticsearch_curator_dimensions }}"
|
|
|
|
|
|
####################
|
|
# Elasticsearch
|
|
####################
|
|
elasticsearch_cluster_name: "kolla_logging"
|
|
es_heap_size: "1g"
|
|
es_java_opts: "{% if es_heap_size %}-Xms{{ es_heap_size }} -Xmx{{ es_heap_size }}{%endif%}"
|
|
|
|
#######################
|
|
# Elasticsearch Curator
|
|
#######################
|
|
|
|
# Helper variable used to define the default hour Curator runs to avoid
|
|
# simultaneous runs in multinode deployments.
|
|
elasticsearch_curator_instance_id: "{{ groups['elasticsearch-curator'].index(inventory_hostname) }}"
|
|
|
|
# How frequently Curator runs.
|
|
# For multinode deployments of Curator you should ensure each node has
|
|
# a different schedule so that Curator does not run simultaneously on
|
|
# multiple nodes. Use hostvars or parameterize like in the default
|
|
# below.
|
|
# The default depends on Curator's id as defined above which dictates
|
|
# the daily hour the schedule runs (0, 1, etc.).
|
|
elasticsearch_curator_cron_schedule: "0 {{ elasticsearch_curator_instance_id }} * * *"
|
|
|
|
# When set to True, Curator will not modify Elasticsearch data, but
|
|
# will print what it *would* do to the Curator log file. This is a
|
|
# useful way of checking that Curator actions are working as expected.
|
|
elasticsearch_curator_dry_run: false
|
|
|
|
# Index prefix pattern. Any indices matching this regex will
|
|
# be managed by Curator.
|
|
elasticsearch_curator_index_pattern: "^{{ 'monasca' if enable_monasca|bool else kibana_log_prefix }}-.*"
|
|
|
|
# Duration after which an index is staged for deletion. This is
|
|
# implemented by closing the index. Whilst in this state the index
|
|
# contributes negligible load on the cluster and may be manually
|
|
# re-opened if required.
|
|
elasticsearch_curator_soft_retention_period_days: 30
|
|
|
|
# Duration after which an index is permanently erased from the cluster.
|
|
elasticsearch_curator_hard_retention_period_days: 60
|
|
|
|
####################
|
|
# Docker
|
|
####################
|
|
elasticsearch_install_type: "{{ kolla_install_type }}"
|
|
elasticsearch_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ elasticsearch_install_type }}-elasticsearch"
|
|
elasticsearch_tag: "{{ openstack_tag }}"
|
|
elasticsearch_image_full: "{{ elasticsearch_image }}:{{ elasticsearch_tag }}"
|
|
|
|
elasticsearch_curator_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ elasticsearch_install_type }}-elasticsearch-curator"
|
|
elasticsearch_curator_tag: "{{ openstack_tag }}"
|
|
elasticsearch_curator_image_full: "{{ elasticsearch_curator_image }}:{{ elasticsearch_curator_tag }}"
|
|
|
|
elasticsearch_dimensions: "{{ default_container_dimensions }}"
|
|
elasticsearch_curator_dimensions: "{{ default_container_dimensions }}"
|
|
|
|
elasticsearch_default_volumes:
|
|
- "{{ node_config_directory }}/elasticsearch/:{{ container_config_directory }}/"
|
|
- "/etc/localtime:/etc/localtime:ro"
|
|
- "{{ '/etc/timezone:/etc/timezone:ro' if kolla_base_distro in ['debian', 'ubuntu'] else '' }}"
|
|
- "{{ elasticsearch_datadir_volume }}:/var/lib/elasticsearch/data"
|
|
- "kolla_logs:/var/log/kolla/"
|
|
elasticsearch_curator_default_volumes:
|
|
- "{{ node_config_directory }}/elasticsearch-curator/:{{ container_config_directory }}/"
|
|
- "/etc/localtime:/etc/localtime:ro"
|
|
- "{{ '/etc/timezone:/etc/timezone:ro' if kolla_base_distro in ['debian', 'ubuntu'] else '' }}"
|
|
- "kolla_logs:/var/log/kolla"
|
|
|
|
elasticsearch_extra_volumes: "{{ default_extra_volumes }}"
|
|
elasticsearch_curator_extra_volumes: "{{ default_extra_volumes }}"
|