In case there were changes to data while node was down, there are two options that Node may use when it joins the cluster
State Snapshot Transfer: (SST) and Incremental State Transfer (IST).
SST is the full copy of data from one node to another. It’s used when a new node joins the cluster, it has to transfer data from existing node.
There are three methods of SST available in Percona XtraDB Cluster:
mysqldump, rsync and xtrabackup.
The downside of mysqldump and rsync is that your cluster becomes READ-ONLY while data is being copied from one node to another (SST applies FLUSH TABLES WITH READ LOCK command). Xtrabackup SST does not require READ LOCK for the entire syncing process, only for syncing .frm files (the same as with regular backup)
wsrep_sst_method的参数说明:
Method Speed Blocks Donor?
mysqldump slow yes yes
rsync fastest yes no
xtrabackup fast briefly no
rsync在数据同步(SST和IST)的时候,速度最快,但是会锁住提供数据的节点,xtrabackup只会短暂的锁住节点。
Even with that, SST may be intrusive, that‘s why there is IST mechanism. If you put your node down for a short period of time and then start it, the node is able to fetch only those changes made during the period it wasdown.
This is done using caching mechanism on nodes. Each node contains a cache, ring-buffer, (the size is configurable) of last N changes, and the node is able to transfer part of this cache. Obviously, IST can be done only if the amount of changes needed to transfer is less than N. If it exceeds N, then the joining node has to perform SST.
You can monitor current state of Node by using
SHOW STATUS LIKE 'wsrep_local_state_comment';
When it is Synced (6), the node is ready to handle traffic.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29974949/viewspace-1813816/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29974949/viewspace-1813816/