Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Not a Bug
-
10.3.17
-
Raspian Buster (10) on Raspberry Pi
Description
I moved my data directory to another location. It works if this is on the same disk, just at a different location (i.e., moved /var/lib/mysql/ and edited the datadir entry in the server.cnf).
However, when the data directory is on a mounted drive it does not work well. It generally works, but when the system boots, MariaDB times out.
I changed the systemd service for mariadb to ensure that mounting took place: I added RequiresMountsFor=/mnt/foo. I can see by the timestamps that the service is started as soon as the disk is mounted. Starting MariaDB works occasionally, but most times mariadb times out:
Dec 11 10:41:59 rpi systemd[1]: Mounted /mnt/foo.
|
...
|
Dec 11 10:41:59 rpi systemd[1]: Starting MariaDB 10.3.17 database server...
|
Dec 11 10:41:59 rpi mysqld[962]: 2019-12-11 10:41:59 0 [Note] /usr/sbin/mysqld (mysqld 10.3.17-MariaDB-0+deb10u1) starting as process 962 ...
|
Dec 11 10:43:29 rpi systemd[1]: mariadb.service: Start operation timed out. Terminating.
|
Dec 11 10:43:32 rpi systemd[1]: mariadb.service: Failed with result 'timeout'.
|
Dec 11 10:43:32 rpi systemd[1]: Failed to start MariaDB 10.3.17 database server.
|
Starting it manually after works fine.
Hello mattsch, if MariaDB comes up occasionally, this might simply be a case where the startup time is near the default timeout of 90 seconds. Sometimes it's faster and works, sometimes it's slower and fails.
Then it would be enough to increase the timeout. This is described in this Knowledge Base article.
On the other hand this might be a more serious problem. Do you happen to know how long MariaDB takes to start when it works? Please also check the MariaDB error log for anything unusual.