Browse Source

Fixed MySQL log file path

bugfixes
gau1991 10 years ago
parent
commit
7052910e67
  1. 6
      src/modules/debug/ee_mod_debug_mysql.sh
  2. 1
      src/modules/stack/install/ee_mod_setup_mysql.sh
  3. 4
      src/vendor/ee_ven_install_utils.sh

6
src/modules/debug/ee_mod_debug_mysql.sh

@ -10,7 +10,7 @@ function ee_mod_debug_mysql()
mysql -e "set global slow_query_log = 'ON';" \
|| ee_lib_error "Unable to setup slow_query_log, exit status = " $?
mysql -e "set global slow_query_log_file = '/var/log/mysql/slow.log';" \
mysql -e "set global slow_query_log_file = '/var/log/mysql/mysql-slow.log';" \
|| ee_lib_error "Unable to setup slow_query_log_file, exit status = " $?
mysql -e "set global long_query_time = 2;" \
@ -24,7 +24,7 @@ function ee_mod_debug_mysql()
fi
# Debug message
EE_DEBUG_MSG="$EE_DEBUG_MSG /var/log/mysql/slow.log"
EE_DEBUG_MSG="$EE_DEBUG_MSG /var/log/mysql/mysql-slow.log"
elif [ "$EE_DEBUG" = "--stop" ]; then
mysql -e "show variables like 'slow_query_log';" | grep ON &>> $EE_COMMAND_LOG
if [ $? -eq 0 ]; then
@ -33,7 +33,7 @@ function ee_mod_debug_mysql()
mysql -e "set global slow_query_log = 'OFF';" \
|| ee_lib_error "Unable to setup slow_query_log, exit status = " $?
mysql -e "set global slow_query_log_file = '/var/log/mysql/slow.log';" \
mysql -e "set global slow_query_log_file = '/var/log/mysql/mysql-slow.log';" \
|| ee_lib_error "Unable to setup slow_query_log_file, exit status = " $?
mysql -e "set global long_query_time = 10;" \

1
src/modules/stack/install/ee_mod_setup_mysql.sh

@ -8,6 +8,5 @@ function ee_mod_setup_mysql()
grep "_timeout" /etc/mysql/my.cnf &>> $EE_COMMAND_LOG
if [ $? -ne 0 ]; then
sed -i "/#max_connections/a wait_timeout = 30 \ninteractive_timeout = 60" /etc/mysql/my.cnf
sed -i "/\[mysqldump\]/i slow_query_log_file = /var/log/mysql/slow.log" /etc/mysql/my.cnf
fi
}

4
src/vendor/ee_ven_install_utils.sh

@ -108,7 +108,7 @@ function ee_ven_install_utils()
echo -e " pt-query-digest --user=anemometer --password=$ee_anemometer_pass \\" >> /etc/logrotate.d/mysql-server
echo -e " --review D=slow_query_log,t=global_query_review \\" >> /etc/logrotate.d/mysql-server
echo -e " --history D=slow_query_log,t=global_query_review_history \\" >> /etc/logrotate.d/mysql-server
echo -e " --no-report --limit=0% --filter=\" \\\$event->{Bytes} = length(\\\$event->{arg}) and \\\$event->{hostname}="\\\"$EE_MYSQL_GRANT_HOST\\\"\" /var/log/mysql/slow.log >> /etc/logrotate.d/mysql-server
echo -e " --no-report --limit=0% --filter=\" \\\$event->{Bytes} = length(\\\$event->{arg}) and \\\$event->{hostname}="\\\"$EE_MYSQL_GRANT_HOST\\\"\" /var/log/mysql/mysql-slow.log >> /etc/logrotate.d/mysql-server
echo -e "\t\tendscript" >> /etc/logrotate.d/mysql-server
echo -e "}" >> /etc/logrotate.d/mysql-server
else
@ -116,7 +116,7 @@ function ee_ven_install_utils()
echo -e " pt-query-digest --user=anemometer --password=$ee_anemometer_pass \\" >> /etc/logrotate.d/mysql-server
echo -e " --review D=slow_query_log,t=global_query_review \\" >> /etc/logrotate.d/mysql-server
echo -e " --review-history D=slow_query_log,t=global_query_review_history \\" >> /etc/logrotate.d/mysql-server
echo -e " --no-report --limit=0% --filter=\" \\\$event->{Bytes} = length(\\\$event->{arg}) and \\\$event->{hostname}="\\\"$EE_MYSQL_GRANT_HOST\\\"\" /var/log/mysql/slow.log >> /etc/logrotate.d/mysql-server
echo -e " --no-report --limit=0% --filter=\" \\\$event->{Bytes} = length(\\\$event->{arg}) and \\\$event->{hostname}="\\\"$EE_MYSQL_GRANT_HOST\\\"\" /var/log/mysql/mysql-slow.log >> /etc/logrotate.d/mysql-server
echo -e "\t\tendscript" >> /etc/logrotate.d/mysql-server
echo -e "}" >> /etc/logrotate.d/mysql-server
fi

Loading…
Cancel
Save