Dual bidirectional hot standby mysql

Because it is two-way back up, the configuration of many operations are repeated, except the main sequence is inconsistent, a forward a backward. Here have achieved two-way backup, you can now do something to see results in two separate libraries.

Currently only equipped with two-way main db1 and from its backup, which is the only guarantee of a tutorial www.gendan5.com/mt5.htmlschema MT5 hot standby, and practical applications often use multiple schema relieve pressure on a single server as herein schema backup machine a on B, B of the backup on C, although some cyclic configured as a backup. Note that, when disposed in the hot standby machine B, master or slave can not be arranged in the database in the previous example, a configuration will cover the front repeated on the same port number, and therefore, it is necessary to start using a plurality of single mysqld_multi mysql instance, when another configuration example mysql. mysqld_multi configuration View Bowen: MySQL MySQL's --Linux single launch multiple instances (mysqld_multi)
Third, two-way backup illustrate
 the main library must be enabled Bin log, the main library and the library must have a unique Server Id
 from the library must be clearly understood from the main which offset position which Bin log file from the beginning of the library copy
 can be copied from the library from the main library only the specified database or some data tables in the database
 main library and the library name from the database can be different, but still recommended use the same name
 of the main library and the MySQL repository needs to be consistent
from MySQL3.23.15, MySQL supports one-way asynchronous replication. In other words, 1 MySQL server acts as a Master (main library), one or more MySQL servers act as Slaves (from the library), asynchronous data replication from the Master to the Slaves. Note that this replication is asynchronous, synchronous replication for MySQL is different (this implementation called MySQL Cluster, MySQL Cluster).
当主库有更新的时候,主库会把更新操作的SQL写入二进制日志(Bin log),并维护一个二进制日志文件的索引,以便于日志文件轮回(Rotate)。在从库启动异步复制的时候,从库会开启两个I/O线程,其中一个线程连接主库,要求主库把二进制日志的变化部分传给从库,并把传回的日志写入本地磁盘。另一个线程则负责读取本地写入的二进制日志,并在本地执行,以反映出这种变化。较老的版本在复制的时候只启用一个I/O线程,实现这两部分的功能。

Guess you like

Origin www.cnblogs.com/gendan5/p/12049452.html