Skip to content
Snippets Groups Projects
Commit 4445c819 authored by Éric Lemoine's avatar Éric Lemoine Committed by SamYaple
Browse files

Make Heka collect MariaDB logs

Partially implements: blueprint heka
Change-Id: Ib5e740683cee296bcac69228f525594850d62a27
parent 7fb0971f
No related branches found
No related tags found
No related merge requests found
...@@ -32,3 +32,4 @@ ...@@ -32,3 +32,4 @@
- "haproxy" - "haproxy"
- "rabbitmq" - "rabbitmq"
- "openstack" - "openstack"
- "mariadb"
[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 @@ ...@@ -24,6 +24,12 @@
"dest": "/etc/heka/heka-openstack.toml", "dest": "/etc/heka/heka-openstack.toml",
"owner": "heka", "owner": "heka",
"perm": "0600" "perm": "0600"
},
{
"source": "{{ container_config_directory }}/heka-mariadb.toml",
"dest": "/etc/heka/heka-mariadb.toml",
"owner": "heka",
"perm": "0600"
} }
] ]
} }
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
volumes: volumes:
- "{{ node_config_directory }}/mariadb/:{{ container_config_directory }}/:ro" - "{{ node_config_directory }}/mariadb/:{{ container_config_directory }}/:ro"
- "mariadb:/var/lib/mysql" - "mariadb:/var/lib/mysql"
- "kolla_logs:/var/log/kolla/"
when: when:
- delegate_host == 'None' - delegate_host == 'None'
- inventory_hostname == groups['mariadb'][0] - inventory_hostname == groups['mariadb'][0]
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
volumes: volumes:
- "{{ node_config_directory }}/mariadb/:{{ container_config_directory }}/:ro" - "{{ node_config_directory }}/mariadb/:{{ container_config_directory }}/:ro"
- "mariadb:/var/lib/mysql" - "mariadb:/var/lib/mysql"
- "kolla_logs:/var/log/kolla/"
when: delegate_host != 'None' or when: delegate_host != 'None' or
( groups['mariadb'] | length ) == 1 or ( groups['mariadb'] | length ) == 1 or
( delegate_host == 'None' and inventory_hostname != groups['mariadb'][0] ) ( delegate_host == 'None' and inventory_hostname != groups['mariadb'][0] )
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
bind-address={{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} bind-address={{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
port={{ mariadb_port }} port={{ mariadb_port }}
log-error=/var/log/kolla/mariadb/mariadb.log
binlog_format=ROW binlog_format=ROW
default-storage-engine=innodb default-storage-engine=innodb
innodb_autoinc_lock_mode=2 innodb_autoinc_lock_mode=2
......
...@@ -23,6 +23,14 @@ if [[ $(stat -c %U:%G /var/lib/mysql) != "mysql:mysql" ]]; then ...@@ -23,6 +23,14 @@ if [[ $(stat -c %U:%G /var/lib/mysql) != "mysql:mysql" ]]; then
sudo chown mysql: /var/lib/mysql sudo chown mysql: /var/lib/mysql
fi 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 # This catches all cases of the BOOTSTRAP variable being set, including empty
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]] && [[ ! -e /var/lib/mysql/cluster.exists ]]; then if [[ "${!KOLLA_BOOTSTRAP[@]}" ]] && [[ ! -e /var/lib/mysql/cluster.exists ]]; then
ARGS="--wsrep-new-cluster" ARGS="--wsrep-new-cluster"
......
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