Page 1 of 1

Quick DR question

Posted: Thu May 14, 2015 8:43 am
by BanditBBS
Ok,

So I have two datacenters. In City1 my production nagios and production offloaded DB/NDO2DB server reside. In City2 I have a DR XI server just sitting there doing nothing. I have a folder being rsynced between the two that contains the daily backups from City1. I use rsync instead of the ssh or ftp so I can limit the bw utilization and so only one backup is being compressed up.

My question here is...if I have a failure of City1 datacenter and we make the decision to bring up the XI server in City2, what kind of issue is that going to bring up since the configs are set to go to a remote DB server and for NDO2DB not to be running locally?

Will I have to modify the backup file and undo the offloading steps before I run the restore_xi.sh script so it attaches to the local DB in City2?

Re: Quick DR question

Posted: Thu May 14, 2015 12:35 pm
by ssax
From reading the restore_xi.sh script and from my testing, I have validate that these things are true:

1. The restore_xi.sh script will use your current city2 DB configuration (localhost) and restore the DB to the localhost.
2. During the restore it will revert these files that will re-setup your offloaded configuration:

Code: Select all

/usr/local/nagios/etc/ndo2db.cfg
/usr/local/nagiosxi/html/config.inc.php
/var/www/html/nagiosql/config/settings.php
3. It will revert the rest of your config files (nagios.cfg, etc)
4. It will even revert your restore_xi.sh script and undo any changes that you might want to make to overcome these issues.
5. At the end of the script it will restart the services and will try to connect to the offloaded DB.

So knowing this, here is what you would need to do:

Create a directory that you will copy in any of your configuration files that you want to keep and copy those files in there:

Code: Select all

mkdir /mylocalhostconfigs
cp /usr/local/nagios/etc/ndo2db.cfg /usr/local/nagiosxi/html/config.inc.php /var/www/html/nagiosql/config/settings.php /mylocalhostconfigs
Run the restore.

Stop the services:

Code: Select all

/etc/init.d/httpd stop
/etc/init.d/npcd stop
/etc/init.d/ndo2db stop
/etc/init.d/nagiosxi stop
/etc/init.d/nagios stop
Copy the files back:

Code: Select all

cp /mylocalhostconfigs/ndo2db.cfg /usr/local/nagios/etc/ndo2db.cfg
cp /mylocalhostconfigs/config.inc.php /usr/local/nagiosxi/html/config.inc.php
cp /mylocalhostconfigs/settings.php /var/www/html/nagiosql/config/settings.php
Start the services:

Code: Select all

/etc/init.d/httpd start
/etc/init.d/npcd start
/etc/init.d/ndo2db start
/etc/init.d/nagiosxi start
/etc/init.d/nagios start

Re: Quick DR question

Posted: Thu May 14, 2015 1:50 pm
by BanditBBS
ssax,

That's perfect! Now I don't have to document it :) Close this up and thanks!