Opened 7 years ago

Closed 7 years ago

#5531 closed Task/To do item (fixed)

Move /var/lib/mysql to its own partition for mosh servers

Reported by: Nat Meysenburg Owned by: Nat Meysenburg
Priority: Low Component: Tech
Keywords: mysql logical-volumes Cc: ross@…
Sensitive: no

Description

Last night we needed to enlarge /var on stone. MySQL was the culprit in filling the partition, and in my experience MySQL and the apt cache are the common things that will fill /var. In our case it will almost always be databases.

There are a lot of reasons to put the databases on their own partition. It makes it much easier to extend and repair the partition, because it is much easier to unmount it. Unmounting /var will generally require a reboot. My hope is to reduce MySQL related down time due to a db filling the partition.

I'm proposing that we:

  • Update our recipes for partitioning of new kvm guests, to put /var/lib/mysql on its own partition.
  • Work through the servers, and switch them over to this setup. The process would look something like:
    • Create a new logical volume on the guest.
    • Add a file system (ext3 ?). And mount the partition somewhere.
    • Stop MySQL
    • Move var/lib/mysql to the new partition, and unmount the partition.
    • Edit /etc/fstab to mount the new partition at the /var/lib/mysql mount point.
    • Mount /var/lib/mysql.
    • Start MySQL

This is not urgent, but I think a project worth doing.

Change History (10)

comment:1 Changed 7 years ago by Ross

Keywords: mysql logical-volumes f2f added
Owner: set to Nat Meysenburg
Status: newassigned

We can discuss this at the face to face.

comment:2 Changed 7 years ago by Ross

Nat and Ross will work on this together to implement it in puppet so that all new moshes get this configuration. That is a logical volume of /var/lib/mysql

comment:3 Changed 7 years ago by Ross

Cc: ross@… added

comment:4 Changed 7 years ago by Ross

Keywords: f2f removed

comment:5 Changed 7 years ago by Ross

I've added the following lines to puppet/modules/mayfirst/templates/kvm/preseed.cfg.erb

    1024 5120 5120 ext3               \
      $lvmok{ }                       \
      method{ format }                \
      format{ }                       \
      use_filesystem{ }               \
      filesystem{ ext3 }              \
      mountpoint{ /var/lib/mysql } .  \

I think this will create the correct volume group for /var/lib/mysql.

comment:6 Changed 7 years ago by Ross

Resolution: fixed
Status: assignedclosed

comment:7 Changed 7 years ago by Daniel Kahn Gillmor

Does this ticket being closed mean that we're not going to retrofit all existing moshes with this setup? If so, i'm fine with that, but i just wanted to be clear.

comment:8 Changed 7 years ago by Ross

Resolution: fixed
Status: closedassigned

mmm...that's a good question dkg. I'll reopen the ticket and let nat make the call on that.

comment:9 Changed 7 years ago by Nat Meysenburg

Resolution: fixed
Status: assignedfeedback

I am fine leaving existing the mosh's the way they are. However, if we find ourselves extending the logical volume that holds the file system mounted as /var on any of them, perhaps we should consider making a switch at that point?

I'm also open to letting whoever is dealing with the filled /var event make the call at the time.

Setting to feedback, to continue the discussion, or let it close on its own.

comment:10 Changed 7 years ago by automatic

Status: feedbackclosed

No news is good news (we hope)! Given the lack of feedback, we think this ticket can be closed.

Please login to add comments to this ticket.

Note: See TracTickets for help on using tickets.