kolla-ansible/ansible/roles/common/templates/fluentd.json.j2
Krzysztof Klimonda 0c573062fc Make fluentd-elasticsearch configuration more robust
Enable reconnect_on_error option so that ES plugin re-establishes
a new session to the ES cluster on errors. Also, enable buffering
to the file, so that the buffer survives container restarts.

Co-Authored-By: Michal Nasiadka <mnasiadka@gmail.com>
Co-Authored-By: Radosław Piliszek <radoslaw.piliszek@gmail.com>
Co-Authored-By: Doug Szumski <doug@stackhpc.com>
Closes-Bug: #1830724
Change-Id: Ia40685b9d4fc02194e03c8791ddeb3d29d7f07f6
2019-12-09 13:38:36 +00:00

77 lines
2.6 KiB
Django/Jinja

{% set fluentd_user = fluentd_binary %}
{% set fluentd_dir = '/etc/' ~ fluentd_binary %}
{% if fluentd_binary == 'fluentd' %}
{% set fluentd_conf = 'fluent.conf' %}
{% if kolla_base_distro in ['ubuntu', 'debian'] %}
{% set fluentd_cmd = '/usr/local/bin/fluentd -c ' ~ fluentd_dir ~ '/' ~ fluentd_conf %}
{% else %}
{% set fluentd_cmd = '/usr/bin/fluentd -c ' ~ fluentd_dir ~ '/' ~ fluentd_conf %}
{% endif %}
{% elif fluentd_binary == 'td-agent' %}
{% set fluentd_conf = fluentd_binary ~ '.conf' %}
{% set fluentd_cmd = '/usr/sbin/td-agent' %}
{% endif %}
{
"command": "{{ fluentd_cmd }}",
"config_files": [
{
"source": "{{ container_config_directory }}/td-agent.conf",
"dest": "{{ fluentd_dir }}/{{ fluentd_conf }}",
"owner": "{{ fluentd_user }}",
"perm": "0600"
},
{# Copy all configuration files in input/ directory to include #}
{# custom input configs. #}
{
"source": "{{ container_config_directory }}/input/*.conf",
"dest": "{{ fluentd_dir }}/input/",
"owner": "{{ fluentd_user }}",
"perm": "0600"
},
{# Copy all configuration files in filter/ directory to include #}
{# custom filter configs. #}
{
"source": "{{ container_config_directory }}/filter/*.conf",
"dest": "{{ fluentd_dir }}/filter/",
"owner": "{{ fluentd_user }}",
"perm": "0600"
},
{# Copy all configuration files in format/ directory to include #}
{# custom format configs. #}
{
"source": "{{ container_config_directory }}/format/*.conf",
"dest": "{{ fluentd_dir }}/format/",
"owner": "{{ fluentd_user }}",
"perm": "0600"
},
{# Copy all configuration files in output/ directory to include #}
{# custom output configs. #}
{
"source": "{{ container_config_directory }}/output/*.conf",
"dest": "{{ fluentd_dir }}/output/",
"owner": "{{ fluentd_user }}",
"perm": "0600"
}
],
"permissions": [
{
"path": "/var/log/kolla/haproxy",
"owner": "{{ fluentd_user }}:{{ fluentd_user }}",
"recurse": true
},
{
"path": "/var/log/kolla/swift",
"owner": "{{ fluentd_user }}:{{ fluentd_user }}",
"recurse": true
},
{
"path": "/var/lib/fluentd/data",
"owner": "{{ fluentd_user }}:{{ fluentd_user }}",
"recurse": true
}
]
}