MariadDB高可用方案之galera集群部署,并配置mysqld_exporter,监控数据库状态
部署galera集群
部署环境:centos
mariadb版本 10.8.3
集群机器ip假定为:192.168.0.11、192.168.0.12、192.168.0.13
下载好离线rmp包,下载链接:https://mariadb.com/download-confirmation?group-name=Community%20Server&release-notes-uri=https%3A%2F%2Fmariadb.com%2Fkb%2Fen%2Fmariadb-1083-release-notes%2F&documentation-uri=https%3A%2F%2Fmariadb.com%2Fkb%2Fen%2Fwhat-is-mariadb-108%2F&download-uri=https%3A%2F%2Fdlm.mariadb.com%2F2310410%2FMariaDB%2Fmariadb-10.8.3%2Fyum%2Fcentos%2Fmariadb-10.8.3-rhel-7-x86_64-rpms.tar&product-name=Community%20Server&download-size=661.81%20MB
在3台机器上分别执行
解压到/opt/mariadb-10.8.3-rhel-7-x86_64-rpms文件夹下
cd 到 /opt/mariadb-10.8.3-rhel-7-x86_64-rpms
# 安装需要的包
yum -y install rsync nmap lsof per-DBI socat boots-devel.x86_64
# 先清理mariadb需要的lib,怕版本太旧影响后续安装
yum -y remove mariadb-libs
# 安装mariadb包文件
rpm -ivh jemalloc-3.6.0-1.el7.x86_64.rpm jemalloc-devel-3.6.0-1.el7.x86_64.rpm
rpm -ivh MariaDB-common-10.8.3-1.el7.centos.x86_64.rpm MariaDB-compat-10.8.3-1.el7.centos.x86_64.rpm MariaDB-client-10.8.3-1.el7.centos.x86_64.rpm galera-4-26.4.11-1.el7.centos.x86_64.rpm MariaDB-server-10.8.3-1.el7.centos.x86_64.rpm