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 > Cloud Computing Makes MySQL Replication Easier

Cloud Computing Makes MySQL Replication Easier

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

Join the DZone community and get the full member experience.

Join For Free
MySQL Replication tends to be complex.

Creating a new slave to support your system expansion is not easier: copying large data files over the LAN, recovering replication, etc.

Fortunately, virtualization and SAN help us do it easier and faster.

Lucky us, Cloud Computing make it even easier.

Adding a New Slave is Easier than Ever
  1. Select an existing slave that can be reboot w/o affecting the service.

    1. Take the slave out of the production environment.
    2. Stop the MySQL slave and perform a read lock: SLAVE STOP;FLUSH TABLES WITH READ LOCK;

    3. Create an AMI based on this instance using AWS console or API.
    4. Recover the instance upon AMI creation completion and get the slave back to production: UNLOCK TABLES;SLAVE START;SHOW SLAVE STATUS\G

     

  2. Create a new slave based on the AMI

    1. Launch a new slave using the AWS console or API.
    2. Change the server's /etc/my.cnf file to fit a new slave instance:

      1. Change the server-id=N value to a new numeric value.
      2. Set relay-log='server-relay-bin' to the original slave server relay log name. (if you want to make it even easier, configure in the first slave's my.cnf relay-log=mysqld-relay-bin, and you'll be able to avoid this step).
    3. Restart the MySQL instance: sudo /etc/init.d/mysql restart

    4. Recover the MySQL: UNLOCK TABLES;SLAVE START;SHOW SLAVE STATUS\G

    5. Add this new slave to the production environment.

     

Bottom Line
Expanding your business today is easier w/o the need for file copy or any other tedious action.

Keep Performing,
Cloud computing MySQL Replication (computing) Computing

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • 5 Myths of Kubernetes
  • How to Submit a Post to DZone
  • What I Miss in Java, the Perspective of a Kotlin Developer
  • What Are Microservices?

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