问题原文
原帖链接 · dev-jim · CC BY-SA 3.0
I am using new relic to monitor the performance of my server. Recently I noticed a very strange problem where for every 3 hours, the server will be down for 1 minute. And in the new relic report, during the server down time, there were sudden spike on the database.
The problem is I am new in system admin, I don't know how to view the database log. I am using Mariadb on a Ubuntu 14.04 machine. So, where can I find the log? I tried to view in /var/log/mysql.err, /var/log/mysql.log and /var/log/mysql/error.log there are no content inside.
I also tried grep 'mysql' /var/log/syslog, nothing found as well.
Do I need to enable the logging in mariadb config file? If so, how?
社区高分解答
原帖链接 · Slawomir · CC BY-SA 4.0
On systemd linuxes (Ubuntu), it's centralized under systemd which collects and manages kernel and user-land process logs under the journal. To view mariadb journal, run:
# journalctl -u mariadb -f
You should see something along the lines of:
-- Logs begin at Mon 2021-08-30 08:59:29 CDT. --
Aug 25 21:10:22 aorus-15g-yb mysqld[1123]: 2022-08-25 21:10:22 0 [Note] /usr/sbin/mysqld (mysqld 10.3.34-MariaDB-0ubuntu0.20.04.1) starting as process 1123 ...
Aug 25 21:10:22 aorus-15g-yb systemd[1]: Started MariaDB 10.3.34 database server.
Aug 25 21:10:22 aorus-15g-yb /etc/mysql/debian-start[1254]: Looking for 'mysql' as: /usr/bin/mysql
Aug 25 21:10:22 aorus-15g-yb /etc/mysql/debian-start[1254]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Aug 25 21:10:22 aorus-15g-yb /etc/mysql/debian-start[1254]: This installation of MariaDB is already upgraded to 10.3.34-MariaDB.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
