Keepalived实现mysql的负载均衡
安装了mysql一主两从,mysql进行读写分离,读的这部分需要用keepalived负载均衡。高可用的话使用MHA,keepalived也可以高可用,但是不推荐。
一、准备工作
前面的mysql主从自己搭建
192.168.88.129 负载均衡主机 这里备机下次试试.
192.168.88.130 mysql从机A
192.168.88.131 mysql从机B
192.168.88.18 虚拟ip
上面三个主机的防火墙都先关闭
systemctl stop firewalld
二、负载均衡主机搭建Keepalived ipvsadm
①安装keepalived、ipvsadm
yum install -y keepalived
yum install -y ipvsadm
② 配置keepalived
vim /etc/keepalived/keepalived.conf
! Configuration File for keepalived
global_defs {
rou
共有 0 条评论