26 Jan, 2009 in MySQL by admin

How to Set Up Replication with New Master and Slaves

Setting up with a new master and slaves (that is, with no existing data) is the easiest and most straightforward method for setting up .

You can also use this method if you are setting up new servers but have an existing dump of the from a different server that you want to load into your configuration. By loading the data into a new master, the data will be automatically replicated to the slaves.

To set up between a new master and slave:

  1. Configure the MySQL master with the necessary configuration properties. See Section 16.1.1.2, “Setting the Replication Master Configuration”.

  2. Start up the MySQL master.

  3. Set up a user. See Section 16.1.1.1, “Creating a User for Replication”.

  4. Obtain the master status information. See Section 16.1.1.4, “Obtaining the Master Replication Information”.

  5. On the master, release the read lock:

    mysql> UNLOCK TABLES;
  6. On the slave, edit the MySQL configuration. See Section 16.1.1.3, “Setting the Replication Slave Configuration”.

  7. Start up the MySQL slave.

  8. Execute the CHANGE MASTER TO statement to set the master server configuration.

Perform the slave setup steps on each slave.

Because there is no data to load or exchange on a new server configuration you do not need to copy or import any information.

If you are setting up a new environment using the data from a different existing database server, you will now need to run the dump file generated from that server on the new master. The database updates will automatically be propagated to the slaves:

shell> mysql -h master < fulldb.dump

Bookmark This

No Responses so far | Have Your Say!

Leave a Feedback

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>