Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions

  




 

 

16.7.6. Starting Replication (Single Replication Channel)

This section outlines the procedure for starting MySQL CLuster replication using a single replication channel.

  1. Start the MySQL replication master server by issuing this command:

    shellM> mysqld --nbdcluster --server-id=id \ 
            --log-bin --binlog-format=row &
    

    where id is this server's unique ID (see Section 16.7.2, “Assumptions and General Requirements”). This starts the server's mysqld process with binary logging enabled using the proper logging format.

  2. Start the MySQL replication slave server as shown here:

    shellS> mysqld --ndbcluster --server-id=id &
    

    where id is the slave server's unique ID. It is not necessary to enable logging on the replication slave.

    Note that you should use the --skip-slave-start option with this command or else you should include skip-slave-start in the slave server's my.cnf file, unless you want replication to begin immediately. With the use of this option, the start of replication is delayed until the appropriate START SLAVE statement has been issued, as explained in Step 4 below.

  3. It is necessary to synchronize the slave server with the master server's replication binlog. If binary logging has not previously been running on the master, run the following statement on the slave:

    mysqlS> CHANGE MASTER TO
         -> MASTER_LOG_FILE='',
         -> MASTER_LOG_POS=4;
    

    This instructs the slave to begin reading the master's binary log from the log's starting point. Otherwise — that is, if you are loading data from the master using a backup — see Section 16.7.8, “Implementing Failover with MySQL Cluster”, for information on how to obtain the correct values to use for MASTER_LOG_FILE and MASTER_LOG_POS in such cases.

  4. Finally, you must instruct the slave to begin applying replication by issuing this command from the mysql client on the replication slave:

    mysqlS> START SLAVE;
    

    This also initiates the transmission of replication data from the master to the slave.

It is also possible to use two replication channels, in a manner simlar to the procedure described in the next section; the differences between this and using a single replication channel are covered in Section 16.7.7, “Using Two Replication Channels”.


 
 
  Published under the terms of the GNU General Public License Design by Interspire