Question

MariaDB process getting killed once a day on fresh CentOS 7 install

Posted September 17, 2014 9.7k views

Hi guys,

Basically, MariaDB is getting killed randomly once a day, sometimes it lasts for a couple of days and then it goes down. The logs say it’s being killed and not restarting. I checked the server load and it is super low, as I am only hosting a couple domains with almost no traffic.

I can restart the service again no problem using “service mariadb start”, but eventually it gets killed.

# service mariadb status
Redirecting to /bin/systemctl status  mariadb.service
mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled)
   Active: inactive (dead) since Tue 2014-09-16 18:53:31 IST; 16h ago
  Process: 3461 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS)
  Process: 3460 ExecStart=/usr/bin/mysqld_safe --basedir=/usr (code=exited, status=0/SUCCESS)
  Process: 3433 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
 Main PID: 3460 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/mariadb.service

Sep 16 10:11:44 serverizr mysqld_safe[3460]: 140916 05:11:44 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
Sep 16 10:11:44 serverizr mysqld_safe[3460]: 140916 05:11:44 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Sep 16 10:11:45 serverizr systemd[1]: Started MariaDB database server.
Sep 16 18:53:23 serverizr mysqld_safe[3460]: /usr/bin/mysqld_safe: line 182:  3619 Killed                  nohup /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/u
Sep 16 18:53:30 serverizr mysqld_safe[3460]: 140916 13:53:30 mysqld_safe Number of processes running now: 0
Sep 16 18:53:30 serverizr mysqld_safe[3460]: 140916 13:53:30 mysqld_safe mysqld restarted
Sep 16 18:53:30 serverizr mysqld_safe[3460]: /usr/bin/mysqld_safe: line 182:  7510 Killed                  nohup /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/u
Sep 16 18:53:31 serverizr mysqld_safe[3460]: 140916 13:53:31 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended

I’ve been searching for help on how to solve this but so far, no solution has worked and the logs are not saying much.

Any ideas?

Thanks!

2 comments
  • MariaDB crashing usually means that your droplet is running out of memory. Do you see any errors in /var/log/mariadb/mariadb.log?

    sudo tail -30 /var/log/mariadb/mariadb.log
    
  • @kamaln7 that was exactly my first thought. However, there is nothing else in the mariadb.log besides “xxx table is marked as crashed and should be repaired” messages and all that I pasted in my original post.

    I recently started the service using “mysqld_safe” instead of “service mariadb start” and it hasn’t crashed for 24 hours. Does it make any difference?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Have same problem. Yes, MariaDB out of memory, but in this moments number of processes over average value. Like this: Memory graph processes graph Maybe need limit number of processes?

  • It doesn’t seem like a memory issue or number of processes in my particular case. I started the service back in September using “mysqld_safe” instead of “service mariadb start” and it hasn’t crashed since then.

    I don’t really know what the difference is and why the process gets killed when using “service start”.

Submit an Answer