DZone
Cloud Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Cloud Zone > Stretching your Disk Space on Amazon's MySQL Server

Stretching your Disk Space on Amazon's MySQL Server

Moshe Kaplan user avatar by
Moshe Kaplan
·
Feb. 17, 12 · Cloud Zone · Interview
Like (0)
Save
Tweet
2.69K Views

Join the DZone community and get the full member experience.

Join For Free
If you deal with large databases, you will probably need more than the provisioned storage of the default Amazon AMI (8GB).

The following 10 steps guide will help you expand your disk meet your business needs:
  1. Create a new storage volume at the Amazon console (or using AWS API). Make sure it is big enough to accommodate storage, log files, bin files and future growth. Notice! verify the new drive is in the same availability zone as the target instance.


  2. Write down the mount name you chosen. For example: /dev/sdf.


  3. Mount the disk to your system according to Chris Dean post:

    1. sudo mkfs.ext3 /dev/sdf where /dev/sdf is the mount name you chose.


  4. Shutdown the MySQL daemon: sudo /etc/init.d/mysql stop


  5. Move your current MySQL data directory to a temporary directory: sudo mv /var/lib/mysql  /var/lib/mysql.old


  6. Recreate the MySQL data directory and provide the needed permissions:

    1. sudo mkdir /var/lib/mysql

    2. sudo chown mysql:mysql  /var/lib/mysql


  7. Mount the new disk to the new directory:

    1. Add another line to /etc/fstab (sudo vi /etc/fstab): /dev/sdf /var/lib/mysql ext3 defaults 1 2

    2. Mount the disk: sudo mount /var/lib/mysql

    3. Verify everything is Okay with df


  8. Move the files from the temporary directory back to the new data directory sudo mv /var/lib/mysql.old/* /var/lib/mysql


  9. Remove the old directory: sudo rmdir  /var/lib/mysql.old


  10. Restart you MySQL: sudo /etc/init.d/mysql start

Bottom Line
A combination of cloud knowledge, Linux sysadmin, MySQL expertise and careful work will help you go through the scale and growth challenges.
 

Source: http://top-performance.blogspot.com/2012/02/do-you-need-more-disk-space-for-mysql.html
MySQL Space (architecture)

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Revoking Access to JWTs With a Blacklist/Deny List
  • How Low Code Demands More Creativity From Developers
  • ETL/ELT on Kubernetes With Airbyte
  • 10 Programming Habits a Web Developer Should Embrace

Comments

Cloud Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo