Skip to content
Snippets Groups Projects
Commit 3fca4ccb authored by Éric Lemoine's avatar Éric Lemoine Committed by Sam Yaple
Browse files

Make Heka collect HAProxy and Keepalived logs

Partially implements: blueprint heka
Change-Id: I7e2bf4e520fa14fd40e3b329f3b2998ae6ea47f4
parent 916925c9
No related branches found
No related tags found
No related merge requests found
......@@ -29,3 +29,4 @@
dest: "{{ node_config_directory }}/heka/heka-{{ item }}.toml"
with_items:
- "global"
- "haproxy"
# HAProxy and Keepalived write their logs to Syslog, so the generic
# Syslog input set in heka-global.toml.j2 is used.
[haproxy_file_output]
type = "FileOutput"
message_matcher = "Type == 'Syslog' && Fields[programname] =~ /(?i:haproxy)/"
path = "/var/log/kolla/haproxy/haproxy.log"
encoder = "syslog_encoder"
[keepalived_file_output]
type = "FileOutput"
message_matcher = "Type == 'Syslog' && Fields[programname] =~ /(?i:keepalived)/"
path = "/var/log/kolla/haproxy/keepalived.log"
encoder = "syslog_encoder"
......@@ -6,6 +6,12 @@
"dest": "/etc/heka/heka-global.toml",
"owner": "heka",
"perm": "0600"
},
{
"source": "{{ container_config_directory }}/heka-haproxy.toml",
"dest": "/etc/heka/heka-haproxy.toml",
"owner": "heka",
"perm": "0600"
}
]
}
......@@ -9,6 +9,7 @@
volumes:
- "{{ node_config_directory }}/haproxy/:{{ container_config_directory }}/:ro"
- "haproxy_socket:/var/lib/kolla/haproxy/"
- "heka_socket:/var/lib/kolla/heka/"
- name: Starting keepalived container
kolla_docker:
......@@ -21,6 +22,7 @@
- "{{ node_config_directory }}/keepalived/:{{ container_config_directory }}/:ro"
- "/lib/modules:/lib/modules:ro"
- "haproxy_socket:/var/lib/kolla/haproxy/"
- "heka_socket:/var/lib/kolla/heka/"
- name: Ensuring latest haproxy config is used
command: docker exec haproxy /usr/local/bin/kolla_ensure_haproxy_latest_config
......
global
daemon
log /var/lib/kolla/heka/log local0
maxconn 4000
stats socket /var/lib/kolla/haproxy/haproxy.sock
defaults
log global
mode http
option redispatch
option httplog
retries 3
timeout http-request 10s
timeout queue 1m
......@@ -25,6 +28,7 @@ listen stats {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']
{% if enable_mariadb | bool %}
listen mariadb
mode tcp
option tcplog
option tcpka
option mysql-check user haproxy
bind {{ kolla_internal_address }}:{{ mariadb_port }}
......
#!/bin/bash
# NOTE(elemoine): keepalived cannot be configured to change the log address to
# anything other than /dev/log. Heka's log socket is at /var/lib/kolla/heka/log
# so we symlink /dev/log to that location.
ln -sf /var/lib/kolla/heka/log /dev/log
modprobe ip_vs
# Workaround for bug #1485079
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment