Last week we had a Chef Hack day in Atlanta and I started working on a project I have wanted to do all year. We started a hack to build a multi-tier LAMP stack from scratch. The kicker is that I wanted it to be completely automated. For example I wanted the Load-Balancer to automatically find and configure the Webservers and the Webservers to automatically find and configure the database client connection. We have some sophisticated “Getting Started” guides for doing ROR and Java stacks; however, I wanted to see for myself that I could build one from scratch and understand all the connecting parts. I also wanted to show the power of Chef in that I can do cross-cloud deployments (i.e., abstractions of infrastructure aka. “Infrastructure as Code”). Tonight I have three hours to demonstrate and explain all the moving parts of this stack I have created at a local Los Angeles LOPSALA.
What I am going to demo is a multi-tier LAMP stack running WordPress as the Application stack. I will create four Amazon EC2 instances and two Rackspace instances that will create an automatically built integrated stack.
Happroxy on an EC2 Instance
Webserver (WordPress) on two EC2 Instances
Webserver (WordPress) on two Rackspace Instances
MySQL on an EC2 Instances
I will also show how the complete stack can be created in any order and it will converge to the correct state by running the Chef Client as a daemon. A significant time will be spent explaining the code base that was used to create the stack. As a bonus, if we have time, we can flip the infrastructure and re-start the stack with the HAPROXY and MySQL on Rackspace instead (i.e., with out changing any of the Chef recipes). Hope to see you there.