Make Heka collect MariaDB logs
Partially implements: blueprint heka Change-Id: Ib5e740683cee296bcac69228f525594850d62a27
This commit is contained in:
parent
7fb0971fb6
commit
4445c81991
@ -32,3 +32,4 @@
|
||||
- "haproxy"
|
||||
- "rabbitmq"
|
||||
- "openstack"
|
||||
- "mariadb"
|
||||
|
10
ansible/roles/common/templates/heka-mariadb.toml.j2
Normal file
10
ansible/roles/common/templates/heka-mariadb.toml.j2
Normal file
@ -0,0 +1,10 @@
|
||||
[mariadb_log_decoder]
|
||||
type = "SandboxDecoder"
|
||||
filename = "lua_decoders/os_mysql_log.lua"
|
||||
|
||||
[mariadb_logstreamer_input]
|
||||
type = "LogstreamerInput"
|
||||
decoder = "mariadb_log_decoder"
|
||||
log_directory = "/var/log/kolla"
|
||||
file_match = 'mariadb/mariadb\.log'
|
||||
differentiator = ['mariadb']
|
@ -24,6 +24,12 @@
|
||||
"dest": "/etc/heka/heka-openstack.toml",
|
||||
"owner": "heka",
|
||||
"perm": "0600"
|
||||
},
|
||||
{
|
||||
"source": "{{ container_config_directory }}/heka-mariadb.toml",
|
||||
"dest": "/etc/heka/heka-mariadb.toml",
|
||||
"owner": "heka",
|
||||
"perm": "0600"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -51,6 +51,7 @@
|
||||
volumes:
|
||||
- "{{ node_config_directory }}/mariadb/:{{ container_config_directory }}/:ro"
|
||||
- "mariadb:/var/lib/mysql"
|
||||
- "kolla_logs:/var/log/kolla/"
|
||||
when:
|
||||
- delegate_host == 'None'
|
||||
- inventory_hostname == groups['mariadb'][0]
|
||||
|
@ -8,6 +8,7 @@
|
||||
volumes:
|
||||
- "{{ node_config_directory }}/mariadb/:{{ container_config_directory }}/:ro"
|
||||
- "mariadb:/var/lib/mysql"
|
||||
- "kolla_logs:/var/log/kolla/"
|
||||
when: delegate_host != 'None' or
|
||||
( groups['mariadb'] | length ) == 1 or
|
||||
( delegate_host == 'None' and inventory_hostname != groups['mariadb'][0] )
|
||||
|
@ -3,6 +3,8 @@
|
||||
bind-address={{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
|
||||
port={{ mariadb_port }}
|
||||
|
||||
log-error=/var/log/kolla/mariadb/mariadb.log
|
||||
|
||||
binlog_format=ROW
|
||||
default-storage-engine=innodb
|
||||
innodb_autoinc_lock_mode=2
|
||||
|
@ -23,6 +23,14 @@ if [[ $(stat -c %U:%G /var/lib/mysql) != "mysql:mysql" ]]; then
|
||||
sudo chown mysql: /var/lib/mysql
|
||||
fi
|
||||
|
||||
# Create log directory, with appropriate permissions
|
||||
if [[ ! -d "/var/log/kolla/mariadb" ]]; then
|
||||
mkdir -p /var/log/kolla/mariadb
|
||||
fi
|
||||
if [[ $(stat -c %a /var/log/kolla/mariadb) != "755" ]]; then
|
||||
chmod 755 /var/log/kolla/mariadb
|
||||
fi
|
||||
|
||||
# This catches all cases of the BOOTSTRAP variable being set, including empty
|
||||
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]] && [[ ! -e /var/lib/mysql/cluster.exists ]]; then
|
||||
ARGS="--wsrep-new-cluster"
|
||||
|
Loading…
Reference in New Issue
Block a user