MySQL Cluster high availability environment to build
01, MySQL high availability environment program
02, MySQL master-slave replication principle
03, MySQL master-slave replication action
04, install MySQL on Linux environment
05, configure the master-slave replication on MySQL Cluster Environment
Brought 06, MySQL high availability clustering problem
07, MySQL use to read and write separation MyCat
08, sub-sub-table library plug ShardingJdbc
09, MySQL database indexes underlying principle (focus)
10, MySQLSQL the statement Performance Optimization
MySQL database brief
MySQL uses as one of the most widely used database in the world, free is one of the reasons. But it can not be ignored is that the function itself is indeed very powerful. With the development of technology in the actual production environment, not by a single MySQL database server to meet the actual demand. At this point the database cluster on a good solution to this problem. MySQL uses a distributed cluster, can build a high concurrency, load balancing cluster server (this blog does not involve temporarily). Prior to this we have to ensure that each server in the MySQL data synchronization. We can synchronize data can easily be completed by MySQL internal configuration, there are master replication and master-master replication from (master slave).
Introduction from master copy
I believe that many students in learning Redis has been to find out about the role of master-slave replication. In MySQL clustered environment, it can be divided from the master node and the node can be achieved by copying data from the primary backup, failover, MySQL Cluster, high availability, separate read and write and the like. MySQL master is copied from MySQL itself comes with a feature that does not require additional third-party software can be achieved, it is not a copy function to copy files to achieve, but with the master binlog log file inside the SQL commands implemented from copy, and then I can be understood as a master-side implementation of SQL commands, it will perform again at the same Salve end, so as to achieve master-slave replication.
Copy the master-slave principle
MySQL master is copied from MySQL itself comes with a feature that does not require additional third-party software can be achieved, it is not a copy function to copy files to achieve, but with the master binlog log file inside the SQL commands implemented from copy, and then I can be understood as a master-side implementation of SQL commands, it will perform again at the same Salve end, so as to achieve master-slave replication. Library is generated from two threads, one I / O thread, a thread SQL; i / o requests binlog thread to the main library, and writes the obtained log binlog relay log (relay log) file; primary library is generated a log dump thread, from a library used to binlog i / o threads pass; the SQL thread reads the relay log log file, and parsed into specific operation to achieve consistent master-slave operation, and consistent final data;
The main configuration from the replication environment
Two server ready
192.168.212.201 main server configuration
192.168.212.202 configuration from the server