My server mariadb goes offline frequently making all websites unable to connect.
I’ll have to manually restart the service for it to start working again.
Please anyone know how I can fix this?
PS: My Hestia installation is up to date.
My server mariadb goes offline frequently making all websites unable to connect.
I’ll have to manually restart the service for it to start working again.
Please anyone know how I can fix this?
PS: My Hestia installation is up to date.
Check the server logs
But how much memory available?
Saw couple of warnings about some crashed tables.
But I just increased the max_allowed_packet
from 16M
to 64M
. I don’t really know what that is.
I have about 4GB memory free. Total VPS memory is 8GB
Check the error logs / systemctl status mariadb…
It is hard to guess with out information…
Right now it’s active. I restarted it when it failed. See the systemctl status:
It has stopped working 3 times today.
Increase the max_open_files for MariaDB
Hi @eris, last time I figured out a solution (checking if the service is active and if not, restart it), I added the command to the v-update-sys-queue
which is set to run every minute via cron job. But after the recent update to 1.8.8 I lost the codes I added and can’t figure it out anymore.
Is there a way you can help with some codes that can check the service status and restart it if nit active?
PS: I’ve tried the following codes gotten from chatgpt:
# Check if MariaDB service is running
if systemctl is-active --quiet mariadb; then
systemctl restart mariadb
fi
That code will restart mariadb if it is running, if you want to restart mariadb if is NOT running, you need to use if not (if !
)
if ! systemctl is-active --quiet mariadb; then
systemctl restart mariadb
fi
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.