[Maria-discuss] question about generating logs on MariaDB 10.1.21
Hello, I have just moved from a MySQL 5.6 server on CentOS 6.8 to a MariaDB 10.1.21 server on CentOS 7. It is installed and working. I would like to set up some logging, but it has not gone as expected. I have binary logging working. However, I can't generate general logs or error logs. Here is part of the /etc/my.cnf file: user=mysql port = 3306 socket = /var/lib/mysql/mysql.sock datadir = /mnt/mysqldbs log_error = /var/log/mysql/error.log general_log_file = /var/log/mysql/mysql.log general_log = 1 log_bin = /mnt/mysqldbs/logs/mysql-bin I assume that after a restart, the logs will be generated, then logged to as events happen. As it is, no log files are generated. Many thanks.
Hi Chris, In CentOS 7, error logs are handled by systemd. Use the "journalctl -u mariadb.service" command to view them. I have no idea what's wrong with the general logs though. Maybe that's some permission issue. Please check that the mysql user can write in /var/log/mysql. You might have success by changing the log path to your datadir, e.g. to /mnt/mysqldbs/mysql.log, since mysqld can always write in its own datadir. Regards GL On Tue, Jan 24, 2017 at 11:04 PM Chris Adams <chris.a.adams@state.or.us> wrote:
Hello,
I have just moved from a MySQL 5.6 server on CentOS 6.8 to a MariaDB 10.1.21 server on CentOS 7. It is installed and working.
I would like to set up some logging, but it has not gone as expected. I have binary logging working. However, I can’t generate general logs or error logs. Here is part of the /etc/my.cnf file:
user=mysql
port = 3306
socket = /var/lib/mysql/mysql.sock
datadir = /mnt/mysqldbs
log_error = /var/log/mysql/error.log
general_log_file = /var/log/mysql/mysql.log
general_log = 1
log_bin = /mnt/mysqldbs/logs/mysql-bin
I assume that after a restart, the logs will be generated, then logged to as events happen. As it is, no log files are generated.
Many thanks. _______________________________________________ Mailing list: https://launchpad.net/~maria-discuss Post to : maria-discuss@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-discuss More help : https://help.launchpad.net/ListHelp
-- Guillaume Lefranc Remote DBA Services Manager MariaDB Corporation
You are correct on both accounts. I am now informing myself about ‘journalctl’. Writing the logs to the datadir also worked. Thank you for your help. From: Guillaume Lefranc [mailto:guillaume.lefranc@mariadb.com] Sent: Tuesday, January 24, 2017 2:28 PM To: Chris Adams <ChrisAdams@oslmail.osl.state.or.us>; maria-discuss@lists.launchpad.net Subject: Re: [Maria-discuss] question about generating logs on MariaDB 10.1.21 Hi Chris, In CentOS 7, error logs are handled by systemd. Use the "journalctl -u mariadb.service" command to view them. I have no idea what's wrong with the general logs though. Maybe that's some permission issue. Please check that the mysql user can write in /var/log/mysql. You might have success by changing the log path to your datadir, e.g. to /mnt/mysqldbs/mysql.log, since mysqld can always write in its own datadir. Regards GL On Tue, Jan 24, 2017 at 11:04 PM Chris Adams <chris.a.adams@state.or.us<mailto:chris.a.adams@state.or.us>> wrote: Hello, I have just moved from a MySQL 5.6 server on CentOS 6.8 to a MariaDB 10.1.21 server on CentOS 7. It is installed and working. I would like to set up some logging, but it has not gone as expected. I have binary logging working. However, I can’t generate general logs or error logs. Here is part of the /etc/my.cnf file: user=mysql port = 3306 socket = /var/lib/mysql/mysql.sock datadir = /mnt/mysqldbs log_error = /var/log/mysql/error.log general_log_file = /var/log/mysql/mysql.log general_log = 1 log_bin = /mnt/mysqldbs/logs/mysql-bin I assume that after a restart, the logs will be generated, then logged to as events happen. As it is, no log files are generated. Many thanks. _______________________________________________ Mailing list: https://launchpad.net/~maria-discuss Post to : maria-discuss@lists.launchpad.net<mailto:maria-discuss@lists.launchpad.net> Unsubscribe : https://launchpad.net/~maria-discuss More help : https://help.launchpad.net/ListHelp -- Guillaume Lefranc Remote DBA Services Manager MariaDB Corporation
Am 24.01.2017 um 23:27 schrieb Guillaume Lefranc:
Hi Chris,
In CentOS 7, error logs are handled by systemd.
as well as stdout and hence mariadb should *really* fix spit that startup lines into the general systemlog when "log-error" and "general_log_file" are configured - the fact that the service was started/stopped is logged by systemd anyways mysqld: 2017-01-24 22:16:10 139841788156224 [Note] /usr/libexec/mysqld (mysqld 10.1.21-MariaDB) starting as process 14782.. https://lists.launchpad.net/maria-discuss/msg02858.html
Use the "journalctl -u mariadb.service" command to view them.
I have no idea what's wrong with the general logs though. Maybe that's some permission issue. Please check that the mysql user can write in /var/log/mysql. You might have success by changing the log path to your datadir, e.g. to /mnt/mysqldbs/mysql.log, since mysqld can always write in its own datadir.
Regards GL
On Tue, Jan 24, 2017 at 11:04 PM Chris Adams <chris.a.adams@state.or.us <mailto:chris.a.adams@state.or.us>> wrote:
Hello,____
__ __
I have just moved from a MySQL 5.6 server on CentOS 6.8 to a MariaDB 10.1.21 server on CentOS 7. It is installed and working. ____
__ __
I would like to set up some logging, but it has not gone as expected. I have binary logging working. However, I can’t generate general logs or error logs. Here is part of the /etc/my.cnf file:____
__ __
user=mysql____
port = 3306____
socket = /var/lib/mysql/mysql.sock____
datadir = /mnt/mysqldbs____
log_error = /var/log/mysql/error.log____
general_log_file = /var/log/mysql/mysql.log____
general_log = 1____
log_bin = /mnt/mysqldbs/logs/mysql-bin____
__ __
I assume that after a restart, the logs will be generated, then logged to as events happen. As it is, no log files are generated. ____
Am 24.01.2017 um 23:42 schrieb Reindl Harald:
Am 24.01.2017 um 23:27 schrieb Guillaume Lefranc:
Hi Chris,
In CentOS 7, error logs are handled by systemd.
as well as stdout and hence mariadb should *really* fix spit that startup lines into the general systemlog when "log-error" and "general_log_file" are configured - the fact that the service was started/stopped is logged by systemd anyways
mysqld: 2017-01-24 22:16:10 139841788156224 [Note] /usr/libexec/mysqld (mysqld 10.1.21-MariaDB) starting as process 14782..
and i even seeked the source code after your useless "You don't give any meaningful context at all to solve this issue. What's the distribution you using? What commands do you use to start mariadb? Where do you see this message?" when it's reproduceable by just call /usr/libexec/mysqld in a terminal * mysqld.cc * line 4075 if (!opt_help) sql_print_information("%s (mysqld %s) starting as process %lu ...", my_progname, server_version, (ulong) getpid());
Use the "journalctl -u mariadb.service" command to view them.
I have no idea what's wrong with the general logs though. Maybe that's some permission issue. Please check that the mysql user can write in /var/log/mysql. You might have success by changing the log path to your datadir, e.g. to /mnt/mysqldbs/mysql.log, since mysqld can always write in its own datadir.
Regards GL
On Tue, Jan 24, 2017 at 11:04 PM Chris Adams <chris.a.adams@state.or.us <mailto:chris.a.adams@state.or.us>> wrote:
Hello,____
__ __
I have just moved from a MySQL 5.6 server on CentOS 6.8 to a MariaDB 10.1.21 server on CentOS 7. It is installed and working. ____
__ __
I would like to set up some logging, but it has not gone as expected. I have binary logging working. However, I can’t generate general logs or error logs. Here is part of the /etc/my.cnf file:____
__ __
user=mysql____
port = 3306____
socket = /var/lib/mysql/mysql.sock____
datadir = /mnt/mysqldbs____
log_error = /var/log/mysql/error.log____
general_log_file = /var/log/mysql/mysql.log____
general_log = 1____
log_bin = /mnt/mysqldbs/logs/mysql-bin____
__ __
I assume that after a restart, the logs will be generated, then logged to as events happen. As it is, no log files are generated. ____
_______________________________________________ Mailing list: https://launchpad.net/~maria-discuss Post to : maria-discuss@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-discuss More help : https://help.launchpad.net/ListHelp
-- Reindl Harald the lounge interactive design GmbH A-1060 Vienna, Hofmühlgasse 17 CTO / CISO / Software-Development m: +43 676 40 221 40 p: +43 1 595 3999 33 http://www.thelounge.net/
On 25/01/17 09:27, Guillaume Lefranc wrote:
Hi Chris,
In CentOS 7, error logs are handled by systemd.
Use the "journalctl -u mariadb.service" command to view them.
I have no idea what's wrong with the general logs though. Maybe that's some permission issue. Please check that the mysql user can write in /var/log/mysql. You might have success by changing the log path to your datadir, e.g. to /mnt/mysqldbs/mysql.log, since mysqld can always write in its own datadir.
Regards GL
That was my thoughts also. Watch out for selinux permissions also: These are easy enough to correct without turning selinux off permanently: https://blogs.oracle.com/jsmyth/entry/selinux_and_mysql
On Tue, Jan 24, 2017 at 11:04 PM Chris Adams <chris.a.adams@state.or.us <mailto:chris.a.adams@state.or.us>> wrote:
Hello,____
__ __
I have just moved from a MySQL 5.6 server on CentOS 6.8 to a MariaDB 10.1.21 server on CentOS 7. It is installed and working. ____
__ __
I would like to set up some logging, but it has not gone as expected. I have binary logging working. However, I can’t generate general logs or error logs. Here is part of the /etc/my.cnf file:____
__ __
user=mysql____
port = 3306____
socket = /var/lib/mysql/mysql.sock____
datadir = /mnt/mysqldbs____
log_error = /var/log/mysql/error.log____
general_log_file = /var/log/mysql/mysql.log____
general_log = 1____
log_bin = /mnt/mysqldbs/logs/mysql-bin____
__ __
I assume that after a restart, the logs will be generated, then logged to as events happen. As it is, no log files are generated. ____
__ __
Many thanks. ____
_______________________________________________ Mailing list: https://launchpad.net/~maria-discuss Post to : maria-discuss@lists.launchpad.net <mailto:maria-discuss@lists.launchpad.net> Unsubscribe : https://launchpad.net/~maria-discuss More help : https://help.launchpad.net/ListHelp
-- Guillaume Lefranc Remote DBA Services Manager MariaDB Corporation
_______________________________________________ Mailing list: https://launchpad.net/~maria-discuss Post to : maria-discuss@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-discuss More help : https://help.launchpad.net/ListHelp
Yes, I had considered Selinux as the problem. However, I had temporarily set it to 'permissive', then 'disabled', and that made no difference. -----Original Message----- From: Maria-discuss [mailto:maria-discuss-bounces+chris.a.adams=state.or.us@lists.launchpad.net] On Behalf Of Daniel Black Sent: Tuesday, January 24, 2017 3:00 PM To: maria-discuss@lists.launchpad.net Subject: Re: [Maria-discuss] question about generating logs on MariaDB 10.1.21 On 25/01/17 09:27, Guillaume Lefranc wrote:
Hi Chris,
In CentOS 7, error logs are handled by systemd.
Use the "journalctl -u mariadb.service" command to view them.
I have no idea what's wrong with the general logs though. Maybe that's some permission issue. Please check that the mysql user can write in /var/log/mysql. You might have success by changing the log path to your datadir, e.g. to /mnt/mysqldbs/mysql.log, since mysqld can always write in its own datadir.
Regards GL
That was my thoughts also. Watch out for selinux permissions also: These are easy enough to correct without turning selinux off permanently: https://blogs.oracle.com/jsmyth/entry/selinux_and_mysql
On Tue, Jan 24, 2017 at 11:04 PM Chris Adams <chris.a.adams@state.or.us <mailto:chris.a.adams@state.or.us>> wrote:
Hello,____
__ __
I have just moved from a MySQL 5.6 server on CentOS 6.8 to a MariaDB 10.1.21 server on CentOS 7. It is installed and working. ____
__ __
I would like to set up some logging, but it has not gone as expected. I have binary logging working. However, I can't generate general logs or error logs. Here is part of the /etc/my.cnf file:____
__ __
user=mysql____
port = 3306____
socket = /var/lib/mysql/mysql.sock____
datadir = /mnt/mysqldbs____
log_error = /var/log/mysql/error.log____
general_log_file = /var/log/mysql/mysql.log____
general_log = 1____
log_bin = /mnt/mysqldbs/logs/mysql-bin____
__ __
I assume that after a restart, the logs will be generated, then logged to as events happen. As it is, no log files are generated. ____
__ __
Many thanks. ____
_______________________________________________ Mailing list: https://launchpad.net/~maria-discuss Post to : maria-discuss@lists.launchpad.net <mailto:maria-discuss@lists.launchpad.net> Unsubscribe : https://launchpad.net/~maria-discuss More help : https://help.launchpad.net/ListHelp
-- Guillaume Lefranc Remote DBA Services Manager MariaDB Corporation
_______________________________________________ Mailing list: https://launchpad.net/~maria-discuss Post to : maria-discuss@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-discuss More help : https://help.launchpad.net/ListHelp
_______________________________________________ Mailing list: https://launchpad.net/~maria-discuss Post to : maria-discuss@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-discuss More help : https://help.launchpad.net/ListHelp
On 25/01/17 10:49, Chris Adams wrote:
Yes, I had considered Selinux as the problem. However, I had temporarily set it to 'permissive', then 'disabled', and that made no difference.
-----Original Message----- From: Maria-discuss [mailto:maria-discuss-bounces+chris.a.adams=state.or.us@lists.launchpad.net] On Behalf Of Daniel Black Sent: Tuesday, January 24, 2017 3:00 PM To: maria-discuss@lists.launchpad.net Subject: Re: [Maria-discuss] question about generating logs on MariaDB 10.1.21
On 25/01/17 09:27, Guillaume Lefranc wrote:
Hi Chris,
In CentOS 7, error logs are handled by systemd.
Use the "journalctl -u mariadb.service" command to view them.
Now that you know where the logs are you will need to read them to resolve your issue. Show this information here if you need help. Use other options here to get a more complete history. You potentially also have a broken logrotate scripts. Use lsof -p $(pidof mysqld) to examine if mysqld had file descriptors pointing to log files that have been deleted. Aside, logging the general log on a default setting is quite IO intensive and I've rarely seen a benefit.
I have no idea what's wrong with the general logs though. Maybe that's some permission issue. Please check that the mysql user can write in /var/log/mysql. You might have success by changing the log path to your datadir, e.g. to /mnt/mysqldbs/mysql.log, since mysqld can always write in its own datadir.
Regards GL
That was my thoughts also. Watch out for selinux permissions also:
These are easy enough to correct without turning selinux off permanently:
https://blogs.oracle.com/jsmyth/entry/selinux_and_mysql
On Tue, Jan 24, 2017 at 11:04 PM Chris Adams <chris.a.adams@state.or.us <mailto:chris.a.adams@state.or.us>> wrote:
Hello,____
__ __
I have just moved from a MySQL 5.6 server on CentOS 6.8 to a MariaDB 10.1.21 server on CentOS 7. It is installed and working. ____
__ __
I would like to set up some logging, but it has not gone as expected. I have binary logging working. However, I can't generate general logs or error logs. Here is part of the /etc/my.cnf file:____
__ __
user=mysql____
port = 3306____
socket = /var/lib/mysql/mysql.sock____
datadir = /mnt/mysqldbs____
log_error = /var/log/mysql/error.log____
general_log_file = /var/log/mysql/mysql.log____
general_log = 1____
log_bin = /mnt/mysqldbs/logs/mysql-bin____
__ __
I assume that after a restart, the logs will be generated, then logged to as events happen. As it is, no log files are generated. ____
__ __
Many thanks. ____
_______________________________________________ Mailing list: https://launchpad.net/~maria-discuss Post to : maria-discuss@lists.launchpad.net <mailto:maria-discuss@lists.launchpad.net> Unsubscribe : https://launchpad.net/~maria-discuss More help : https://help.launchpad.net/ListHelp
-- Guillaume Lefranc Remote DBA Services Manager MariaDB Corporation
_______________________________________________ Mailing list: https://launchpad.net/~maria-discuss Post to : maria-discuss@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-discuss More help : https://help.launchpad.net/ListHelp
_______________________________________________ Mailing list: https://launchpad.net/~maria-discuss Post to : maria-discuss@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-discuss More help : https://help.launchpad.net/ListHelp
_______________________________________________ Mailing list: https://launchpad.net/~maria-discuss Post to : maria-discuss@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-discuss More help : https://help.launchpad.net/ListHelp
participants (4)
-
Chris Adams
-
Daniel Black
-
Guillaume Lefranc
-
Reindl Harald