#Galera集群特点
No delay between clusters, synchronous replication. While Master-slave master-slave asynchronous replication, there is a delay.
Active-active Multi-master, the cluster internal server is written at the same time, must wait for all the databases in the cluster to complete the data write, the feedback is complete, so there is no data loss situation.
The cluster node automatically fails over, and if a single node fails in the cluster, the failed node is automatically purged.
The extension is convenient, as long as the new node is added to the cluster, the new node automatically replicates the data.
#Galera集群原理
#主要通过galera插件保证数据的一致性, the process of copying the data is a certified replication, and the principle is as follows:
650) this.width=650; "src=" Http://7xk2is.com1.z0.glb.clouddn.com/mariadb-galera-cluster.png "/>
#解析
#客户端请求update更新数据, after a server in the Galera cluster receives the request, the local process feedback ok,client commits the data that requires a commit change, and when the server receives the commit transaction, all changes to the data are write-set collected. and sends the Write-set record content to the other nodes. Write-set will be authenticated before each node executes certification, if the authentication passed, the node application Write-set record change data, if the authentication fails, the node will discard discard Write-set, The other node rolls back rollback the transaction.
#Galera集群搭建
#环境: Centos7
#数据库版本: 10.1.16-mariadb
CENTOS7 Installing MARIADB galera cluster DB cluster & detailed