PDF (A4) - 35.2Mb
Man Pages (TGZ) - 256.4Kb
Man Pages (Zip) - 361.2Kb
Info (Gzip) - 3.4Mb
Info (Zip) - 3.4Mb
MySQL Globalization
MySQL Information Schema
MySQL Installation Guide
MySQL and Linux/Unix
MySQL and macOS
MySQL Partitioning
MySQL Performance Schema
MySQL Replication
Using the MySQL Yum Repository
MySQL Restrictions and Limitations
Security in MySQL
MySQL and Solaris
Building MySQL from Source
Starting and Stopping MySQL
MySQL Tutorial
MySQL and Windows
MySQL NDB Cluster 7.5
This section outlines the procedure for starting NDB Cluster replication using a single replication channel.
Start the MySQL replication source server by issuing this command, where
idis this server's unique ID (seeSection 21.7.2, “General Requirements for NDB Cluster Replication”):shellS> mysqld --ndbcluster --server-id=id \ --log-bin --ndb-log-bin &This starts the server'smysqld process with binary logging enabled using the proper logging format.
NoteYou can also start the source with
--binlog-format=MIXED, in which case row-based replication is used automatically when replicating between clusters. Statement-based binary logging is not supported for NDB Cluster Replication (seeSection 21.7.2, “General Requirements for NDB Cluster Replication”).Start the MySQL replica server as shown here:
shellR> mysqld --ndbcluster --server-id=id &In the command just shown,
idis the replica server's unique ID. It is not necessary to enable logging on the replica.NoteYou should use the
--skip-slave-startoption with this command or else you should includeskip-slave-startin the replica server'smy.cnffile, unless you want replication to begin immediately. With the use of this option, the start of replication is delayed until the appropriateSTART SLAVEstatement has been issued, as explained in Step 4 below.It is necessary to synchronize the replica server with the source server's replication binary log. If binary logging has not previously been running on the source, run the following statement on the replica:
mysqlR> CHANGE MASTER TO -> MASTER_LOG_FILE='', -> MASTER_LOG_POS=4;This instructs the replica to begin reading the source server's binary log from the log's starting point. Otherwise—that is, if you are loading data from the source using a backup—seeSection 21.7.8, “Implementing Failover with NDB Cluster Replication”, for information on how to obtain the correct values to use for
MASTER_LOG_FILEandMASTER_LOG_POSin such cases.Finally, instruct the replica to begin applying replication by issuing this command from themysql client on the replica:
mysqlR> START SLAVE;This also initiates the transmission of data and changes from the source to the replica.
It is also possible to use two replication channels, in a manner similar to the procedure described in the next section; the differences between this and using a single replication channel are covered inSection 21.7.7, “Using Two Replication Channels for NDB Cluster Replication”.
It is also possible to improve cluster replication performance by enablingbatched updates. This can be accomplished by setting theslave_allow_batching system variable on the replicas'mysqld processes. Normally, updates are applied as soon as they are received. However, the use of batching causes updates to be applied in batches of 32 KB each; this can result in higher throughput and less CPU usage, particularly where individual updates are relatively small.
Batching works on a per-epoch basis; updates belonging to more than one transaction can be sent as part of the same batch.
All outstanding updates are applied when the end of an epoch is reached, even if the updates total less than 32 KB.
Batching can be turned on and off at runtime. To activate it at runtime, you can use either of these two statements:
SET GLOBAL slave_allow_batching = 1;SET GLOBAL slave_allow_batching = ON;If a particular batch causes problems (such as a statement whose effects do not appear to be replicated correctly), batching can be deactivated using either of the following statements:
SET GLOBAL slave_allow_batching = 0;SET GLOBAL slave_allow_batching = OFF; You can check whether batching is currently being used by means of an appropriateSHOW VARIABLES statement, like this one:
mysql> SHOW VARIABLES LIKE 'slave%';+---------------------------+-------+| Variable_name | Value |+---------------------------+-------+| slave_allow_batching | ON || slave_compressed_protocol | OFF || slave_load_tmpdir | /tmp || slave_net_timeout | 3600 || slave_skip_errors | OFF || slave_transaction_retries | 10 |+---------------------------+-------+6 rows in set (0.00 sec)PDF (A4) - 35.2Mb
Man Pages (TGZ) - 256.4Kb
Man Pages (Zip) - 361.2Kb
Info (Gzip) - 3.4Mb
Info (Zip) - 3.4Mb
MySQL Globalization
MySQL Information Schema
MySQL Installation Guide
MySQL and Linux/Unix
MySQL and macOS
MySQL Partitioning
MySQL Performance Schema
MySQL Replication
Using the MySQL Yum Repository
MySQL Restrictions and Limitations
Security in MySQL
MySQL and Solaris
Building MySQL from Source
Starting and Stopping MySQL
MySQL Tutorial
MySQL and Windows
MySQL NDB Cluster 7.5