Galera Cluster for MySQL 学习笔记

##

Galera Cluster for MySQL 学习笔记

1、意犹未尽的banner

打开Galera Cluster的官网你会发现

Galera Cluster for MySQL | The world’s most advanced open … —怎么说呢。引起你的兴趣,然后告诉你World’s Most。

World’s Most Advanced Features and Un-Seen Benefits

  • True Multi-master, Active-Active Cluster Read and write to any node at any time. —多主方案
  • Synchronous Replication No slave lag, no data is lost at node crash.—同步复制
  • Tightly Coupled All nodes hold the same state. No diverged data between nodes allowed. —高一致性
  • Multi-threaded Slave For better performance. For any workload. —多线程
  • No Master-Slave Failover Operations or Use of VIP. --没有主从fa和vip
  • Hot Standby No downtime during failover (since there is no failover). --不停机切换
  • Automatic Node Provisioning No need to manually back up the database and copy it to the new node. --新增节点很方便
  • Supports InnoDB. —支持innodb
  • Transparent to Applications Required no (or minimal changes) to the application. --应用透明
  • No Read and Write Splitting Needed. --没有读写分离,但是可以有
  • Easy to Use and Deploy --部署简单

2、Galera Cluster分支概述

MySQL Galera Cluster

MariaDB Galera Cluster

XtraDB Galera Cluster

下面两个分别是MariaDB和Percona对应的方案,以前都接触过,对于MySQL Galera Cluster并没有实际接触过,最近一个客户服务中正好遇到,所以测试看看。

3、版本发布概述

Galera Cluster for MySQL 5.7.44 and MySQL 8.0.35 released
Codership is pleased to announce a new Generally Available (GA) release of the multi-master Galera Cluster for MySQL 5.7, consisting of MySQL-wsrep 5.7.44 (release notes, download) and MySQL-wsrep 8.0.35 (release notes, download), with Galera replication library 4.17 (release notes, download) implementing wsrep API version 26. This release incorporates all changes to MySQL 5.7.44 and MySQL 8.0.35 respectively, adding a synchronous option for your MySQL High Availability solutions.

发布适用于MySQL 5.7.44和MySQL 8.0.35的Galera集群
Codership很高兴地宣布MySQL 5.7的多主Galera集群正式发布,该集群由MySQL-wsrep 5.7.44(发行说明,下载)和MySQL-wsrep 8.0.35(发行说明,下载)组成,其中Galera复制库4.17(发行说明,下载)实现了wsrep API版本26。此版本分别纳入了MySQL 5.7.44和MySQL 8.0.35的所有更改,为您的MySQL高可用性解决方案添加了同步选项。

看起来版本非常新,都到8.0.35了

4、Galera Cluster for MySQL安装

这里采用的方法是Galera Cluster for MySQL—Binary Installation,去看了下官网的文档,不管是online还是PDF,都非常不详细,但是在blog中却有一些方法。另外查看在线或者PDF文档,需要企业邮箱,这对于这种无业游民来说,很不友好。

另外除了yum/RPM安装,就是编译安装了。这和PG很像。

4.1、安装规划
ip 系统 galera node name
192.168.5.130 CentOS 7.9 galera01 + Galera Manager
192.168.5.140 CentOS 7.9 galera02
192.168.5.150 CentOS 7.9 galera03
4.2、安装过程

1.卸载系统自带的mariadb和mysql

rpm -qa|grep mysql |xargs rpm -e --nodeps rpm -qa|grep mariadb |xargs rpm -e --nodeps