Galera Cluster的內部架構及新節點加入

MariaDB雖然被視為MySQL數據庫的替代品,但它在擴展功能、存儲引擎以及一些新的功能改進方面都強過MySQL。謝謝張樹傑同學為我們準備的這系列MariaDB。希望大家能夠喜歡!

本期主要講訴Galera Cluster的內部架構及新節點加入,前面系列文章:

1): MariaDB Galera Cluster 之一 Database Replication

2):MariaDB Galera Cluster 之二 MariaDB Galera Cluster主要功能、優缺點和對比

一、 內部架構

Galera Cluster的內部架構及新節點加入

Database Management System (DBMS) The database server that runs on the individual node. Galera Cluster can use MySQL, MariaDB or Percona XtraDB.

• wsrep API The interface and the responsibilities for the database server and replication provider. It consists of:

• wsrep hooks The integration with the database server engine for write-set replication.

• dlopen() The function that makes the wsrep provider available to the wsrep hooks.

• Galera Replication Plugin The plugin that enables write-set replication service functionality.

• Group Communication plugins(GCS plugins) The various group communication systems available to Galera Cluster. For instance, gcomm and Spread.

Galera集群的複製功能是基於認證的複製,其流程如下:

Galera Cluster的內部架構及新節點加入

二、 新節點的加入

Galera Cluster的內部架構及新節點加入

新加入的節點叫做Joiner,給Joiner提供複製的節點叫Donor。在該過程中Joiner首先會檢查本地grastate.dat文件的seqno事務號是否在遠端donor節點galera.cache文件裡,如果存在,那麼進行Incremental State Transfer(IST)增量同步複製,將剩餘的事務發送過去;如果不存在那麼進行State Snapshot Transfer(SST)全量同步複製。SST有三種全量拷貝方式:mysqldump、rsync和Xtrabackup。SST的方法可以通過wsrep_sst_method這個參數來設置

這三種備份工具的對比如下表所示:

備份工具

mysqldump

rsync

Xtrabackup

是否鎖表

只備份.frm表結構和MyISAM引擎鎖表

性能

速度慢

速度快

速度較快

可靠性

不推薦

不推薦

推薦


分享到:


相關文章: