MySQL on EBS

33 views
Skip to first unread message

Paul Canavese

unread,
Nov 6, 2009, 7:52:58 PM11/6/09
to rubber
Hi Matthew,

First, I'm really appreciating rubber, so thanks for all the hard work
you put into it!

I'm setting up my MySQL data on an EBS volume. From one of your
posts, it sounds like you're not currently using this configuration,
but I was curious as to how you had this configured previously.

Did you only store the MySQL data and log directories in EBS? Or did
you also store the /etc/mysql and /var/lib/mysql directories there (as
in Eric Hammond's tutorial)? If not, why not?

Certainly, there are some extra steps that need to take place for that
to work (which I'm working through), but I'm wondering if there are
any other good reasons not to take this approach.

Thanks,

Paul

Matthew Conway

unread,
Nov 6, 2009, 11:54:08 PM11/6/09
to rubbe...@googlegroups.com
On Nov 6, 2009, at Fri Nov 6, 7:52 PM, Paul Canavese wrote:

I'm setting up my MySQL data on an EBS volume.  From one of your
posts, it sounds like you're not currently using this configuration,
but I was curious as to how you had this configured previously.

I'm not using it on a high traffic project, but am using it on a lower traffic one.

Did you only store the MySQL data and log directories in EBS?  Or did
you also store the /etc/mysql and /var/lib/mysql directories there (as
in Eric Hammond's tutorial)?  If not, why not?

Since rubber makes it easy to change my.cnf, I just stick the data/logs in /mnt/mysql (regardless of EBS), and have my.cnf point there.  This is what rubber does by default, and I haven't had any problems with it over the last couple of years, so should be good enough for most people.  This also makes it easy to then make the /mnt/mysql mount to an EBS store if desired.

To make /mnt/mysql into an EBS store, add something like the following to rubber.yml and then create/bootstrap the db01 instance.

hosts:
  db01:
    availability_zone: us-east-1a
    packages: [xfsprogs, mdadm]
    volumes:
      - size: 50 # size of vol in GBs
        zone: us-east-1a # zone to create volume in, needs to match host's zone
        device: /dev/sdh # OS device to attach volume to
        mount: /mnt/mysql # The directory to mount this volume to
        filesystem: xfs # the filesystem to create on volume

Paul Canavese

unread,
Nov 7, 2009, 10:09:36 AM11/7/09
to rubber
Hi Matthew,

Thanks for the quick reply. I understand how to set it all up in the
default rubber manner, but was curious why that excludes /var/lib/
mysql. Do you not have any concerns about excluding /var/lib/mysql
(which includes ibdata1, ib_logfile0, and ib_logfile1) from the EBS
mount?

Paul

Matthew Conway

unread,
Nov 7, 2009, 10:15:15 AM11/7/09
to rubbe...@googlegroups.com
I also set datadir (=/mnt/mysql/data) in /etc/my.cnf, and reconfigure
mysql when bootstrapping the instance so that mysql creates all the
files it needs in /mnt/mysql/data (including ibdata1, ib_logfile0,
ib_logfile1).
Don't think if it as excluding /var/lib/mysql, so much as moving it to
a new location

Matt

Paul Canavese

unread,
Nov 7, 2009, 6:37:27 PM11/7/09
to rubber
Got it. I thought I was missing something.

-P
Reply all
Reply to author
Forward
0 new messages