QuerySurge Database Backup Procedures
QuerySurge is backed by a MySQL database. The QuerySurge database persists all your QuerySurge data, including QueryPairs, Suites, Scenarios and Results data. Your only protection against data loss is a regular backup schedule. This means backing up the QuerySurge database data directory on a regularl basis. Key recommendations for your backup procedure follow.Note: You will need Administrative rights for the backup tasks discussed in this article. Depending on your login rights, on Windows, you may need to use 'Run as Administrator'. On Linux, you may need to login as a sudoer to use the sudo command (or its equivalent) for your system.
QuerySurge Backups
- The critical directory for backups is the QuerySurge Database data directory. This is where the backing files for the database are stored. The default QuerySurge Database data directory is located at:
<QuerySurge Install Dir>\QuerySurge\mysql\data
The default locations are as follows:
Windows: C:\Program Files\QuerySurge\mysql\data
Linux: /opt/QuerySurge/mysql/dataNote: Data directories can be moved to non-standard locations. Please ensure you are backing up the correct data directory.
Critical: Under no circumstances should you move, delete or modify any files in your QuerySurge database data directory. Any actions that you take may result in irrecoverable data loss.
- Cold backups are strongly recommended. This means that all users must be out of the system, and no executions should be running. The QuerySurge Database should be shut down. The QuerySurge App Server should be shut down as well. Agents and Statsmon should be shut down as well, but in any case, will need to be re-started once the Database and App Server are both back up.
Critical: Hot backups run the risk of creating a defective set of backup files. In extreme cases the database may not be recoverable.
- MySQL has a slow shutdown option for shutdowns prior to executing a file-level backup. It is strongly recommended that you perform a slow shutdown prior to executing a backup. You can execute a slow shutdown of the QuerySurge database using the QuerySurge database Start-Stop Utility (see the Resources section at the end of this article to download the Start-Stop Utility). The Database Start-Stop Utility must be deployed on and run on your QuerySurge database server.
Sample execution files are provided with the Start-Stop utility:
querysurgestartstop.bat (Windows)
querysurgestartstop.sh (Linux)
You will have to edit these files to conform to the locations where you have deployed the Start-Stop Utility.Critical: The slow shutdown procedure may take considerably longer than a regular shutdown to complete, depending on the state of the database when the shutdown command is issued. It is imperative to let the slow shutdown procedure complete before proceeding to any subsequent steps. Any interruption of the slow shutdown could create an irrecoverable corruption in your database.
Note: For additional information on slow shutdowns, see this article.
- QuerySurge databases can grow to significant size, depending on the number of Scenario executions that you retain. Database size affects backup storage requirements and backup time. Consider a regular program of purging unneeded data from QuerySurge, using QuerySurge’s Scenario Data Management or Data Retention features (Admin view > Data Storage) to discard unneeded Scenario results. It is best to purge your QuerySurge database of unneeded runs prior to executing a backup.
- A backup schedule of once every 24 hours for your QuerySurge database data directory is strongly recommended. This is the best protection against data loss in an outage.
- As noted, to execute backup procedures, you will need Admin rights on all QuerySurge boxes.
Backup Procedures
Stopping QuerySurge Services before backup
- Make sure all users are logged out and that all executions are completed. QuerySurge should be quiescent.
- Shut down all QuerySurge Agents.
Windows:
Use the Windows Services console to stop each QuerySurgeAgent service.
Linux:
Use the following command:
[sudo] service QuerySurge stop agent
- Shut down QuerySurge Statsmon.
Windows:
Use the Windows Services console to stop the QuerySurgeStatsmon service.
Linux:
Use the following command: service QuerySurge stop statsmonNote: Depending on your login rights, on Linux you may need to use the sudo command or its equivalent for your system:
[sudo] service QuerySurge stop statsmon
- Shut down the QuerySurge App server.
Windows:
Use the Windows Services console. stop the QuerySurgeTomcat service.
Linux:
Use the following command:
[sudo] service QuerySurge stop tomcatNote: Depending on your login rights, on Linux you may need to use the sudo command or its equivalent for your system:
[sudo] service QuerySurge stop tomcat
- Shut down the QuerySurge Database server.
Windows:
Use querysurgestartstop.bat; make the proper path modifications in the .bat file before using to stop your QuerySurge database.
Linux:
Use querysurgestartstop.sh; make the proper path modifications in the .sh file before using to stop your QuerySurge database. You will most likely need to make this file executable once you have downloaded it to your Linux environment.
[sudo] ./querysurgestartstop.shNote: Depending on your login rights, on Linux you may need to use the sudo command or its equivalent for your system:
[sudo] ./querysurgestartstop.sh
This should initiate a slow shutdown. After successful shutdown, you can copy the mysql/data directory to complete the backup. This may take significant time, depending on the state of the database at the time the shutdown command is issued.
Starting QuerySurge Services after backup
- Starting QuerySurge:
Start QuerySurge services in the following order: QuerySurgeMySQL, QuerySurgeTomcat, QuerySurgeAgent(s), QuerySurgeStatsmon
Windows:
Use the Windows Services console to start the services. If you have deployed on multiple boxes, you will have to access each box to start its service(s).
Linux:
Start the services with the following commands, reversing the procedure order above. Again, you may need to use a sudoer login or its equivalent for your system.
[sudo] service QuerySurge start mysql
[sudo] service QuerySurge start tomcat
[sudo] service QuerySurge start agent
[sudo] service QuerySurge start statsmon
Additional Recommended Files for Backup
- Backup of the MySQL configuration is recommended, as part of your routine backup procedure. While the configuration file is only changed periodically, having a current version is essential in case of an outage. You can back up the configuration by backing up the configuration file (default paths follow; if you installed in a non-default location, your path will differ):
Windows: C:\Program Files\QuerySurge\mysql\my.ini
Linux: /opt/QuerySurge/mysql/my.cnf
- We recommend backing up the following files/directories periodically:
Windows:
<QuerySurge Install Dir>\tomcat\conf\catalina\localhost\QuerySurge.xml
<QuerySurge Install Dir>\tomcat\conf\server.xml
<QuerySurge Install Dir>\tomcat\webapps\QuerySurge\project_exports
<QuerySurge Install Dir>\tomcat\webapps\QuerySurge\backups
<QuerySurge Install Dir>\agent\config\agentconfig.xml
<QuerySurge Install Dir>\java\lib\security\cacerts (or any externally created SSL keystore/certificate)
Linux:
<QuerySurge Install Dir>/tomcat/conf/catalina/localhost/QuerySurge.xml
<QuerySurge Install Dir>/tomcat/conf/server.xml
<QuerySurge Install Dir>\tomcat\webapps\QuerySurge\project_exports
<QuerySurge Install Dir>\tomcat\webapps\QuerySurge\backups
<QuerySurge Install Dir>/tomcat/scripts/ctl.sh
<QuerySurge Install Dir>/agent/config/agentconfig.xml
<QuerySurge Install Dir>/java/lib/security/cacerts (or any externally created SSL keystore/certificate)
- We recommend backing up the up the following Agent directory periodically (this directory contains your JDBC drivers):
<QuerySurge Install Dir>\agent\jdbc\
Resources
QuerySurge Database Start-Stop Utility Zip Download
Comments
0 comments
Article is closed for comments.