Database modularity with EBS volumes
- by Eclyps19
I would like to add modularity to my websites on EC2 instances by encapsulating the site files and the mysql files in their own EBS volumes. The end result that I'm going for is the ability to quickly mount a volume or two to different servers running the same AMI (for testing/development/emergency maintenance, etc), as well as maintain separate snapshots of each.
I'm able to do this fairly easily with a single database by symlinking my mounted database EBS to the appropriate places (/var/lib/mysql, /etc/my.cnf, /var/log/mysqld.log), but I'm not sure if it would even be possible be possible to have multiple databases on different EBS volumes running concurrently.
Example:
/website1/www.website.com
/database1/
/website2/www.otherwebsite.com
/database2/
Could anybody shed some light on this for me? Is it possible? Is it a bad idea? Thanks.