Skip to end of metadata
Go to start of metadata
Here is the deployment checklist used by Sabre's team provided here as an example.
This is probably too complex for small organization or organization that do not develop xplanner but it will give a good idea of what can be done with a mysql production environment with.

This page described the checklist we need to perform for any deployment of XPlanner.
This list must be complete and any steps documented there. If you know there are other issues to be tested or steps to be done, please add them here.

Strategy

We use the same Tomcat instance both for production and rehearsal web applications.
The databases are installed on two databases servers; one for production and one for rehearsal. Both of them are run as Windows service.

  1. Before the migration
  2. During the migration:
    • The web applications should be installed in WEBAPP_REHEARSAL_DIR
      • The old webapp should be called xplanner_old
      • The new webapp should be called xplanner_new
    • The database should be installed on MYSQL_REHEARSAL
  3. After the migration:

When rolling out we want to do the following to the production tomcat webapps:

  1. rename WEBAPP_PRODUCTION_DIR/xplanner webapp to WEBAPP_REHEARSAL_DIR/xplanner_old
  2. copy xplanner.war from staging to WEBAPP_REHEARSAL_DIR/xplanner_new
  3. test if xplanner_old works ok with a copy of the production database
  4. test if xplanner_new works ok with an updated copy of the production database
  5. After we have verified that the rollout is successful, rename WEBAPP_REHEARSAL_DIR/xplanner_new to WEBAPP_PRODUCTION_DIR/xplanner, change properties to point at MYSQL_PRODUCTION database

Since InnoDB table space does not support database renaming by renaming the database associated directory: for a database mydb the associated directory is MYSQL_HOME/data/mydb, we will have to switch database

Procedure

Tips

Scheduling emails in Outlook
Consider scheduling the email to be sent automatically 1 hour before you expect to start, especially if you're coming in early.
Remote production database access setup

If the production databases are not accessible from a remote machine, run the following statement:

Relevant paths

Variable

Path

Description

TOMCAT_PRODUCTION_DIR

D:\autobuild\software\Tomcat5.0\tomcat-for-xplanner

Production tomcat dir

TOMCAT_REHEARSAL_DIR

D:\autobuild\software\Tomcat5.0\tomcat-for-xplanner-rehearsal

Reheasal tomcat dir

WEBAPP_REHEARSAL_DIR

D:\autobuild\software\Tomcat5.0\tomcat-for-xplanner-rehearsal\webapps

Directory where to copy the new and old release to be tested

WEBAPP_PRODUCTION_DIR

D:\autobuild\software\Tomcat5.0\tomcat-for-xplanner\webapps-xplanner

Directory where to copy the product release

BACKUP_DIR

D:\Backup\Backup_<scheduled_rollout_date>

Directory where to copy the previous production release webapp and database dump

TOMCAT_PRODUCTION_WORK_DIR

D:\autobuild\software\Tomcat5.0\tomcat-for-xplanner\work\Catalina\xplan.dev.sabre.com

Directory where tomcat webapp deployment by-products are stored. Make sure it gets cleaned otherwise you could get some stale pages

TOMCAT_REHEARSAL_WORK_DIR

D:\autobuild\software\Tomcat5.0\tomcat-for-xplanner-rehearsal\work\Catalina\xplan.dev.sabre.com

Directory where tomcat webapp deployment by-products are stored. Make sure it gets cleaned otherwise you could get some stale pages

MYSQL_PRODUCTION_DATA

c:\mysql\data-xplanner-production

Directory used by "MySQL - XPlanner prodution" to store data

MYSQL_REHEARSAL_DATA

c:\mysql\data-xplanner-rehearsal

Directory used by "MySQL - XPlanner rehearsal" to store data

Tomcat instances

Variable

Running method

Service name

Startup script name

Shutdown script name

Port

Webapp path

Description

TOMCAT_PRODUCTION

As service

Tomcat - XPlanner

startup-xplanner.bat

shutdown-xplanner.bat

8081

WEBAPP_PRODUCTION_DIR

Production application

TOMCAT_REHEARSAL

command line

-

startup-xplanner-rehearsal.bat

shutdown-xplanner-rehearsal.bat

8084

WEBAPP_REHEARSAL_DIR

Reheasal applications

Databases

Variable

Service name

Port

Data path

Description

MYSQL_PRODUCTION

MySQL - XPlanner production

3308

MYSQL_PRODUCTION

Production database

MYSQL_REHEARSAL

MySQL - XPlanner rehearsal

3309

MYSQL_REHEARSAL

Rehearsal database

Steps

Unknown macro: {float}
Color legend
  • webapp steps
  • database steps
  • email steps
  • very, very important
  1. Never do a rollout alone.
  2. *We only rollout successful staging builds.
  3. Corrollary: we cannot rollout without a successful staging build.

48h before

  1. Review this procedure and verify you understand ALL steps
  2. Update [xplanner admin mailing list]
  3. Send the [48h before upgrade notice email]

