• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved MariaDB & MySQL in systemctl - correct or not?

Luke Pittman

New Pleskian
Running CentOS 7.

Upgraded to MariaDB 10.2 and am confused about both MariaDB and MySQL showing up in systemctl. My understanding was that I was replacing MySQL with MariaDB. Did I mess up a step and not remove something I was supposed to?

systemctl list-units --all (with only relevant entries)

● mariadb.service loaded failed failed MariaDB 10.2.25 database server
mysql.service loaded active running LSB: start and stop MariaDB

MySQL and CentOS versions

[root@server mariadb]# mysql -V
mysql Ver 15.1 Distrib 10.2.25-MariaDB, for Linux (x86_64) using readline 5.1

[root@server mariadb]# rpm -q centos-release
centos-release-7-6.1810.2.el7.centos.x86_64

systemctl status mariadb.service

[root@server mariadb]# systemctl status mariadb.service
● mariadb.service - MariaDB 10.2.25 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/mariadb.service.d
└─migrated-from-my.cnf-settings.conf, override.conf
Active: failed (Result: exit-code) since Tue 2019-07-09 11:06:31 PDT; 18min ago
Docs: man:mysqld(8)
systemd
Process: 24782 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
Process: 24702 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: 24699 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Main PID: 24782 (code=exited, status=1/FAILURE)
Status: "MariaDB server is down"

Jul 09 11:06:31 server.catch22media.com mysqld[24782]: 2019-07-09 11:06:31 140064774273216 [ERROR] mysqld: Got error 'Could not get an exclusive lock; file is probably in use by another process' when trying to use aria control file '/var/lib/mysql/aria_log_control'
Jul 09 11:06:31 server.catch22media.com mysqld[24782]: 2019-07-09 11:06:31 140064774273216 [ERROR] Plugin 'Aria' init function returned error.
Jul 09 11:06:31 server.catch22media.com mysqld[24782]: 2019-07-09 11:06:31 140064774273216 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
Jul 09 11:06:31 server.catch22media.com mysqld[24782]: 2019-07-09 11:06:31 140064774273216 [Note] Plugin 'FEEDBACK' is disabled.
Jul 09 11:06:31 server.catch22media.com mysqld[24782]: 2019-07-09 11:06:31 140064774273216 [ERROR] Unknown/unsupported storage engine: InnoDB
Jul 09 11:06:31 server.catch22media.com mysqld[24782]: 2019-07-09 11:06:31 140064774273216 [ERROR] Aborting
Jul 09 11:06:31 server.catch22media.com systemd[1]: mariadb.service: main process exited, code=exited, status=1/FAILURE
Jul 09 11:06:31 server.catch22media.com systemd[1]: Failed to start MariaDB 10.2.25 database server.
Jul 09 11:06:31 server.catch22media.com systemd[1]: Unit mariadb.service entered failed state.
Jul 09 11:06:31 server.catch22media.com systemd[1]: mariadb.service failed.

systemctl status mysql.service

[root@server mariadb]# systemctl status mysql.service
● mysql.service - LSB: start and stop MariaDB
Loaded: loaded (/etc/rc.d/init.d/mysql; bad; vendor preset: disabled)
Active: active (running) since Tue 2019-07-09 11:08:34 PDT; 17min ago
Docs: man:systemd-sysv-generator(8)
Process: 26230 ExecStop=/etc/rc.d/init.d/mysql stop (code=exited, status=0/SUCCESS)
Process: 26410 ExecStart=/etc/rc.d/init.d/mysql start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/mysql.service
├─26487 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/server.catch22media.com.pid
└─26632 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/log/mariadb/mariadb.log --pid-file=/var/lib/mysql/server.catch22media.com.pid --socket=/var/lib/mysql/mysql.sock

Jul 09 11:08:32 server.catch22media.com systemd[1]: Starting LSB: start and stop MariaDB...
Jul 09 11:08:32 server.catch22media.com mysql[26410]: Starting MariaDB.190709 11:08:32 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
Jul 09 11:08:32 server.catch22media.com mysql[26410]: 190709 11:08:32 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Jul 09 11:08:34 server.catch22media.com mysql[26410]: . SUCCESS!
Jul 09 11:08:34 server.catch22media.com systemd[1]: Started LSB: start and stop MariaDB.

Other Notes

Other than this odd issue - the system is functioning correctly.

Starting either service it works fine, however when I start the service via the MariaDB unit, then when running MySQLTuner.pl it is unable to get the log files (it looks for /var/log/mariadb/.log which doesn't exist), but when I start from MySQL then MySQLTuner.pl accesses the log files correctly (/var/log/mariadb/mariadb.log).

My Questions

  1. Did I somehow manage to keep both installed? (unlikely, I don't think it's possible) or;
  2. Is MySQL setup as an alias or "symlink" (for lack of better description) to MariaDB?
  3. Is it safe to remove one of the units from systemctl? If so, which should I remove, and how?
Are there any questions I should be asking?
 
Try this:
Code:
systemctl stop mysql
systemctl stop mariadb
chkconfig --del mysql
systemctl disable mysql
systemctl disable mariadb
systemctl enable mariadb.service
systemctl start mariadb.service
 
Monty,

Thanks. I've been working on this since I posted it and finally realized that the "unit" for MySQL was just left in the /etc/init.d/ directory. I removed it, then reloaded the systemctl and presto, it was gone.

I've since further tested chkconfig as you recommend and it's not there either.

So, turns out it wasn't anything serious!

Thanks
 
Back
Top