This section outlines the procedure for starting MySQL CLuster replication using a single replication channel.
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 15.10.2, “Assumptions and General Requirements”). This
starts the server's mysqld process with
binary logging enabled using the proper logging format.
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.
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 15.10.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.
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 15.10.7, “Using Two Replication Channels”.

User Comments
Add your own comment.