#create 6 200GB EBS Volumes. These must be in the same zone you launched your instance
ec2-create-volume --size 200 --availability-zone us-east-1c
ec2-create-volume --size 200 --availability-zone us-east-1c
ec2-create-volume --size 200 --availability-zone us-east-1c
ec2-create-volume --size 200 --availability-zone us-east-1c
ec2-create-volume --size 200 --availability-zone us-east-1c
ec2-create-volume --size 200 --availability-zone us-east-1c
#Attach all 6 volumes to the instance created. Your vol-[ids] and -i id will be diggerent
ec2-attach-volume vol-6d3d1207 -i i-34fa12e4 -d /dev/sdh1
ec2-attach-volume vol-493d2412 -i i-34fa12e4 -d /dev/sdh2
ec2-attach-volume vol-453d212f -i i-34fa12e4 -d /dev/sdh3
ec2-attach-volume vol-212d244f -i i-34fa12e4 -d /dev/sdh4
ec2-attach-volume vol-123d245f -i i-34fa12e4 -d /dev/sdh5
ec2-attach-volume vol-1b3d1271 -i i-34fa12e4 -d /dev/sdh6
#We're going to software RAID all these volumes. Install some tools we'll need.
sudo apt-get install mdadm xfsprogs
#Configure the raid array using RAID0.
yes | sudo mdadm --create /dev/md0 --chunk=256 --level 0 --raid-devices 6 /dev/sdh1 /dev/sdh2 /dev/sdh3 /dev/sdh4 /dev/sdh5 /dev/sdh6
echo DEVICE /dev/sdh1 /dev/sdh2 /dev/sdh3 /dev/sdh4 /dev/sdh5 /dev/sdh6 | sudo tee /etc/mdadm.conf
echo mdadm --detail --scan | sudo tee -a /etc/mdadm.conf
sudo mkfs.xfs /dev/md0
echo "/dev/md0 /volr xfs noatime 0 0" | sudo tee -a /etc/fstab
sudo mkdir /volr
sudo mount /volr
df -h
#Install some tools so we can use ec2-consistent-snapshot
sudo add-apt-repository ppa:alestic &&
sudo apt-get update &&
sudo apt-get install -y ec2-consistent-snapshot
ec2-consistent-snapshot --aws-access-key-id KEY \
--aws-secret-access-key SECRET --region us-east-1 \
--xfs-filesystem /volr vol-6d3d2407 vol-493d2423 vol-453d242f vol-353d245f vol-1b3d2471
I use an instance store with the MySql data on a volume which gets mounted by Chef. Works well.There is a script around to do persistent snapshots with MySql. I'd recommend finding that.
Cheers,EdwardOn Wed, Feb 29, 2012 at 4:22 AM, millisami r < " target="_blank"> > wrote:
Hi Chefs!I'm developing infrastructure on EC2 using Chef and its standard application and database cookbook.For the mysql database storage, I want some feedback on choosing what to setup.If I fire up the instance with the EBS-backed store, then the db master will be an instance, or if I fire the instance-store VM, then I've to attach/mount a Volume to store the database data.So, my question is which way to go? Can you share your experience if you have faced such situation?
@millisami
~Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Archive powered by MHonArc 2.6.16.