mohammadreza

Active Member
Jan 7, 2018
40
0
6
Teh
cPanel Access Level
Root Administrator
Hello
mysql service is down and i have following error:

Code:
Mar 20 08:53:00  systemd[1]: Failed to start MariaDB database server.
Mar 20 08:53:00  systemd[1]: Unit mariadb.service entered failed state.
Mar 20 08:53:00  systemd[1]: mariadb.service failed.
Please help me

Thank you

best regards
 

HostNoc

Well-Known Member
Feb 20, 2020
155
38
28
Ontario
cPanel Access Level
Root Administrator
Hello @mohammadreza

Can you let us know which command you are executing to start MariaDB, try

/scripts/restartsrv_mysql
or
From WHM, restart and check the status

You can check the error log file mentioned in my.cnf to know the exact error.

Some more details is needed to know this.

Regards,
 

mohammadreza

Active Member
Jan 7, 2018
40
0
6
Teh
cPanel Access Level
Root Administrator
Hello @mohammadreza

Can you let us know which command you are executing to start MariaDB, try

/scripts/restartsrv_mysql
or
From WHM, restart and check the status

You can check the error log file mentioned in my.cnf to know the exact error.

Some more details is needed to know this.

Regards,
Hello @HostNoc
Thanks for your reply
now i run your command, output is:

Code:
[[email protected] ~]# /scripts/restartsrv_mysql

Waiting for “mysql” to restart ……info [restartsrv_mysql] systemd failed to start the service “mariadb” (The “/usr/bin/systemctl restart mariadb.service --no-ask-password” command (process 606823) reported error number 1 when it ended.): Job for mariadb.service failed because a fatal signal was delivered to the control process. See "systemctl status mariadb.service" and "journalctl -xe" for details.

…info [restartsrv_mysql] systemd failed to start the service “mariadb” (The “/usr/bin/systemctl restart mariadb.service --no-ask-password” command (process 607032) reported error number 1 when it ended.): Job for mariadb.service failed because a fatal signal was delivered to the control process. See "systemctl status mariadb.service" and "journalctl -xe" for details.

…info [restartsrv_mysql] systemd failed to start the service “mariadb” (The “/usr/bin/systemctl restart mariadb.service --no-ask-password” command (process 607275) reported error number 1 when it ended.): Job for mariadb.service failed because a fatal signal was delivered to the control process. See "systemctl status mariadb.service" and "journalctl -xe" for details.

…failed.

Cpanel::Exception::Services::StartError
Service Status
        mariadb (/usr/sbin/mysqld) is running as mysql with PID 606674 (systemd+/proc check method).

Service Error
        (XID 2psz4f) The “mysql” service failed to start.

Startup Log
        Mar 20 14:55:58  systemd[1]: Starting MariaDB database server...

mysql has failed. Contact your system administrator if the service does not automagically recover.
[[email protected] ~]#
 

mohammadreza

Active Member
Jan 7, 2018
40
0
6
Teh
cPanel Access Level
Root Administrator
@mohammadreza

Please check if there is already a mysql process running with

ps -ax | grep mysql

then

killall -9 mysql

Try to restart mysql

Regards,
[[email protected] ~]# ps -ax | grep mysql
634108 ? S 0:00 tailwatchd - chkservd - mysql check
634154 ? S 0:00 /usr/local/cpanel/scripts/restartsrv_mysql --restart --hard --attempt 88
634256 ? Dsl 0:00 /usr/sbin/mysqld
634307 pts/3 S+ 0:00 grep --color=auto mysql
[[email protected] ~]# killall -9 mysql
mysql: no process found
 

mohammadreza

Active Member
Jan 7, 2018
40
0
6
Teh
cPanel Access Level
Root Administrator
Can you please share result of following

