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.
Restoring to an Offloaded MySQL Instance
Re: Restoring to an Offloaded MySQL Instance
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
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).
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
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!
That's a good idea at least that is, I like it better than the other options I was thinking of.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Restoring to an Offloaded MySQL Instance
Glad to be of assistance.
Locking
Locking