Restoring to an Offloaded MySQL Instance

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
joephus
Posts: 2
Joined: Tue May 22, 2018 3:33 pm

Restoring to an Offloaded MySQL Instance

Post 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.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Restoring to an Offloaded MySQL Instance

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Restoring to an Offloaded MySQL Instance

Post 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).
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
joephus
Posts: 2
Joined: Tue May 22, 2018 3:33 pm

Re: Restoring to an Offloaded MySQL Instance

Post 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. :D I'll give it a shot. Thanks a bunch!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Restoring to an Offloaded MySQL Instance

Post by scottwilkerson »

Glad to be of assistance.

Locking
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked