Page 1 of 1
Restoring to an Offloaded MySQL Instance
Posted: Fri Jun 15, 2018 4:40 pm
by joephus
I have a primary and secondary Nagios XI server, each with their own offloaded MySQL instance. In case of failure on the primary, I'd like to use the back-up/restore facilities within XI to keep the two in sync however, having offloaded MySQL is apparently a challenge for XI. The restore process will apparently point the secondary XI instance to the primary's MySQL instance, which for various obvious reasons is not a desirable outcome. I'm wondering if anyone has come up with a good solution to this issue. I've considered manually editing the restore scripts, but upgrades and patches will most likely overwrite those changes. I've also considered writing a wrapper for the restore scripts that would manually override $nagiosql_dbserver, but I'm not too thrilled with that solution either. The only other solution I see is to not use the XI back up/restore facility at all and do everything on my own, again a solution I'm not too thrilled with.
TIA for any suggestions.
Re: Restoring to an Offloaded MySQL Instance
Posted: Mon Jun 18, 2018 4:27 pm
by cdienger
Hi
@joephus, Have you tried running to restore script and if so what errors or messages did you receive? I haven't had a chance to fully test this but from reviewing the scripts there doesn't seem to be an obvious issue and /etc/my.cnf shouldn't be touched by either.
Re: Restoring to an Offloaded MySQL Instance
Posted: Mon Jun 18, 2018 4:28 pm
by scottwilkerson
Here is a possible solution, instead of using the IP address in the configurations for the offloaded databases, use a hostname (the same hostname on each server (e.g. database1)
Then add this hostname to the /etc/hosts file on each of your server but use their respective IP addresses in the /etc/hosts file (on the primary XI server use the IP of the primary DB server).
Re: Restoring to an Offloaded MySQL Instance
Posted: Mon Jun 18, 2018 9:10 pm
by joephus
Hi Scott,
That's a good idea at least that is, I like it better than the other options I was thinking of.

I'll give it a shot. Thanks a bunch!
Re: Restoring to an Offloaded MySQL Instance
Posted: Tue Jun 19, 2018 8:16 am
by scottwilkerson
Glad to be of assistance.
Locking