"systemctl status mariadb.service" and "journalctl -xe"
Sure,
Thanks for your help
Code:
[[email protected] ~]# journalctl -xe
--
-- Unit db_governor.service has finished starting up.
--
-- The start-up result is done.
Mar 20 15:32:05 sv8 systemd[1]: db_governor.service: main process exited, code=exited, status=1/FAILURE
Mar 20 15:32:05 sv8 systemd[1]: Unit db_governor.service entered failed state.
Mar 20 15:32:05 sv8 systemd[1]: db_governor.service failed.
Mar 20 15:32:07 sv8 kernel: Firewall: *TCP_IN Blocked* IN=enp4s0 OUT= MAC=74:d0:2b:99:a2:0c:cc:e1:7f:ac:52:eb:08:00 SRC=190.39.34.25 DST=144.76.173.220 LEN
Mar 20 15:32:08 sv8 systemd[1]: db_governor.service holdoff time over, scheduling restart.
Mar 20 15:32:08 sv8 systemd[1]: Stopped MySQL watcher service.
-- Subject: Unit db_governor.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit db_governor.service has finished shutting down.
Mar 20 15:32:08 sv8 systemd[1]: Starting MySQL watcher service...
-- Subject: Unit db_governor.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit db_governor.service has begun starting up.
Mar 20 15:32:08 sv8 systemd[1]: Started MySQL watcher service.
-- Subject: Unit db_governor.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit db_governor.service has finished starting up.
--
-- The start-up result is done.
Mar 20 15:32:08 sv8 systemd[1]: db_governor.service: main process exited, code=exited, status=1/FAILURE
Mar 20 15:32:08 sv8 systemd[1]: Unit db_governor.service entered failed state.
Mar 20 15:32:08 sv8 systemd[1]: db_governor.service failed.
Mar 20 15:32:09 sv8 dhclient[3123]: DHCPREQUEST on enp4s0 to 188.40.24.199 port 67 (xid=0x48090f68)
Mar 20 15:32:09 sv8 kernel: Firewall: *UDP_OUT Blocked* IN= OUT=enp4s0 SRC=144.76.173.202 DST=188.40.24.199 LEN=328 TOS=0x00 PREC=0x00 TTL=64 ID=33816 DF P
Mar 20 15:32:09 sv8 dhclient[3123]: send_packet: Operation not permitted
Mar 20 15:32:09 sv8 dhclient[3123]: dhclient.c:2717: Failed to send 300 byte long packet over fallback interface.
 

mohammadreza

Active Member
Jan 7, 2018
40
0
6
Teh
cPanel Access Level
Root Administrator
Code:
systemctl status mariadb.service
● mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf, tokudb.conf
   Active: activating (auto-restart) (Result: signal) since Fri 2020-03-20 15:43:23 +0330; 1s ago
  Process: 674142 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=killed, signal=ABRT)
  Process: 674065 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
  Process: 674063 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
 Main PID: 674142 (code=killed, signal=ABRT)
   CGroup: /system.slice/mariadb.service

Mar 20 15:43:23 sv8 systemd[1]: Failed to start MariaDB database server.
Mar 20 15:43:23 sv8 systemd[1]: Unit mariadb.service entered failed state.
Mar 20 15:43:23 sv8 systemd[1]: mariadb.service failed.
 

mohammadreza

Active Member
Jan 7, 2018
40
0
6
Teh
cPanel Access Level
Root Administrator
Are you running any firewall in server? Also please share result of following command

netstat -ntlp
Yes, i have firewall
After resetting the server, the database encountered an error

