Make Heka collect Heat logs

Partially implements: blueprint heka
Change-Id: Ie22c4326c6ec2a3426b0c3b8fda4554b1b2541b0
This commit is contained in:
Éric Lemoine 2016-02-17 14:26:19 +01:00 committed by SamYaple
parent 170b493d47
commit 82264ab7d6
8 changed files with 30 additions and 20 deletions

View File

@ -6,5 +6,5 @@ filename = "lua_decoders/os_openstack_log.lua"
type = "LogstreamerInput"
decoder = "openstack_log_decoder"
log_directory = "/var/log/kolla"
file_match = '(?P<Service>nova|glance|keystone|neutron|cinder)/(?P<Program>.*)\.log'
file_match = '(?P<Service>nova|glance|keystone|neutron|cinder|heat)/(?P<Program>.*)\.log'
differentiator = ["Service", "_", "Program"]

View File

@ -7,15 +7,6 @@ $KLogPermitNonKernelFacility on
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
$RepeatedMsgReduction on
$template HeatAPIFile,"/var/log/heat/heat-api.log"
:syslogtag,contains,"heat-api" ?HeatAPIFile
$template HeatAPICfnFile,"/var/log/heat/heat-api-cfn.log"
:syslogtag,contains,"heat-api-cfn" ?HeatAPICfnFile
$template HeatEngineFile,"/var/log/heat/heat-engine.log"
:syslogtag,contains,"heat-engine" ?HeatEngineFile
$template MuranoEngineFile,"/var/log/murano/murano-engine.log"
:syslogtag,contains,"murano-engine" ?MuranoEngineFile

View File

@ -53,7 +53,9 @@
labels:
BOOTSTRAP:
name: "bootstrap_heat"
volumes: "{{ node_config_directory }}/heat-api/:{{ container_config_directory }}/:ro"
volumes:
- "{{ node_config_directory }}/heat-api/:{{ container_config_directory }}/:ro"
- "kolla_logs:/var/log/kolla/"
run_once: True
delegate_to: "{{ groups['heat-api'][0] }}"
when: database_created

View File

@ -7,7 +7,7 @@
name: "heat_api"
volumes:
- "{{ node_config_directory }}/heat-api/:{{ container_config_directory }}/:ro"
- "rsyslog_socket:/var/lib/kolla/rsyslog/"
- "kolla_logs:/var/log/kolla/"
when: inventory_hostname in groups['heat-api']
- name: Starting heat-api-cfn container
@ -18,7 +18,7 @@
name: "heat_api_cfn"
volumes:
- "{{ node_config_directory }}/heat-api-cfn/:{{ container_config_directory }}/:ro"
- "rsyslog_socket:/var/lib/kolla/rsyslog/"
- "kolla_logs:/var/log/kolla/"
when: inventory_hostname in groups['heat-api-cfn']
- name: Starting heat-engine container
@ -29,5 +29,5 @@
name: "heat_engine"
volumes:
- "{{ node_config_directory }}/heat-engine/:{{ container_config_directory }}/:ro"
- "rsyslog_socket:/var/lib/kolla/rsyslog/"
- "kolla_logs:/var/log/kolla/"
when: inventory_hostname in groups['heat-engine']

View File

@ -1,6 +1,8 @@
[DEFAULT]
debug = {{ heat_logging_debug }}
log_dir = /var/log/kolla/heat
heat_watch_server_url = {{ public_protocol }}://{{ kolla_external_address }}:{{ heat_api_cfn_port }}
heat_metadata_server_url = {{ public_protocol }}://{{ kolla_external_address }}:{{ heat_api_cfn_port }}
heat_waitcondition_server_url = {{ public_protocol }}://{{ kolla_external_address }}:{{ heat_api_cfn_port }}/v1/waitcondition
@ -14,9 +16,6 @@ notification_driver = noop
deferred_auth_method = trusts
trusts_delegated_role = heat_stack_owner
syslog_log_facility=LOG_LOCAL0
use_syslog=yes
[oslo_messaging_rabbit]
rabbit_userid = {{ rabbitmq_user }}
rabbit_password = {{ rabbitmq_password }}

View File

@ -1,5 +1,12 @@
#!/bin/bash
if [[ ! -d "/var/log/kolla/heat" ]]; then
mkdir -p /var/log/kolla/heat
fi
if [[ $(stat -c %a /var/log/kolla/heat) != "755" ]]; then
chmod 755 /var/log/kolla/heat
fi
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then

View File

@ -21,10 +21,13 @@ ADD heat-base-archive /heat-base-source
RUN ln -s heat-base-source/* heat \
&& useradd --user-group heat \
&& /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /heat \
&& mkdir -p /etc/heat /var/log/heat /home/heat \
&& mkdir -p /etc/heat /home/heat \
&& cp -r /heat/etc/heat/* /etc/heat/ \
&& chown -R heat: /etc/heat /var/log/heat /home/heat
&& chown -R heat: /etc/heat /home/heat
{% endif %}
RUN usermod -a -G kolla heat
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN usermod -a -G kolla heat \
&& chmod 755 /usr/local/bin/kolla_extend_start

View File

@ -0,0 +1,8 @@
#!/bin/bash
if [[ ! -d "/var/log/kolla/heat" ]]; then
mkdir -p /var/log/kolla/heat
fi
if [[ $(stat -c %a /var/log/kolla/heat) != "755" ]]; then
chmod 755 /var/log/kolla/heat
fi