First, set up PostgresSQL database replication. Then do the following:
- For each of the two JetPatch Manager Console:
- Install the JetPatch Manager Console.
- Stop JetPatch Agent Manager services:
/etc/init.d/tomcat_watchdog stop
/etc/init.d/tomcat stop
/etc/init.d/nginx stop
- Open the following file for editing:
/usr/share/tomcat/default/conf/intigua.properties
- Replace the following three keys' values with the correct values, on each server for its respective database:
- db.url
- db.username
- db.password
- On the active JetPatch Manager Console, start JetPatch Agent Manager services:
/etc/init.d/tomcat_watchdog start
/etc/init.d/tomcat start
/etc/init.d/nginx start
- On the active JetPatch Manager Console, install rsync by running:
yum install -y rsync
- On the standby server, do the following:
- Place the script you received from JetPatch Agent Manager in:
/usr/share/intigua
- Install rsync by running:
yum install -y rsync
- Establish a secure, trusted connection to the active server (to enable rsync to retrieve data) by running:
ssh-keygen
ssh-copy-id root@<active>
where <active> is the active server's resolvable name or IP address.
You will be prompted for the active server's root password.
- Create the following directory:
/etc/intigua
- Configure synchronization by running:
./sync.py --src=<active> -–createconfig
where <active> is the Active server's resolvable name or IP address.
- Copy intigua-sync to:
/etc/init.d
- Start synchronization by running:
service intigua-sync start
- Optionally, test synchronization by running:
./sync.py --src=<active>
where <active> is the active server's resolvable name or IP address.
- Place the script you received from JetPatch Agent Manager in:
- Check that the script is running, and that its output shows data being synchronized.
- Copy the following file from the active server to the standby server:
/usr/share/tomcat/default/conf/intigua.secret
- Log into the active server's Console, and configure connector management services' Communication setting to the active JetPatch Manager Console's hostname (not IP address). Make sure this setting is deployed to all endpoints.
Activating the Standby Environment
If you have a Disaster Recovery deployment, then upon failure of the active environment, do the following to activate the standby environment:
- On the standby JetPatch Manager Console, make sure that replication has been occurring, by checking the replication service status:
service intigua-sync status
- If still possible, stop services in the active location:
- On the active server, run:
/etc/init.d/tomcat_watchdog stop
/etc/init.d/tomcat stop
/etc/init.d/nginx stop
- On the active database, run:
/etc/init.d/postgresql-9.3 stop
- On the active server, run:
- On the standby database, create an activation trigger file by running:
touch /var/lib/pgsql/9.3/data/failover.trigger
- On the standby server, start services by running:
/etc/init.d/tomcat_watchdog start
/etc/init.d/tomcat start
/etc/init.d/nginx start
- Update DNS records so that the URL that until now pointed to the active server now points to the standby server.
Reverting to the Active Environment
After activating a standby environment, to bring the originally active environment back up, you can, if necessary, rebuild the JetPatch Manager Console and/or database as when setting it up.
Once the originally active environment is available, revert to it as follows:
This procedure overwrites database contents in the original environment, under the assumption that the standby database is current. If this is not the case, following this procedure could result in permanent data loss.
- Stop the standby server by running:
/etc/init.d/tomcat_watchdog stop
/etc/init.d/tomcat stop
/etc/init.d/nginx stop
- On the originally active database host:
- Stop the database by running:
/etc/init.d/postgresql-9.3 stop
- Back up the data directory by renaming it:
mv /var/lib/pgsql/9.3/data /var/lib/pgsql/9.3/data_old
- Recover current data from the standby database by running:
su - postgres
/usr/pgsql-9.3/bin/pg_basebackup -h <standbyDB> -U postgres -D /var/lib/pgsql/9.3/data -X stream -P
where
<standbyDB>
is the IP address or resolvable name of the standby database. - Overwrite the copied configuration files with the backed up ones by running:
cp /var/lib/pgsql/9.3/data_old/postgresql.conf /var/lib/pgsql/9.3/data
cp /var/lib/pgsql/9.3/data_old/pg_hba.conf /var/lib/pgsql/9.3/data
- Stop the database by running:
- On the standby database host:
- Stop the database by running:
/etc/init.d/postgresql-9.3 stop
- Return the database to standby mode by running:
mv /var/lib/pgsql/9.3/data/recovery.done /var/lib/pgsql/9.3/data/recovery.conf
- Start the database by running:
/etc/init.d/postgresql-9.3 start
- Stop the database by running:
- On the active database host, start the database by running:
/etc/init.d/postgresql-9.3 start
- Verify that the databases are running and replicating by inspecting the following directory on both database servers:
/var/lib/pgsql/9.3/data/pg_log
- Copy the following directory and file from the current, standby server to the originally active one:
/usr/share/intigua/package
/usr/share/tomcat/default/conf/intigua.secret
- Start the active server by running:
/etc/init.d/tomcat_watchdog start
/etc/init.d/tomcat start
/etc/init.d/nginx start
- Update DNS records to point to the active server.
Troubleshooting Data Replication
In a Disaster Recovery deployment, it may happen that the active database is ahead of the standby database. An indication of this could be that the log file records something like:
CST >ERROR: requested starting point 0/3B000000 is ahead of the WAL flush position of this server 0/39044BD0
In these cases, manually replicate data from the active database to the standby database as follows:
- Stop the active JetPetch Manager Console by running:
/etc/init.d/tomcat_watchdog stop
/etc/init.d/tomcat stop
/etc/init.d/nginx stop
- On the standby database host:
- Stop the database by running:
/etc/init.d/postgresql-9.3 stop
- Back up the data directory by renaming it:
mv /var/lib/pgsql/9.3/data /var/lib/pgsql/9.3/data_old
- Recover current data from the standby database by running:
su - postgres
/usr/pgsql-9.3/bin/pg_basebackup -h <standbyDB> -U postgres -D /var/lib/pgsql/9.3/data -X stream -P
where
<standbyDB>
is the IP address or resolvable name of the standby database. - Overwrite the copied configuration files with the backed up ones by running:
cp /var/lib/pgsql/9.3/data_old/postgresql.conf /var/lib/pgsql/9.3/data
cp /var/lib/pgsql/9.3/data_old/pg_hba.conf /var/lib/pgsql/9.3/data
- Stop the database by running:
- On the active database host:
- Stop the database by running:
/etc/init.d/postgresql-9.3 stop
- Return the database to standby mode by running:
mv /var/lib/pgsql/9.3/data/recovery.done /var/lib/pgsql/9.3/data/recovery.conf
- Start the database by running:
/etc/init.d/postgresql-9.3 start
- Stop the database by running:
- On the standby database host, start the database by running:
/etc/init.d/postgresql-9.3 start
Comments
0 comments
Please sign in to leave a comment.