24h before

  1. If mysql server for MYSQL_REHEARSAL has not started yet, start it from Windows Service
  2. Copy MYSQL_PRODUCTION_DATA to backup directory (BACKUP_DIR)
  3. Override MYSQL_REHEARSAL_DATA with MYSQL_PRODUCTION_DATA
  4. Upgrade xplanner on MYSQL_REHEARSAL
    ***This usually entails running 0 or more sql scripts and running 0 or more java migration programs
  5. Delete TOMCAT_REHEARSAL_WORK_DIR directory
  6. Copy xplanner war or xplanner_stage from staging as xplanner_new into TOMCAT_REHEARSAL_DIR
  7. Rename xplanner_new/WEB-INF/classes/log4j-production.properties to log4j.properties, change the output file.
  8. Rename xplanner_new/WEB-INF/classes/xplanner-custom-production.properties to xplanner-custom.properties
  9. Change xplanner_new/WEB-INF/classes/xplanner-custom.properties to point to MYSQL_REHEARSAL database
    If you make any additional changes to xplanner-custom.properties please check it in immediately in resources/xplanner-custom-production.properties
  10. Copy xplanner_new to WEBAPP__DIR
  11. Test xplanner at http://xplan:8084/xplanner_new by following [these test steps]
      • Test all bugs listed as being fixed
  12. If the test is successfull, schedule the rollout for the following day

0h

  1. Update [xplanner admin mailing list]
  2. Send the [start upgrade notice email]
  3. Shutdown xplanner tomcat
  4. Rename WEBAPP_PRODUCTION_DIR/xplanner to WEBAPP_REHEARSAL_DIR/xplanner_old
  5. Start xplanner tomcat
  6. Verify that http://xplan cannot be reached
  7. Shutdown xplanner tomcat
  8. Copy MYSQL_PRODUCTION_DATA to backup directory (BACKUP_DIR)
  9. Override MYSQL_REHEARSAL_DATA with MYSQL_PRODUCTION_DATA
  10. Change xplanner_old/WEB-INF/classes/xplanner-custom.properties to point to MYSQL_REHEARSAL database
  11. Start rehearsal xplanner tomcat TOMCAT_REHEARSAL
  12. Test xplanner briefly at http://xplan:8084/xplanner_old

    Steps if xplanner_old works fine with MYSQL_REHEARSAL database

    1. Shutdown xplanner tomcat
    2. Upgrade xplanner on MYSQL_PRODUCTION
        • This usually entails running 0 or more sql scripts and running 0 or more java migration programs
    3. Change WEBAPP_REHEARSAL_DIR/xplanner_new/WEB-INF/classes/xplanner-custom.properties to point to MYSQL_PRODUCTION database
    4. Start rehearsal xplanner tomcat TOMCAT_REHEARSAL
    5. Test xplanner briefly at http://xplan:8084/xplanner_new

    Steps if xplanner_old does NOT work with MYSQL_REHEARSAL database

    1. Shutdown xplanner tomcat
    2. Rename WEBAPP_REHEARSAL_DIR/xplanner_old to WEBAPP_PRODUCTION_DIR/xplanner
    3. Change xplanner/WEB-INF/classes/xplanner-custom.properties to point to MYSQL_PRODUCTION database
    4. Start xplanner tomcat TOMCAT_PRODUCTION
    5. Send the [cancelled upgrade notice email]
    6. Let's figure immediately why the recreated database doesn't work properly
    7. Stop here

Steps if the brief test IS successful

  1. Shutdown rehearsal xplanner tomcat TOMCAT_REHEARSAL
  2. Move WEBAPP_PRODUCTION_DIR/xplanner_old to BACKUP_DIR directory
  3. Move WEBAPP_REHEARSAL_DIR/xplanner_new to WEBAPP_PRODUCTION_DIR/xplanner
  4. Increment the last number of xplanner.version property (0.7bx) in xplanner/WEB-INF/classes/xplanner.properties and check it in
  5. Start production xplanner tomcat TOMCAT_PRODUCTION and verify http://xplan works
  6. Send the [successful upgrade notice email]
  7. Set up the next sql update script iterationXX.sql, change cruisecontrol-build.xml to update the production database dump with that new file. Check both files into repository
  8. Congratulate yourself for a successful migration

Steps if the brief test IS NOT successful

  1. Shutdown rehearsal xplanner tomcat TOMCAT_REHEARSAL
  2. Rename WEBAPP_REHEARSAL_DIR/xplanner_old to WEBAPP_PRODUCTION_DIR/xplanner
  3. Change WEBAPP_PRODUCTION_DIR/xplanner/WEB-INF/classes/xplanner-custom.properties to point to MYSQL_PRODUCTION database
  4. Override MYSQL_PRODUCTION_DATA with XPLANNER_REHEARSAL_DATA
  5. Start production xplanner tomcat TOMCAT_PRODUCTION and verify http://xplan works
  6. Send the [cancelled upgrade notice email]
  7. Let's figure immediately why the upgrade went bad
Labels
  • None