MySQL's Replication is an asynchronous replication process, from a MySQL node (called master) to a MySQL node (called the slave). The entire replication process between Master and Slave is completed by three threads. Of these, two threads (SQL thread and I/O thread) are on the Slave side. Another thread (I/O thread) is on the Master side.
To implement MySQL's Replication. You must first turn on the Binary log on the master side, as the entire replication process is actually the various operations logged in the log that Slave the log from the master side and then runs it in its own order.
It seems that MySQL's replication principle is very easy to summarize:
Each one can only be set from one master.
After the master runs SQL, log the binary log file (Bin-log).
From the connection master. And get Binlog from the master. Save in local relay-log and run SQL from the location you last remembered. Stop syncing once an error is encountered.
Judging from these several replication principles. Can have these inferences:
Master-slave database is not real-time synchronization, even if the network connection is normal, there is an instant, master-slave data inconsistency.
Assume that the master-slave network is disconnected. From the network after the normal, batch synchronization.
Assume that the data is changed from the. It is very likely that the synchronization will be stopped from an error while running the main bin-log, which is a very critical operation. So under normal circumstances. Very careful to change the data from above.
A derivative configuration is a two-master, mutual main from the configuration, only to the changes of the parties do not conflict, can work well.
If you need more than one master. Can be configured with a ring. This allows arbitrary node changes to be synchronized to all nodes.
Read the full text
Report
- This article has been included in the following column:
0Article comments
-
-
-
Related articles recommended
-
Replication Redis Replication is a very simple to use and configure Master-slave Replication that allows slave R ...
- Mishifangxiangdefeng
- 2015-09-28 17:23
- 760
-
Replication This is the master-slave backup of PG, that is, there is a host to change to one or more sub-machine, pg Master-slave machine is through the log to achieve, rather than the use of simple SQL, the host is sender, slave is receiver, is the process, How many receive ...
- Spche
- 2012-05-02 23:41
- 941
-
Welcome to CSDN Program Life public Attention Program ape life, gathering development anecdotes.
-
MySQL Replication often uses the architecture preface mysqlreplicaion itself is a simpler architecture, is a MySQLServer (Slave) from a MySQLServer (Master) to log replication and then parse the log and apply it to itself. A replication environment ...
- u013614451
- 2015-10-04 22:39
- 687
-
MySQL Replication need to pay attention to the problem of MySQL Replication everyone is very familiar with, I will not write how to build and copy the principle of online related articles many, we can search by themselves. I'm here to summarize the areas where MySQL master-slave replication needs to be noted. Some people say the master-slave copy is ...
- yu757371316
- 2017-03-24 15:51
- 229
-
Backup Strategy Iv. using the master-slave replication mechanism (replication) MySQL supports one-way, asynchronous replication, one server acting as the primary server during replication, and one or more other servers acting as slave servers. The primary server writes the update to the binary log file and maintains an index of the log file to track the log loop. When a connection from the server to the Master service ...
- Ty_soft
- 2011-11-16 13:30
- 382
-
(first draft) SQL Server Replication (Replication) series (2)--Transactional replication Setup This article demonstrates how to build the most significant transactional replication. Environment Preparation: Virtual Machine 2: The server name is Repa and Repb,repa for advertisement SERVER,REPB as subscriber. Are installed WindowsServer 2008r2 English version (working in a foreign company ...
- Dba_huangzj
- 2014-03-11 14:13
- 13479
-
Replication replication Replication replication: Redis replication is based on a very easy to use and configure Master-slave replication, agreeing slave Redis server can accurately copy master servers . s ...
- zhaoyangjian724
- 2017-06-28 17:46
- 99
-
Replication Replica set Schema mode configuration Mongod basic configuration items for replication: replication:oplogsizemb: #oplog大小, MB, default 10240 replsetname: ...
- Wolgame
- 2016-02-18 18:35
- 304
-
mysql Replication master-Slave synchronization principle and configuration MySQL Replication is a multi-MySQL database called from the synchronous scheme, characterized by asynchronous, widely used in a variety of MySQL have higher performance, higher reliability requirements of the occasion.
There is also a technique for synchronizing MySQL clust ...
- Lang_man_xing
- 2014-07-30 16:07
- 2030
-
MySQL Replication basic principle (a) The idea of replication is to synchronize and back up data in multiple nodes of the cluster to improve the availability of cluster data (HA); MySQL uses the replication architecture for this purpose, At the same time, the overall concurrency of the cluster can be improved.
5.6 Version number as a milestone. Replication has made a lot of optimization adjustment, improve the consistency of cluster data, synchronization performance and data self-recovery (recovery) ability. (This article is based on MySQL 5.6+, except that the 5.7+ version number is still partially adjusted) <p style= "Font-size
- qing____
- 2016-01-23 12:54
- 2401
-
-
hackersandpainters + attention
-
Original
-
153
-
Fans
-
171
-
Like
-
0
- frequent use of OPS open source tools
- The principle of xtrabackup implementation
- mysql5.6 New features
- MySQL 5.7 new features explained
many other articles
Online Courses
-
Utm_source=blog7 "target=" _blank ">
-
Utm_source=blog7 "target=" _blank ">" Live "Computer vision principle and actual combat-Professor Qu
-
-
"Package" Spark+scala Course Package--Chen Chao
- folder
-
- like to cancel like
- Collection
- share Weibo QQ
Collection Assistant Bad news report