Question

My team and I would like to implement "Continuous Deployment" for our website. Continuous Deployment basically means deploying to production very frequently (multiple times a day). Supposedly Etsy does this all the time.

Our environment is Tomcat + Nginx. We already do Continuous deployment of any code change to our snapshot server (ie traditional continuous integration) using Hudson and a Hudson+Cargo plugin that hot deploys.

Surprisingly that works well (albeit over time we have to restart tomcat sometimes).

For production this is not going to work because we can't have the website down. I have some ideas like having two web apps and redirecting while one is down.

Anybody have any ideas or has done this before in a real production environment?

Was it helpful?

Solution

From http://radar.oreilly.com/2009/03/continuous-deployment-5-eas.html:

Real-time alerting. No matter how good your deployment process, bugs can still get through. The most annoying variety are bugs that don’t manifest until hours or days after the code that caused them is deployed. To catch those nasty bugs, you need a monitoring platform that can let you know when things have gone awry, and get a human being involved in debugging them.

To effectively implement continuous deployment to production, you need good monitoring, otherwise you will not understand what is happening with your application.

OTHER TIPS

I don't know WHY you think this is a good idea, but thats up to you.

I would use a balancer application with two hot systems, which can be found in tomcat itself, and then just stop the server before deployment, deploy, and restart the server. Leave a two minute window for each hot server, and you should be good.

EDIT: I wouldn't deploy EVERYTIME. We also are a small company with noch much QA (tm), but it is still one click in the build system to go live.

We use apache httpd 2.2 and mod_proxy for this

We then have 2 tomcats running, one on port 8080, and one on port 88. The firewall prevents outside access to those ports, so only port 80 is open

Apache HTTPd is configured to listen on port 80

It is very simple to configure too. This is a basic configuration (httpd.conf) that will work out of the box:

 LoadModule proxy_module modules/mod_proxy.so
 LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
 LoadModule proxy_http_module modules/mod_proxy_http.so
 <Proxy balancer://mycluster>
    BalancerMember http://localhost:8080
    BalancerMember http://localhost:88 status=+H
 </Proxy>
 ProxyPass / balancer://mycluster/
 ProxyPassReverse / balancer://mycluster/

The "+H" means that it is only used as a backup server, so when 8080 is unreachable, it will run on 88 until 8080 comes back online

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top