From 86bafeee7a8926d212e8d089fade667772dbcc83 Mon Sep 17 00:00:00 2001 From: Vikram Hosakote Date: Wed, 30 Mar 2016 04:43:48 +0000 Subject: [PATCH] Add general_log to mariadb container and make heka collect it Added general_log to ansible/roles/mariadb/templates/galera.cnf.j2 to improve mariadb logging. This will be helpful to debug mariadb issues especially when mariadb is scaled. Test results of this patch set are at: http://paste.openstack.org/show/492852/ Change-Id: I80438d1bbdd1ed2a1f47489c6f9c45b8107340a0 Closes-Bug: #1563668 --- ansible/roles/common/templates/heka-mariadb.toml.j2 | 2 +- ansible/roles/mariadb/templates/galera.cnf.j2 | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ansible/roles/common/templates/heka-mariadb.toml.j2 b/ansible/roles/common/templates/heka-mariadb.toml.j2 index 07d7105410..04abd33b44 100644 --- a/ansible/roles/common/templates/heka-mariadb.toml.j2 +++ b/ansible/roles/common/templates/heka-mariadb.toml.j2 @@ -6,6 +6,6 @@ filename = "lua_decoders/os_mysql_log.lua" type = "LogstreamerInput" decoder = "mariadb_log_decoder" log_directory = "/var/log/kolla" -file_match = 'mariadb/mariadb\.log\.?(?P\d*)$' +file_match = 'mariadb/(mariadb|mariadb-error)\.log\.?(?P\d*)$' priority = ["^Seq"] differentiator = ['mariadb'] diff --git a/ansible/roles/mariadb/templates/galera.cnf.j2 b/ansible/roles/mariadb/templates/galera.cnf.j2 index a4210fa9ca..fac7749679 100644 --- a/ansible/roles/mariadb/templates/galera.cnf.j2 +++ b/ansible/roles/mariadb/templates/galera.cnf.j2 @@ -3,7 +3,9 @@ bind-address={{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} port={{ mariadb_port }} -log-error=/var/log/kolla/mariadb/mariadb.log +log-error=/var/log/kolla/mariadb/mariadb-error.log +general_log=1 +general_log_file=/var/log/kolla/mariadb/mariadb.log binlog_format=ROW default-storage-engine=innodb