Hello
@Monty,
Could you
please help me one more time?
I reinstalled my server. This time
AFTER installing the OS and
BEFORE installing Plesk, I installed MariaDB version 10.5.
When I SSH this command:
mysqld --version
I get this result:
mysqld Ver 10.5.10-MariaDB for Linux on x86_64 (MariaDB Server)
So it seems everything is going allright and MariaDB is working correctly. So far so good I would think.
Here is my question:
In my first post of this thread I described a problem with compressing logs in directory
/var/log/mariadb/.
The strange thing is ... after reinstalling (the way I described above) the directory
/var/log/mariadb/ no longer exists.
Please check post number
#3 in this thread. In my first install the file
/etc/logrotate.d/mysql did NOT exist, but
/etc/logrotate.d/mariadb did exist.
However, after the reinstall (as described above)
/etc/logrotate.d/mariadb does NOT exist, but
/etc/logrotate.d/mysql does exist! So now it's exactly the other way round!
The contents of the file
/etc/logrotate.d/mysql are:
Code:
# This logname can be set in /etc/my.cnf
# by setting the variable "log-error"
# in the [mysqld] section as follows:
#
# [mysqld]
# log-error=/var/lib/mysql/mysqld.log
#
# If the root user has a password you have to create a
# /root/.my.cnf configuration file with the following
# content:
#
# [mysqladmin]
# password = <secret>
# user= root
#
# where "<secret>" is the password.
#
# ATTENTION: This /root/.my.cnf should be readable ONLY
# for root !
/var/lib/mysql/mysqld.log {
# create 600 mysql mysql
notifempty
daily
rotate 3
missingok
compress
postrotate
# just if mariadbd is really running
if test -x /usr/bin/mysqladmin && \
/usr/bin/mysqladmin ping &>/dev/null
then
/usr/bin/mysqladmin --local flush-error-log \
flush-engine-log flush-general-log flush-slow-log
fi
endscript
}
When I use the code
logrotate -d /etc/logrotate.d/mysql you gave me earlier, I get this result:
Code:
Reading state from file: /var/lib/logrotate/logrotate.status
Allocating hash table for state file, size 64 entries
Creating new state (this line is repeated about 40 times)
Handling 1 logs
rotating pattern: /var/lib/mysql/mysqld.log after 1 days (3 rotations)
empty log files are not rotated, old logs are removed
considering log /var/lib/mysql/mysqld.log
log /var/lib/mysql/mysqld.log does not exist -- skipping
In the directory
/var/log/ there are no log files for mysql or mariadb although the server has been running for a couple of days now.
I hope you can still follow me
In short:
- First install: Old MariaDB sometimes gave errors when rotating. It rotated every night.
- Reinstall: I installed MariaDB 10.5. It seems to be working. However logrotate does not seem to be configured anymore. There are no logs.
What should I be doing? I don't know what to do.
By the way ... when I enter the SSH command
plesk db I get this result:
Code:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is xxxxx
Server version: 10.5.10-MariaDB MariaDB Server
So it seems to me Plesk is successfully using MariaDB.
I don't get it ... first there is MariaDB logrotate ... now it seems gone, although MariaDB seems to be functioning normally ...