Deploying versions with zero downtime ( 2 months later )

October 7, 2014


Again, two months, almost to the day since we last hit problems with deployment, we are here again. Up till the day before, deployments worked fine if a little slow, but now they fail with a timeout. The site is running okay but remains at that version:

The process is now faultless:

Deploying Versions with Zero Downtime”. Here is what we did:

STEP 1) Take a DB snapshot.

STEP 2) Duplicate the environment in AWS management console, using the DB snapshot just created. The new environment took about 18 minutes to spin up, but wasn’t watching closely.

STEP 3) Enable a connection from my IP address: Go to the EC2 dashboard, add an inbound Custom TCP Rule for “my ip address”

STEP 4) update the DB config for new DB instance name, push version to new environment:

git aws.push --environment mymasterenv

STEP 5) Verify the site is working ok in the new environment, then swap the CNAME. Check the database is current. The “CNAME swap” is two clicks and after waiting a couple of minutes, SUCCESS! the site URL now responds with the latest version.

STEP 6) Terminate your old environment. From within the management console this took about 15 minutes, but wasn’t watching closely.

© 2020 Keith P | Follow on Twitter | Git