Introduction:
In this article we are going to cover "how to backup and restore components of DQ+". The DQ+ components consist Load Balancer (NGINX), Application Servers (Tomcat), Application DB (Postgres), and ComputeDB or Analytic DB (Vertica Database). For LB and Application Servers are dependent upon runtime changes which don't require any backups.
For ApplicationDB and ComputeDB, we do require backup in order to save the definitions, dataviews and dashboards.
Backup / Restore Application DB :
- To backup Application DB execute ./backupApplicationDb from /opt/infogix/sagacity-3.0/bin/ of maintenance node.
- To restore Application DB, first list the available backup by executing
./restore applicationdb list . The script will return the available list of Application DB backups.
- Before processing restore bring down the ApplicationServers, and DROP SCHEMA of the database;
StopApplicationServer;
/opt/infogix/sagacity-3.0/bin/stopApplication
Step into the ApplicationDb Docker Container;
docker exec -it sagacityApplicationDb bash
Obtain a connection to the PostgreSQL database,
within the ApplicationDb Docker Container;
psql -U postgres -d igxsagacity
Drop the application schema.
DROP SCHEMA sagacity CASCADE;
Exit the PostgreSQL shell and the Docker container.
‘\q’ ends the current psql session
‘exit’ exits the current Docker session and brings the user back to the terminal. - After above activity, execute ./restore command as follow
[sagacity@sitcafe1 ~]$ /opt/infogix/sagacity-3.0/bin/restore applicationdb 2019-03-28-11-34/igxsagacity_backup.sql.gz
:restore - [INFO] Initializing restore for applicationdb ...
:buildSrc:compileJava UP-TO-DATE
:buildSrc:compileGroovy UP-TO-DATE
:buildSrc:processResources UP-TO-DATE
:buildSrc:classes UP-TO-DATE
:buildSrc:jar UP-TO-DATE
:buildSrc:assemble UP-TO-DATE
:buildSrc:compileTestJava UP-TO-DATE
:buildSrc:compileTestGroovy UP-TO-DATE
:buildSrc:processTestResources UP-TO-DATE
:buildSrc:testClasses UP-TO-DATE
:buildSrc:test UP-TO-DATE
:buildSrc:check UP-TO-DATE
:buildSrc:build UP-TO-DATE
Auth Type=INTERNAL
:restoreApplicationDb
sagacityApplicationDb#0|0
:restoreApplicationDb - [INFO] A backup file with the given name was found [ Filename : 2019-03-28-11-34/igxsagacity_backup.sql.gz ]
sagacityApplicationDb#1|0
:restoreApplicationDb - [INFO] The application database was found
:restoreApplicationDb - [INFO] Database restoration completed succeVERTICA_BACKUP_TYPE=fullssfully.
BUILD SUCCESSFUL
Total time: 13.055 secs - Stop and Start the Application after backup restoration.
Backup the Compute database:
In DQ+ we have an option to take either Full or Incremental backup of ComputeDB. To switch between 'incremental' and 'full', we have to change Vertica backup type property as per our need. This property can be find under /opt/infogix/sagacity-3.0/properties/install.properties. Below changes are runtime changes and doesn't require redeployment of the Application.
For Full Backup:
VERTICA_BACKUP_TYPE=full
For Incremental Backup:
VERTICA_BACKUP_TYPE=incremental
Backup / Restore :
- Execute the backupApplicationDb script from the /opt/infogix/sagacity3.0/bin directory
/opt/infogix/sagacity3.0/bin/backupComputeDb
- To list all the compute database backups, available to date
[sagacity@sitcafe1 bin]$ ./restore computedb list
--------------------------------------------------------------------------
Backup snapshots available in location /sitshare/infogix/backup/computeDb
--------------------------------------------------------------------------
20190328174449
incremental - Copy the "sagacity_default_backup.ini" file from new backup location to configuration directory under backup directory.
Copy from
/supshare/infogix/backup/computeDb/full/20190613175428/configrations/sagacity_default_backup.ini
Copy to
/supshare/infogix/backup/configrations/sagacity_default_backup.ini - To restore computeDB from available list of backups,
./restore computedb 20190328174449
OR
./restore computedb incremental - Stop/Start the Application after restore completes
Comments
0 comments
Please sign in to leave a comment.