Page 1 of 1

Can MariaDB be replaced with MySQL on local Nagios XI?

Posted: Mon Sep 09, 2019 9:47 pm
by azreenariff
Hi. How can we replace the MariaDB on local Nagios XI server to MySQL instead? As I know, MariaDB is part of Nagios XI dependancy. Any way we can replace MariaDB with MySQL instead on local Nagios XI server?

Thanks.

Re: Can MariaDB be replaced with MySQL on local Nagios XI?

Posted: Tue Sep 10, 2019 9:55 am
by mcapra
Depending on how it is done, I could see this creating some package conflicts, or issues with library dependencies, with future Nagios XI updates.

But you could definitely offload the Nagios XI database needs to a a different server and avoid all of that:
https://assets.nagios.com/downloads/nag ... Server.pdf

I'd defer to a support tech on long-term support of MySQL versus MariaDB. There's never been much of a difference between the two on the surface, though testing both setups between releases adds overhead.

Re: Can MariaDB be replaced with MySQL on local Nagios XI?

Posted: Tue Sep 10, 2019 12:29 pm
by mbellerue
Thanks for jumping in, Matt!

azreenariff, MariaDB is meant to be a drop-in replacement for MySQL, so you should be pretty safe going in the other direction and replacing MariaDB with MySQL. As Matt mentioned, the absolute safest way would be to off-load the database to another machine or VM.

Re: Can MariaDB be replaced with MySQL on local Nagios XI?

Posted: Tue Sep 10, 2019 9:15 pm
by azreenariff
Hi mcapra & mbellerue,

Thank you so much for your replies. Our client requires us to replace MariaDB to MySQL locally and not offloading to another server. However, MariaDB is a package dependency of NagiosXI and if MariaDB is removed, yum will also remove NagiosXI. And if we install the MySQL package, it will replace MariaDB and uninstall it too. Let's say we have pre-installed MySQL, If we install Nagios XI, it will also want to install MariaDB and would replace MySQL and uninstall it too. Am I correct? Whit this, would you know if there is any way we can get past this? :)

Thanks.

Re: Can MariaDB be replaced with MySQL on local Nagios XI?

Posted: Wed Sep 11, 2019 10:08 am
by mbellerue
Running a yum erase mariadb might delete the databases, but it won't uninstall Nagios XI. I was able to uninstall MariaDB, and install MySQL Community 5.7.27. In my case it did not delete the databases, but I would highly recommend making a backup of the databases before attempting the move.

Re: Can MariaDB be replaced with MySQL on local Nagios XI?

Posted: Wed Sep 11, 2019 9:00 pm
by azreenariff
My Nagios XI was installed offline, and so it uses rpm of Nagios XI. So, when trying to install MySQL, it complains of the dependency as below:

--> Finished Dependency Resolution
Error: Package: nagiosxi-5-4.13.el7.x86_64 (installed)
Requires: mariadb-server
Removing: 1:mariadb-server-5.5.56-2.el7.x86_64 (installed)
mariadb-server = 1:5.5.56-2.el7
Obsoleted By: mysql-community-server-5.7.27-1.el7.x86_64 (mysql57-community)
Not found
Updated By: 1:mariadb-server-5.5.60-1.el7_5.x86_64 (base)
mariadb-server = 1:5.5.60-1.el7_5
Error: Package: nagiosxi-5-4.13.el7.x86_64 (installed)
Requires: mariadb
Removing: 1:mariadb-5.5.56-2.el7.x86_64 (installed)
mariadb = 1:5.5.56-2.el7
Obsoleted By: mysql-community-client-5.7.27-1.el7.x86_64 (mysql57-community)
Not found
Updated By: 1:mariadb-5.5.60-1.el7_5.x86_64 (base)
mariadb = 1:5.5.60-1.el7_5
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest


Any way to counter this? :D

Re: Can MariaDB be replaced with MySQL on local Nagios XI?

Posted: Thu Sep 12, 2019 12:41 pm
by mbellerue
Let's try this. Once you've gone through the offline installation process for Nagios XI, and you have a confirmed working system.

Make a backup of /var/lib/mysql/

Remove MariaDB

Code: Select all

rpm -e --nodeps mariadb-server-5.5.56-2.el7.x86_64
Install MySQL. It looks like you've got an RPM for MySQL, so I'll leave that process up to you.

Now, removing MariaDB shouldn't have removed the databases, so once MySQL is installed, you may have a functioning system once again. But, if the databases were removed, restore your backup.

Finally, make sure to block MariaDB so that it doesn't get installed during an update sometime down the road.
https://www.tecmint.com/yum-lock-disabl ... e-version/

Also, you're going to MySQL 5.7, this KB will be helpful.
https://support.nagios.com/kb/article/n ... s-780.html

Re: Can MariaDB be replaced with MySQL on local Nagios XI?

Posted: Thu Sep 12, 2019 11:11 pm
by azreenariff
Hi,

I managed to counter this by backing up Nagios XI - remove Nagios XI RPMs - reinstall same version of Nagios XI manually online - restore Nagios XI from backup - remove MariaDB - install MySQL - change Nagios XI 'mysql' variable value to 'mysqld'

Thanks for your kind assistance all.

Re: Can MariaDB be replaced with MySQL on local Nagios XI?

Posted: Fri Sep 13, 2019 7:02 am
by scottwilkerson
azreenariff wrote:Hi,

I managed to counter this by backing up Nagios XI - remove Nagios XI RPMs - reinstall same version of Nagios XI manually online - restore Nagios XI from backup - remove MariaDB - install MySQL - change Nagios XI 'mysql' variable value to 'mysqld'

Thanks for your kind assistance all.
Great!

Locking