Wednesday, October 15, 2014

Running Private Cloud on Cloud

I started working on Cloud almost one and half years ago. Cloud has been a roller coaster ride for me. First I started with moving on-premise data center web application to AWS cloud. It has been a great experience. I have to admit that AWS is awesome.


Once done with moving on-premise web application to cloud, I have been working on setup, configuration and automation of Private Cloud for our company as well as clients on Cloud for the last 4-5 months. I would like to share my experience and work through this blog. Suggestions and feedback would be appreciated.

Basically private cloud web applications needs Apache, Tomcat, Database and storage to run.

I have created an AMI template that has Apache, Tomcat, Database (mysql) service installed as well as created, attached and configured EBS volume needed for apache,  tomcat database and storage.

AWS ephemeral storage are free and great for use for temporary storage, so I use ephemeral storage for /tmp.  Ephemeral, by default only supports ext3 filesystem and /tmp need to have permission of 1777 for my private cloud web application use. I am mounting ephemeral as /tmp directory as boot time using fstab. I am also using boot service to set /tmp permission to 1777.

This is a Base AMI for Private Cloud. I am using Vagrant to fire up new instance from AMI template. I am also using shell and puppet to provision instance to make it ready for web application.

I am using shell provision to update OS, install necessary repository and of course puppet repo and package for instance provisioning.

I am doing all apache, tomcat, database, storage configuration using puppet. I am also doing all the necessary setup and configuration for web application using puppet like creating all directory, rsync configuration, database optimization, apache VH configuration, tuning, setting database root password, creating database. creating users and permissions.

I am using flywaydb for web application's database version control. So once instance is provisioned and up and running, I do initialize database with flywaydb and run database migration which will migrate all tables and data needed for web application to run.

When migration is done, I deploy web application and restart tomcat. Once tomcat restart is done, private cloud is ready for use.

I still have lots of things to get done in terms of automation and cloud.

I use Packer to convert AMI template to different format so that it can be used for KVM, VMware, Oracle Box, Docker etc.


No comments:

Post a Comment