Code:
[[email protected] ~]# netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:11211         0.0.0.0:*               LISTEN      4408/memcached
tcp        0      0 0.0.0.0:587             0.0.0.0:*               LISTEN      1916/exim
tcp        0      0 0.0.0.0:110             0.0.0.0:*               LISTEN      530851/dovecot
tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN      530851/dovecot
tcp        0      0 0.0.0.0:2095            0.0.0.0:*               LISTEN      530830/cpsrvd
tcp        0      0 127.0.0.1:783           0.0.0.0:*               LISTEN      5004/perl
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1/systemd
tcp        0      0 0.0.0.0:2096            0.0.0.0:*               LISTEN      530830/cpsrvd
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      660662/litespeed (l
tcp        0      0 127.0.0.1:20304         0.0.0.0:*               LISTEN      4605/lswsproxy
tcp        0      0 127.0.0.1:27217         0.0.0.0:*               LISTEN      6143/mongod
tcp        0      0 127.0.0.1:20305         0.0.0.0:*               LISTEN      4605/lswsproxy
tcp        0      0 0.0.0.0:465             0.0.0.0:*               LISTEN      1916/exim
tcp        0      0 167.99.112.67:53        0.0.0.0:*               LISTEN      5783/named
tcp        0      0 34.231.236.27:53        0.0.0.0:*               LISTEN      5783/named
tcp        0      0 52.55.120.73:53         0.0.0.0:*               LISTEN      5783/named
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      5783/named
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN      4510/pure-ftpd (SER
tcp        0      0 127.0.0.1:953           0.0.0.0:*               LISTEN      5783/named
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      1916/exim
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      660662/litespeed (l
tcp        0      0 0.0.0.0:25405           0.0.0.0:*               LISTEN      4468/checkstatus
tcp        0      0 0.0.0.0:2077            0.0.0.0:*               LISTEN      5267/cpdavd - accep
tcp        0      0 0.0.0.0:2078            0.0.0.0:*               LISTEN      5267/cpdavd - accep
tcp        0      0 0.0.0.0:2079            0.0.0.0:*               LISTEN      5267/cpdavd - accep
tcp        0      0 0.0.0.0:2080            0.0.0.0:*               LISTEN      5267/cpdavd - accep
tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN      530851/dovecot
tcp        0      0 0.0.0.0:7777            0.0.0.0:*               LISTEN      8787/sshd
tcp        0      0 0.0.0.0:2082            0.0.0.0:*               LISTEN      530830/cpsrvd
tcp        0      0 0.0.0.0:995             0.0.0.0:*               LISTEN      530851/dovecot
tcp        0      0 0.0.0.0:2083            0.0.0.0:*               LISTEN      530830/cpsrvd
tcp        0      0 127.0.0.1:579           0.0.0.0:*               LISTEN      5175/cPhulkd - proc
tcp        0      0 0.0.0.0:2086            0.0.0.0:*               LISTEN      530830/cpsrvd
tcp        0      0 0.0.0.0:2087            0.0.0.0:*               LISTEN      530830/cpsrvd
tcp        0      0 0.0.0.0:7080            0.0.0.0:*               LISTEN      660662/litespeed (l
tcp6       0      0 :::587                  :::*                    LISTEN      1916/exim
tcp6       0      0 :::110                  :::*                    LISTEN      530851/dovecot
tcp6       0      0 :::143                  :::*                    LISTEN      530851/dovecot
tcp6       0      0 ::1:783                 :::*                    LISTEN      5004/perl
tcp6       0      0 :::111                  :::*                    LISTEN      1/systemd
tcp6       0      0 :::80                   :::*                    LISTEN      660662/litespeed (l
tcp6       0      0 :::465                  :::*                    LISTEN      1916/exim
tcp6       0      0 :::53                   :::*                    LISTEN      5783/named
tcp6       0      0 :::21                   :::*                    LISTEN      4510/pure-ftpd (SER
tcp6       0      0 :::25                   :::*                    LISTEN      1916/exim
tcp6       0      0 :::443                  :::*                    LISTEN      660662/litespeed (l
tcp6       0      0 :::993                  :::*                    LISTEN      530851/dovecot
tcp6       0      0 :::7777                 :::*                    LISTEN      8787/sshd
tcp6       0      0 :::995                  :::*                    LISTEN      530851/dovecot
[[email protected] ~]#
 

mohammadreza

Active Member
Jan 7, 2018
40
0
6
Teh
cPanel Access Level
Root Administrator
It seems mysql port is not listening, can you please stop server firewall and then restart mysql
i stop server firewall and try restart mysql service and i get error again and run journalctl -xe ,
output is :
Code:
Mar 20 16:13:15 sv8 systemd[1]: db_governor.service: main process exited, code=exited, status=1/FAILURE
Mar 20 16:13:15 sv8 systemd[1]: Unit db_governor.service entered failed state.
Mar 20 16:13:15 sv8 systemd[1]: db_governor.service failed.
 

mohammadreza

Active Member
Jan 7, 2018
40
0
6
Teh
cPanel Access Level
Root Administrator
Please run following command

service db_governor restart

Restart mysql
Code:
[[email protected] ~]# service db_governor restart
Redirecting to /bin/systemctl restart db_governor.service
[[email protected] ~]# #/scripts/restartsrv_mysql --start
[[email protected] ~]# /scripts/restartsrv_mysql --start
Waiting for “mysql” to restart ……info [restartsrv_mysql] systemd failed to start the service “mariadb” (The “/usr/bin/systemctl restart mariadb.service --no-ask-password” command (process 761367) reported error number 1 when it ended.): Job for mariadb.service failed because a fatal signal was delivered to the control process. See "systemctl status mariadb.service" and "journalctl -xe" for details.

…info [restartsrv_mysql] systemd failed to start the service “mariadb” (The “/usr/bin/systemctl restart mariadb.service --no-ask-password” command (process 761611) reported error number 1 when it ended.): Job for mariadb.service failed because a fatal signal was delivered to the control process. See "systemctl status mariadb.service" and "journalctl -xe" for details.

…info [restartsrv_mysql] systemd failed to start the service “mariadb” (The “/usr/bin/systemctl restart mariadb.service --no-ask-password” command (process 761837) reported error number 1 when it ended.): Job for mariadb.service failed because a fatal signal was delivered to the control process. See "systemctl status mariadb.service" and "journalctl -xe" for details.

…failed.

Cpanel::Exception::Services::StartError
Service Status
        mariadb (/usr/sbin/mysqld) is running as mysql with PID 761242 (systemd+/proc check method).

Service Error
        (XID ahtnc7) The “mysql” service failed to start.

Startup Log
        Mar 20 16:41:49 sv8.rbco.space systemd[1]: Stopped MariaDB database server.
        Mar 20 16:41:49 sv8.rbco.space systemd[1]: Starting MariaDB database server...

mysql has failed. Contact your system administrator if the service does not automagically recover.
 

mohammadreza

Active Member
Jan 7, 2018
40
0
6
Teh
cPanel Access Level
Root Administrator
Please run following command

service db_governor restart

Restart mysql
Code:
service db_governor status
Redirecting to /bin/systemctl status db_governor.service
● db_governor.service - MySQL watcher service
   Loaded: loaded (/usr/lib/systemd/system/db_governor.service; enabled; vendor preset: disabled)
   Active: inactive (dead) (Result: exit-code) since Fri 2020-03-20 16:46:21 +0330; 2s ago
  Process: 769263 ExecStopPost=/bin/sh -c if pgrep db_governor 1>/dev/null; then pkill -SIGTERM db_governor 2>/dev/null; fi (code=exited, status=0/SUCCESS)
  Process: 769260 ExecStart=/usr/sbin/db_governor (code=exited, status=1/FAILURE)
Main PID: 769260 (code=exited, status=1/FAILURE)

Mar 20 16:46:18 sv8 systemd[1]: Unit db_governor.service entered failed state.
Mar 20 16:46:18 sv8 systemd[1]: db_governor.service failed.
Mar 20 16:46:21 sv8 systemd[1]: db_governor.service holdoff time over, scheduling restart.
Mar 20 16:46:21 sv8 systemd[1]: Stopped MySQL watcher service.
@cPanelLauren
 
Last edited:

mohammadreza

Active Member
Jan 7, 2018
40
0
6
Teh
cPanel Access Level
Root Administrator
Thanks, @HostNoc for trying to assist here. @mohammadreza What if anything is noted in the mysql error logs? What firewall are you running on the server?
Hello
Thanks for your reply
i have error log on my email :
Code:
Service Name    mysql
Service Status    failed ⛔
Notification    The service “mysql” appears to be down.
Service Check Method    The system’s command to check or to restart this service failed.
Number of Restart Attempts    145
Service Check Raw Output    (XID s7258x) The service “mysql” failed to start with the message: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

The subprocess “/usr/local/cpanel/scripts/restartsrv_mysql” reported error number 255 when it ended.
Startup Log    Mar 20 20:12:16 sv8 systemd[1]: Starting MariaDB database server...
Mar 20 20:12:16 sv8 mysqld[1059321]: 2020-03-20 20:12:16 140512212588800 [Note] libgovernor.so found
Mar 20 20:12:16 sv8 mysqld[1059321]: 2020-03-20 20:12:16 140512212588800 [Note] All governors functions found too
Mar 20 20:12:16 sv8 mysqld[1059321]: 2020-03-20 20:12:16 140512212588800 [ERROR] Governor not connected
Mar 20 20:12:16 sv8 mysqld[1059321]: 2020-03-20 20:12:16 140512212588800 [Note] All governors lve functions found too
Mar 20 20:12:16 sv8 mysqld[1059321]: 2020-03-20 20:12:16 140512212588800 [Note] /usr/sbin/mysqld (mysqld 10.2.27-MariaDB-cll-lve) starting as process 1059321 ...
Mar 20 20:12:16 sv8 mysqld[1059321]: 2020-03-20 20:12:16 140512212588800 [Warning] Could not increase number of max_open_files to more than 500000 (request: 1050715)
Mar 20 20:12:16 sv8 mysqld[1059321]: 2020-03-20 20:12:16 140512212588800 [Warning] Changed limits: max_open_files: 500000 max_connections: 2100 (was 2100) table_cache: 248935 (was 524288)
Log Messages    Mar 20 20:12:16 sv8 mysqld: 2020-03-20 20:12:16 140512212588800 [Warning] Changed limits: max_open_files: 500000 max_connections: 2100 (was 2100) table_cache: 248935 (was 524288)
Mar 20 20:12:16 sv8 mysqld: 2020-03-20 20:12:16 140512212588800 [Warning] Could not increase number of max_open_files to more than 500000 (request: 1050715)
Mar 20 20:12:16 sv8 mysqld: 2020-03-20 20:12:16 140512212588800 [Note] /usr/sbin/mysqld (mysqld 10.2.27-MariaDB-cll-lve) starting as process 1059321 ...
I'm use CSF for Firewall
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,301
363
Houston
This indicates that you've set the max_open_files and max_connections in the mysql conf at /etc/my.cnf but it does not indicate the issue with it starting. Can you please include the log messages when you attempt to restart the service. If you're unsure where the log file is you can find it listed in the mysql configuration file.