-
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.
-
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 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.
-
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.