Note: Please go to docs.rightscale.com to access the current RightScale documentation set. Also, feel free to Chat with us!
Home > ServerTemplates > Archive > 11H1 > Runbooks > Database Manager for MySQL Stripe Runbook > MySQL Stripe Recipes > Initialize Slave-DB from Master-DB

Initialize Slave-DB from Master-DB

Objective

To initialize a Slave-DB server from a running Master-DB server.

 

Table of Contents

Background

There are two ways to initialize a Slave-DB from a running Master-DB server.  You can either launch a new Slave-DB that will automatically initialize with the running Master-DB at boot time or manually initialize a Slave-DB with the Master-DB by running an operational script.

When you initialize a Slave-DB from a Master-DB, new EBS volumes are created from the most recent backup snapshots of the database.  By default, the most recently completed snapshots will be used (regardless of whether they are backups from a master or slave).

New volumes will be created from the chosen snapshots and mounted to the new Slave-DB.  The contents of the Master-DB will then be copied over to the Slave-DB.  Once all of its contents are in-sync with the master, replication will become active.

For complete details about how to set up a Slave-DB from a Master-DB for the first time, find the appropriate MySQL Database Setup tutorials. 

Steps

Automatically Initialize a Slave-DB (at boot time)

  1. Go to your Deployment (Manage -> Deployments).
  2. Make sure you have an running Master-DB server and a completed backup, where the status of the Snapshots are 100% complete.
  3. Find the server that you want to become a "slave" instance of the Master-DB and click the Launch button.
  4. Make sure the INIT_SLAVE_AT_BOOT input is set to True so that the new slave instance will automatically initialize with the master when launched.
  5. When the server enters the operational state, the Slave-DB will be initialized and will be replicating from the Master-DB.

What feedback to expect

The Events pane will highlight the progress of the operation.  Click on the link to view a detailed output of the action that can be used to troubleshoot the cause of a failure, if necessary.

 


Manually Initialize a Slave-DB

Typically you will configure a Slave-DB so that it automatically initializes with the Master-DB at boot time (INIT_SLAVE_AT_BOOT = True).  However, perhaps you've launched a database server a different way (INIT_SLAVE_AT_BOOT = False).  Follow the steps below to initialize the running database server so that it becomes a Slave-DB of the Master-DB.

  1. Go to your Deployment (Manage -> Deployments).
  2. Click the nickname of the running database server that you want to become a "slave" instance of the Master-DB.  
  3. Under the Scripts tab, run the DB EBS slave init operational script to make the current server a Slave-DB of the Master-DB.  By default, the most recent backup snapshots will be used to create the stripe on the server.  Once the server is initialized, it will start to replicate from the Master-DB.

What feedback to expect

The Events pane will highlight the progress of the operation.  Click on the name of an action in the pane to view a detailed output of the action that can be used to troubleshoot the cause of a failure, if necessary.

 

You must to post a comment.
Last modified
14:12, 7 Oct 2014

Tags

Classifications

This page has no classifications.

Announcements

None


© 2006-2014 RightScale, Inc. All rights reserved.
RightScale is a registered trademark of RightScale, Inc. All other products and services may be trademarks or servicemarks of their respective owners.