Mariadb高可用MHA (四十二)

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档

目录

前言

一、概述    

1.1 概念

 1.2 组成

  1.3  特点

  1.4  工作原理

二、构建MHA

2.1 ssh免密登录

2.2 主从复制

2.3 MHA安装 

2.3.1所有节点安装perl环境

2.3..2 node

2.3.3 manager (只在mgt上装)

2.3.4 测试

2.3.5  故障恢复

总结



前言

MHA(Master High Availability)是一种用于MySQL和MariaDB数据库的高可用解决方案。它是由一个主节点(Master)和多个从节点(Slave)组成的集群,当主节点故障时,自动切换到一个可用的从节点上,以确保数据库的连续性和可用性。


提示:以下是本篇文章正文内容,下面案例可供参考

一、概述
    

1.1 概念


        MHA(MasterHigh Availability)是一套优秀的MySQL高可用环境下故障切换和主从复制的软件。
        MHA 的出现就是解决MySQL 单点的问题。
        MySQL故障切换过程中,MHA能做到0-30秒内自动完成故障切换操作。
        MHA能在故障切换的过程中最大程度上保证数据的一致性,以达到真正意义上的高可用。


    1.2 组成


        MHA manager
            管理节点
        MHA node
            数据节点
            每个节点上都需要安装


    1.3  特点


        自动故障切换过程中,MHA试图从宕机的主服务器上保存二进制日志,最大程度的保证数据不丢失
        使用半同步复制,可以大大降低数据丢失的风险,如果只有一个slave已经收到了最新的二进制日志,MHA可以将最新的二进制日志应用于其他所有的slave服务器上,因此可以保证所有节点的数据一致性
        目前MHA支持一主多从架构,最少三台服务,即一主两从


  1.4  工作原理


        从宕机崩溃的master 保存二进制日志事件(binlog events);
        识别含有最新的更新slave日志
        应用差异的中继日志(relay log)到其他的slave
        应用从master保存的二进制日志事件
        提升一个slave为新的master
        使其他的slave连接新的master进行复制

二、构建MHA

案例
    192.168.156.3
        manager(MHA)
            mgt
    192.168.156.4
        master
            master
    192.168.156.5
        slave
            slave1
    192.168.156.6
        slave
            slave2

每一台主机上全部安装mariadb 

[root@localhost ~]# yum install -y mariadb mariadb-server
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile* base: mirrors.huaweicloud.com* epel: mirrors.bfsu.edu.cn* extras: mirrors.huaweicloud.com* updates: mirrors.huaweicloud.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 mariadb.x86_64.1.5.5.68-1.el7 将被 安装
---> 软件包 mariadb-server.x86_64.1.5.5.68-1.el7 将被 安装
--> 正在处理依赖关系 perl-DBD-MySQL,它被软件包 1:mariadb-server-5.5.68-1.el7.x86_64 需要
--> 正在检查事务
---> 软件包 perl-DBD-MySQL.x86_64.0.4.023-6.el7 将被 安装
--> 解决依赖关系完成依赖关系解决====================================================================================================================================================Package                                架构                           版本                                      源                            大小
====================================================================================================================================================
正在安装:mariadb                                x86_64                         1:5.5.68-1.el7                            base                         8.8 Mmariadb-server                         x86_64                         1:5.5.68-1.el7                            base                          11 M
为依赖而安装:perl-DBD-MySQL                         x86_64                         4.023-6.el7                               base                         140 k事务概要
====================================================================================================================================================
安装  2 软件包 (+1 依赖软件包)总下载量:20 M
安装大小:107 M
Downloading packages:
(1/3): perl-DBD-MySQL-4.023-6.el7.x86_64.rpm                                                                                 | 140 kB  00:00:00     
(2/3): mariadb-server-5.5.68-1.el7.x86_64.rpm                                                                                |  11 MB  00:00:03     
(3/3): mariadb-5.5.68-1.el7.x86_64.rpm                                                                                       | 8.8 MB  00:00:16     
----------------------------------------------------------------------------------------------------------------------------------------------------
总计                                                                                                                1.2 MB/s |  20 MB  00:00:16     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction正在安装    : 1:mariadb-5.5.68-1.el7.x86_64                                                                                                   1/3 正在安装    : perl-DBD-MySQL-4.023-6.el7.x86_64                                                                                               2/3 正在安装    : 1:mariadb-server-5.5.68-1.el7.x86_64                                                                                            3/3 验证中      : 1:mariadb-server-5.5.68-1.el7.x86_64                                                                                            1/3 验证中      : perl-DBD-MySQL-4.023-6.el7.x86_64                                                                                               2/3 验证中      : 1:mariadb-5.5.68-1.el7.x86_64                                                                                                   3/3 已安装:mariadb.x86_64 1:5.5.68-1.el7                                         mariadb-server.x86_64 1:5.5.68-1.el7                                        作为依赖被安装:perl-DBD-MySQL.x86_64 0:4.023-6.el7                                                                                                               完毕!

每台主机分别改名为mgt  master slave1 slave2

 进入配置文件 /etc/hosts ,添加主机

 将文件 /etc/hosts 分别拷贝给其它三台机子

[root@mgt ~]# scp /etc/hosts 192.168.156.4:/etc/
The authenticity of host '192.168.156.4 (192.168.156.4)' can't be established.
ECDSA key fingerprint is SHA256:UYOTDfnPCXDYRisvqKkyxQEEiuZnt6vtyjxyIwTT10M.
ECDSA key fingerprint is MD5:43:59:03:5c:67:80:66:f1:84:6e:ab:9d:d9:1a:b4:90.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.156.4' (ECDSA) to the list of known hosts.
root@192.168.156.4's password: 
hosts                                                                                                             100%  240    80.2KB/s   00:00    
[root@mgt ~]# scp /etc/hosts 192.168.156.5:/etc/
The authenticity of host '192.168.156.5 (192.168.156.5)' can't be established.
ECDSA key fingerprint is SHA256:UYOTDfnPCXDYRisvqKkyxQEEiuZnt6vtyjxyIwTT10M.
ECDSA key fingerprint is MD5:43:59:03:5c:67:80:66:f1:84:6e:ab:9d:d9:1a:b4:90.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.156.5' (ECDSA) to the list of known hosts.
root@192.168.156.5's password: 
hosts                                                                                                             100%  240    92.0KB/s   00:00    
[root@mgt ~]# scp /etc/hosts 192.168.156.8:/etc/
The authenticity of host '192.168.156.8 (192.168.156.8)' can't be established.
ECDSA key fingerprint is SHA256:UYOTDfnPCXDYRisvqKkyxQEEiuZnt6vtyjxyIwTT10M.
ECDSA key fingerprint is MD5:43:59:03:5c:67:80:66:f1:84:6e:ab:9d:d9:1a:b4:90.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.156.8' (ECDSA) to the list of known hosts.
root@192.168.156.8's password: 
hosts                           

 测试(分别在每一台主机上测试)mgt

[root@mgt ~]# ping master
PING master (192.168.156.4) 56(84) bytes of data.
64 bytes from master (192.168.156.4): icmp_seq=1 ttl=64 time=0.513 ms
64 bytes from master (192.168.156.4): icmp_seq=2 ttl=64 time=0.825 ms
^C
--- master ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1003ms
rtt min/avg/max/mdev = 0.513/0.669/0.825/0.156 ms
[root@mgt ~]# ping slave1
PING slave1 (192.168.156.5) 56(84) bytes of data.
64 bytes from slave1 (192.168.156.5): icmp_seq=1 ttl=64 time=0.659 ms
64 bytes from slave1 (192.168.156.5): icmp_seq=2 ttl=64 time=0.648 ms
^C
--- slave1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.648/0.653/0.659/0.026 ms
[root@mgt ~]# ping slave2
PING slave2 (192.168.156.8) 56(84) bytes of data.
64 bytes from slave2 (192.168.156.8): icmp_seq=1 ttl=64 time=0.532 ms
64 bytes from slave2 (192.168.156.8): icmp_seq=2 ttl=64 time=0.756 ms
^C
--- slave2 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.532/0.644/0.756/0.112 ms

master

[root@master ~]# ping mgt
PING mgt (192.168.156.10) 56(84) bytes of data.
64 bytes from mgt (192.168.156.10): icmp_seq=1 ttl=64 time=0.339 ms
64 bytes from mgt (192.168.156.10): icmp_seq=2 ttl=64 time=0.676 ms
^C
--- mgt ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.339/0.507/0.676/0.170 ms
[root@master ~]# ping slave1
PING slave1 (192.168.156.5) 56(84) bytes of data.
64 bytes from slave1 (192.168.156.5): icmp_seq=1 ttl=64 time=0.866 ms
64 bytes from slave1 (192.168.156.5): icmp_seq=2 ttl=64 time=0.451 ms
^C
--- slave1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.451/0.658/0.866/0.209 ms
[root@master ~]# ping slave2
PING slave2 (192.168.156.8) 56(84) bytes of data.
64 bytes from slave2 (192.168.156.8): icmp_seq=1 ttl=64 time=1.00 ms
64 bytes from slave2 (192.168.156.8): icmp_seq=2 ttl=64 time=0.489 ms
^C
--- slave2 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 0.489/0.746/1.003/0.257 ms

slave1

[root@slave1 ~]# ping mgt
PING mgt (192.168.156.10) 56(84) bytes of data.
64 bytes from mgt (192.168.156.10): icmp_seq=1 ttl=64 time=0.380 ms
64 bytes from mgt (192.168.156.10): icmp_seq=2 ttl=64 time=0.982 ms
^C
--- mgt ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.380/0.681/0.982/0.301 ms
[root@slave1 ~]# ping master
PING master (192.168.156.4) 56(84) bytes of data.
64 bytes from master (192.168.156.4): icmp_seq=1 ttl=64 time=0.517 ms
64 bytes from master (192.168.156.4): icmp_seq=2 ttl=64 time=0.287 ms
^C
--- master ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.287/0.402/0.517/0.115 ms
[root@slave1 ~]# ping slave2
PING slave2 (192.168.156.8) 56(84) bytes of data.
64 bytes from slave2 (192.168.156.8): icmp_seq=1 ttl=64 time=1.48 ms
64 bytes from slave2 (192.168.156.8): icmp_seq=2 ttl=64 time=0.840 ms
^C
--- slave2 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.840/1.163/1.487/0.325 ms

slave2

[root@slave2 ~]# ping mgt
PING mgt (192.168.156.10) 56(84) bytes of data.
64 bytes from mgt (192.168.156.10): icmp_seq=1 ttl=64 time=0.422 ms
64 bytes from mgt (192.168.156.10): icmp_seq=2 ttl=64 time=0.437 ms
64 bytes from mgt (192.168.156.10): icmp_seq=3 ttl=64 time=0.574 ms
64 bytes from mgt (192.168.156.10): icmp_seq=4 ttl=64 time=0.874 ms
64 bytes from mgt (192.168.156.10): icmp_seq=5 ttl=64 time=0.735 ms
^C
--- mgt ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4013ms
rtt min/avg/max/mdev = 0.422/0.608/0.874/0.175 ms
[root@slave2 ~]# ping master
PING master (192.168.156.4) 56(84) bytes of data.
64 bytes from master (192.168.156.4): icmp_seq=1 ttl=64 time=0.682 ms
64 bytes from master (192.168.156.4): icmp_seq=2 ttl=64 time=0.685 ms
64 bytes from master (192.168.156.4): icmp_seq=3 ttl=64 time=0.789 ms
^C
--- master ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2033ms
rtt min/avg/max/mdev = 0.682/0.718/0.789/0.058 ms
[root@slave2 ~]# ping slave1
PING slave1 (192.168.156.5) 56(84) bytes of data.
64 bytes from slave1 (192.168.156.5): icmp_seq=1 ttl=64 time=0.477 ms
64 bytes from slave1 (192.168.156.5): icmp_seq=2 ttl=64 time=0.779 ms
64 bytes from slave1 (192.168.156.5): icmp_seq=3 ttl=64 time=0.654 ms
64 bytes from slave1 (192.168.156.5): icmp_seq=4 ttl=64 time=0.728 ms
64 bytes from slave1 (192.168.156.5): icmp_seq=5 ttl=64 time=0.756 ms
64 bytes from slave1 (192.168.156.5): icmp_seq=6 ttl=64 time=0.904 ms
^C
--- slave1 ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5018ms
rtt min/avg/max/mdev = 0.477/0.716/0.904/0.132 ms

2.1 ssh免密登录

  所有节点配置hosts
        192.168.156.3    mgt
        192.168.156.4    master
        192.168.156.5    slave1
        192.168.156.6    slave2
    192.168.156.3
        ssh-keygen
        for i in 4 5 6;do ssh-copy-id root@192.168.156.$i;done
    192.168.156.4
        ssh-keygen
        for i in 3 5 6;do ssh-copy-id root@192.168.156.$i;done
    192.168.156.5
        ssh-keygen
        for i in 4 3 6;do ssh-copy-id root@192.168.156.$i;done
    192.168.156.6
        ssh-keygen
        for i in 4 5 3;do ssh-copy-id root@192.168.156.$i;done
    测试
        for i in 3 4 5;do ssh 192.168.156.$i hostname;done

[root@mgt ~]# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:KKd91Xo5xRM8gTnd4xmNU1Ug+k3bCqu/Dafc5GV711Y root@mgt
The key's randomart image is:
+---[RSA 2048]----+
|            .+o=B|
|           .+o++o|
|          .  .*.+|
|       .   o + B |
|    . o S . + * .|
|     =   . . = oE|
|    . . . . * + =|
|       .   + X o*|
|          ..=.+oo|
+----[SHA256]-----+
[root@mgt ~]# ssh-copy-id mgt
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
The authenticity of host 'mgt (192.168.156.3)' can't be established.
ECDSA key fingerprint is SHA256:UYOTDfnPCXDYRisvqKkyxQEEiuZnt6vtyjxyIwTT10M.
ECDSA key fingerprint is MD5:43:59:03:5c:67:80:66:f1:84:6e:ab:9d:d9:1a:b4:90.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@mgt's password: Number of key(s) added: 1Now try logging into the machine, with:   "ssh 'mgt'"
and check to make sure that only the key(s) you wanted were added.

 验证(分别在每一台机子上验证)

[root@mgt ~]# ssh master
The authenticity of host 'master (192.168.156.4)' can't be established.
ECDSA key fingerprint is SHA256:UYOTDfnPCXDYRisvqKkyxQEEiuZnt6vtyjxyIwTT10M.
ECDSA key fingerprint is MD5:43:59:03:5c:67:80:66:f1:84:6e:ab:9d:d9:1a:b4:90.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'master' (ECDSA) to the list of known hosts.
Last login: Wed Aug 16 02:16:32 2023 from 192.168.156.1
[root@master ~]# exit
登出
Connection to master closed.
[root@mgt ~]# ssh slave1
The authenticity of host 'slave1 (192.168.156.5)' can't be established.
ECDSA key fingerprint is SHA256:UYOTDfnPCXDYRisvqKkyxQEEiuZnt6vtyjxyIwTT10M.
ECDSA key fingerprint is MD5:43:59:03:5c:67:80:66:f1:84:6e:ab:9d:d9:1a:b4:90.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'slave1' (ECDSA) to the list of known hosts.
Last login: Wed Aug 16 02:17:00 2023 from 192.168.156.1
[root@slave1 ~]# exit
登出
Connection to slave1 closed.
[root@mgt ~]# ssh slave2
The authenticity of host 'slave2 (192.168.156.6)' can't be established.
ECDSA key fingerprint is SHA256:UYOTDfnPCXDYRisvqKkyxQEEiuZnt6vtyjxyIwTT10M.
ECDSA key fingerprint is MD5:43:59:03:5c:67:80:66:f1:84:6e:ab:9d:d9:1a:b4:90.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'slave2' (ECDSA) to the list of known hosts.
Last login: Wed Aug 16 02:17:30 2023 from 192.168.156.1
[root@slave2 ~]# exit
登出
Connection to slave2 closed.
[root@mgt ~]# ssh mgt
Last login: Wed Aug 16 02:16:02 2023 from 192.168.156.1
[root@mgt ~]# exit
登出
Connection to mgt closed.

2.2 主从复制

master 

 slave1

 slave2

 启动服务(三台都启动)

 master

查看状态

  slave1

  slave2

  验证

登录master ,在master 上创建库

  登录slave1 查看

  登录slave2 查看

2.3 MHA安装 

2.3.1所有节点安装perl环境

    yum install epel-release -y
    yum -y install perl-DBD-MySQL perl-ExtUtils-MakeMaker perl-Config-Tiny perl-Log-Dispatch perl-Parallel-ForkManager perl-Time-HiRes perl-CPAN

[root@mgt ~]# yum install epel-release -y
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile* base: mirrors.huaweicloud.com* extras: mirrors.tuna.tsinghua.edu.cn* updates: mirrors.tuna.tsinghua.edu.cn
正在解决依赖关系
--> 正在检查事务
---> 软件包 epel-release.noarch.0.7-11 将被 安装
--> 解决依赖关系完成依赖关系解决=========================================================================================================================================================================Package                                      架构                                   版本                                   源                                      大小
=========================================================================================================================================================================
正在安装:epel-release                                 noarch                                 7-11                                   extras                                  15 k事务概要
=========================================================================================================================================================================
安装  1 软件包总下载量:15 k
安装大小:24 k
Downloading packages:
epel-release-7-11.noarch.rpm                                                                                                                      |  15 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction正在安装    : epel-release-7-11.noarch                                                                                                                             1/1 验证中      : epel-release-7-11.noarch                                                                                                                             1/1 已安装:epel-release.noarch 0:7-11                                                                                                                                             完毕!
[root@mgt ~]# yum install epel-release -y
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile* base: mirrors.aliyun.com* epel: mirror-icn.yuki.net.uk* extras: mirrors.cqu.edu.cn* updates: mirrors.jlu.edu.cn
正在解决依赖关系
--> 正在检查事务
---> 软件包 epel-release.noarch.0.7-11 将被 升级
---> 软件包 epel-release.noarch.0.7-14 将被 更新
--> 解决依赖关系完成依赖关系解决=========================================================================================================================================================================Package                                       架构                                    版本                                  源                                     大小
=========================================================================================================================================================================
正在更新:epel-release                                  noarch                                  7-14                                  epel                                   15 k事务概要
=========================================================================================================================================================================
升级  1 软件包总下载量:15 k
Downloading packages:
epel/x86_64/prestodelta                                                                                                                           | 1.2 kB  00:00:00     
警告:/var/cache/yum/x86_64/7/epel/packages/epel-release-7-14.noarch.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 352c64e5: NOKEY
epel-release-7-14.noarch.rpm 的公钥尚未安装
epel-release-7-14.noarch.rpm                                                                                                                      |  15 kB  00:00:00     
从 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 检索密钥
导入 GPG key 0x352C64E5:用户ID     : "Fedora EPEL (7) <epel@fedoraproject.org>"指纹       : 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5软件包     : epel-release-7-11.noarch (@extras)来自       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction正在更新    : epel-release-7-14.noarch                                                                                                                             1/2 清理        : epel-release-7-11.noarch                                                                                                                             2/2 验证中      : epel-release-7-14.noarch                                                                                                                             1/2 验证中      : epel-release-7-11.noarch                                                                                                                             2/2 更新完毕:epel-release.noarch 0:7-14                                                                                                                                             完毕!
[root@mgt ~]# yum -y install perl-DBD-MySQL perl-ExtUtils-MakeMaker perl-Config-Tiny perl-Log-Dispatch perl-Parallel-ForkManager perl-Time-HiRes perl-CPAN
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile* base: mirrors.bfsu.edu.cn* epel: mirrors.bfsu.edu.cn* extras: mirrors.bfsu.edu.cn* updates: mirrors.bfsu.edu.cn
软件包 perl-DBD-MySQL-4.023-6.el7.x86_64 已安装并且是最新版本
软件包 4:perl-Time-HiRes-1.9725-3.el7.x86_64 已安装并且是最新版本
正在解决依赖关系
--> 正在检查事务
---> 软件包 perl-CPAN.noarch.0.1.9800-299.el7_9 将被 安装
--> 正在处理依赖关系 perl(local::lib),它被软件包 perl-CPAN-1.9800-299.el7_9.noarch 需要
--> 正在处理依赖关系 perl(Digest::SHA),它被软件包 perl-CPAN-1.9800-299.el7_9.noarch 需要
---> 软件包 perl-Config-Tiny.noarch.0.2.14-7.el7 将被 安装
---> 软件包 perl-ExtUtils-MakeMaker.noarch.0.6.68-3.el7 将被 安装
--> 正在处理依赖关系 perl(ExtUtils::Packlist),它被软件包 perl-ExtUtils-MakeMaker-6.68-3.el7.noarch 需要
--> 正在处理依赖关系 perl(ExtUtils::Manifest),它被软件包 perl-ExtUtils-MakeMaker-6.68-3.el7.noarch 需要
--> 正在处理依赖关系 perl(ExtUtils::Installed),它被软件包 perl-ExtUtils-MakeMaker-6.68-3.el7.noarch 需要
--> 正在处理依赖关系 perl(ExtUtils::Install),它被软件包 perl-ExtUtils-MakeMaker-6.68-3.el7.noarch 需要
---> 软件包 perl-Log-Dispatch.noarch.0.2.41-1.el7.1 将被 安装
--> 正在处理依赖关系 perl(Params::Validate) >= 0.15,它被软件包 perl-Log-Dispatch-2.41-1.el7.1.noarch 需要
--> 正在处理依赖关系 perl(Sys::Syslog) >= 0.25,它被软件包 perl-Log-Dispatch-2.41-1.el7.1.noarch 需要
--> 正在处理依赖关系 perl(Class::Load),它被软件包 perl-Log-Dispatch-2.41-1.el7.1.noarch 需要
--> 正在处理依赖关系 perl(MIME::Lite),它被软件包 perl-Log-Dispatch-2.41-1.el7.1.noarch 需要
--> 正在处理依赖关系 perl(Mail::Send),它被软件包 perl-Log-Dispatch-2.41-1.el7.1.noarch 需要
--> 正在处理依赖关系 perl(Mail::Sender),它被软件包 perl-Log-Dispatch-2.41-1.el7.1.noarch 需要
--> 正在处理依赖关系 perl(Mail::Sendmail),它被软件包 perl-Log-Dispatch-2.41-1.el7.1.noarch 需要
--> 正在处理依赖关系 perl(Params::Validate),它被软件包 perl-Log-Dispatch-2.41-1.el7.1.noarch 需要
---> 软件包 perl-Parallel-ForkManager.noarch.0.1.18-2.el7 将被 安装
--> 正在检查事务
---> 软件包 perl-Class-Load.noarch.0.0.20-3.el7 将被 安装
--> 正在处理依赖关系 perl(Package::Stash) >= 0.14,它被软件包 perl-Class-Load-0.20-3.el7.noarch 需要
--> 正在处理依赖关系 perl(Module::Runtime) >= 0.012,它被软件包 perl-Class-Load-0.20-3.el7.noarch 需要
--> 正在处理依赖关系 perl(Module::Implementation) >= 0.04,它被软件包 perl-Class-Load-0.20-3.el7.noarch 需要
--> 正在处理依赖关系 perl(Try::Tiny),它被软件包 perl-Class-Load-0.20-3.el7.noarch 需要
--> 正在处理依赖关系 perl(Module::Runtime),它被软件包 perl-Class-Load-0.20-3.el7.noarch 需要
--> 正在处理依赖关系 perl(Data::OptList),它被软件包 perl-Class-Load-0.20-3.el7.noarch 需要
---> 软件包 perl-Digest-SHA.x86_64.1.5.85-4.el7 将被 安装
--> 正在处理依赖关系 perl(Digest::base),它被软件包 1:perl-Digest-SHA-5.85-4.el7.x86_64 需要
---> 软件包 perl-ExtUtils-Install.noarch.0.1.58-299.el7_9 将被 安装
--> 正在处理依赖关系 perl-devel,它被软件包 perl-ExtUtils-Install-1.58-299.el7_9.noarch 需要
---> 软件包 perl-ExtUtils-Manifest.noarch.0.1.61-244.el7 将被 安装
---> 软件包 perl-MIME-Lite.noarch.0.3.030-1.el7 将被 安装
--> 正在处理依赖关系 perl(MIME::Types) >= 1.28,它被软件包 perl-MIME-Lite-3.030-1.el7.noarch 需要
--> 正在处理依赖关系 perl(Email::Date::Format),它被软件包 perl-MIME-Lite-3.030-1.el7.noarch 需要
---> 软件包 perl-Mail-Sender.noarch.0.0.8.23-1.el7 将被 安装
--> 正在处理依赖关系 perl(IO::Socket::SSL),它被软件包 perl-Mail-Sender-0.8.23-1.el7.noarch 需要
--> 正在处理依赖关系 perl(Net::SSLeay),它被软件包 perl-Mail-Sender-0.8.23-1.el7.noarch 需要
---> 软件包 perl-Mail-Sendmail.noarch.0.0.79-21.el7 将被 安装
---> 软件包 perl-MailTools.noarch.0.2.12-2.el7 将被 安装
--> 正在处理依赖关系 perl(Net::SMTP::SSL),它被软件包 perl-MailTools-2.12-2.el7.noarch 需要
--> 正在处理依赖关系 perl(Date::Parse),它被软件包 perl-MailTools-2.12-2.el7.noarch 需要
--> 正在处理依赖关系 perl(Date::Format),它被软件包 perl-MailTools-2.12-2.el7.noarch 需要
---> 软件包 perl-Params-Validate.x86_64.0.1.08-4.el7 将被 安装
---> 软件包 perl-Sys-Syslog.x86_64.0.0.33-3.el7 将被 安装
---> 软件包 perl-local-lib.noarch.0.1.008010-4.el7 将被 安装
--> 正在检查事务
---> 软件包 perl-Data-OptList.noarch.0.0.107-9.el7 将被 安装
--> 正在处理依赖关系 perl(Sub::Install) >= 0.921,它被软件包 perl-Data-OptList-0.107-9.el7.noarch 需要
--> 正在处理依赖关系 perl(Params::Util),它被软件包 perl-Data-OptList-0.107-9.el7.noarch 需要
---> 软件包 perl-Digest.noarch.0.1.17-245.el7 将被 安装
---> 软件包 perl-Email-Date-Format.noarch.0.1.002-15.el7 将被 安装
---> 软件包 perl-IO-Socket-SSL.noarch.0.1.94-7.el7 将被 安装
--> 正在处理依赖关系 perl(IO::Socket::IP) >= 0.20,它被软件包 perl-IO-Socket-SSL-1.94-7.el7.noarch 需要
--> 正在处理依赖关系 perl(Net::LibIDN),它被软件包 perl-IO-Socket-SSL-1.94-7.el7.noarch 需要
--> 正在处理依赖关系 perl(Mozilla::CA),它被软件包 perl-IO-Socket-SSL-1.94-7.el7.noarch 需要
---> 软件包 perl-MIME-Types.noarch.0.1.38-2.el7 将被 安装
---> 软件包 perl-Module-Implementation.noarch.0.0.06-6.el7 将被 安装
---> 软件包 perl-Module-Runtime.noarch.0.0.013-4.el7 将被 安装
---> 软件包 perl-Net-SMTP-SSL.noarch.0.1.01-13.el7 将被 安装
---> 软件包 perl-Net-SSLeay.x86_64.0.1.55-6.el7 将被 安装
---> 软件包 perl-Package-Stash.noarch.0.0.34-2.el7 将被 安装
--> 正在处理依赖关系 perl(Package::Stash::XS) >= 0.26,它被软件包 perl-Package-Stash-0.34-2.el7.noarch 需要
--> 正在处理依赖关系 perl(Package::DeprecationManager),它被软件包 perl-Package-Stash-0.34-2.el7.noarch 需要
---> 软件包 perl-TimeDate.noarch.1.2.30-2.el7 将被 安装
---> 软件包 perl-Try-Tiny.noarch.0.0.12-2.el7 将被 安装
---> 软件包 perl-devel.x86_64.4.5.16.3-299.el7_9 将被 安装
--> 正在处理依赖关系 systemtap-sdt-devel,它被软件包 4:perl-devel-5.16.3-299.el7_9.x86_64 需要
--> 正在处理依赖关系 perl(ExtUtils::ParseXS),它被软件包 4:perl-devel-5.16.3-299.el7_9.x86_64 需要
--> 正在处理依赖关系 libdb-devel,它被软件包 4:perl-devel-5.16.3-299.el7_9.x86_64 需要
--> 正在处理依赖关系 gdbm-devel,它被软件包 4:perl-devel-5.16.3-299.el7_9.x86_64 需要
--> 正在检查事务
---> 软件包 gdbm-devel.x86_64.0.1.10-8.el7 将被 安装
---> 软件包 libdb-devel.x86_64.0.5.3.21-25.el7 将被 安装
---> 软件包 perl-ExtUtils-ParseXS.noarch.1.3.18-3.el7 将被 安装
---> 软件包 perl-IO-Socket-IP.noarch.0.0.21-5.el7 将被 安装
---> 软件包 perl-Mozilla-CA.noarch.0.20130114-5.el7 将被 安装
---> 软件包 perl-Net-LibIDN.x86_64.0.0.12-15.el7 将被 安装
---> 软件包 perl-Package-DeprecationManager.noarch.0.0.13-7.el7 将被 安装
--> 正在处理依赖关系 perl(List::MoreUtils),它被软件包 perl-Package-DeprecationManager-0.13-7.el7.noarch 需要
---> 软件包 perl-Package-Stash-XS.x86_64.0.0.26-3.el7 将被 安装
---> 软件包 perl-Params-Util.x86_64.0.1.07-6.el7 将被 安装
---> 软件包 perl-Sub-Install.noarch.0.0.926-6.el7 将被 安装
---> 软件包 systemtap-sdt-devel.x86_64.0.4.0-13.el7 将被 安装
--> 正在处理依赖关系 pyparsing,它被软件包 systemtap-sdt-devel-4.0-13.el7.x86_64 需要
--> 正在检查事务
---> 软件包 perl-List-MoreUtils.x86_64.0.0.33-9.el7 将被 安装
---> 软件包 pyparsing.noarch.0.1.5.6-9.el7 将被 安装
--> 解决依赖关系完成依赖关系解决=========================================================================================================================================================================Package                                                 架构                           版本                                       源                               大小
=========================================================================================================================================================================
正在安装:perl-CPAN                                               noarch                         1.9800-299.el7_9                           updates                         293 kperl-Config-Tiny                                        noarch                         2.14-7.el7                                 base                             25 kperl-ExtUtils-MakeMaker                                 noarch                         6.68-3.el7                                 base                            275 kperl-Log-Dispatch                                       noarch                         2.41-1.el7.1                               epel                             82 kperl-Parallel-ForkManager                               noarch                         1.18-2.el7                                 epel                             28 k
为依赖而安装:gdbm-devel                                              x86_64                         1.10-8.el7                                 base                             47 klibdb-devel                                             x86_64                         5.3.21-25.el7                              base                             39 kperl-Class-Load                                         noarch                         0.20-3.el7                                 base                             27 kperl-Data-OptList                                       noarch                         0.107-9.el7                                base                             23 kperl-Digest                                             noarch                         1.17-245.el7                               base                             23 kperl-Digest-SHA                                         x86_64                         1:5.85-4.el7                               base                             58 kperl-Email-Date-Format                                  noarch                         1.002-15.el7                               epel                             17 kperl-ExtUtils-Install                                   noarch                         1.58-299.el7_9                             updates                          75 kperl-ExtUtils-Manifest                                  noarch                         1.61-244.el7                               base                             31 kperl-ExtUtils-ParseXS                                   noarch                         1:3.18-3.el7                               base                             77 kperl-IO-Socket-IP                                       noarch                         0.21-5.el7                                 base                             36 kperl-IO-Socket-SSL                                      noarch                         1.94-7.el7                                 base                            115 kperl-List-MoreUtils                                     x86_64                         0.33-9.el7                                 base                             58 kperl-MIME-Lite                                          noarch                         3.030-1.el7                                epel                             96 kperl-MIME-Types                                         noarch                         1.38-2.el7                                 epel                             38 kperl-Mail-Sender                                        noarch                         0.8.23-1.el7                               epel                             59 kperl-Mail-Sendmail                                      noarch                         0.79-21.el7                                epel                             29 kperl-MailTools                                          noarch                         2.12-2.el7                                 base                            108 kperl-Module-Implementation                              noarch                         0.06-6.el7                                 base                             17 kperl-Module-Runtime                                     noarch                         0.013-4.el7                                base                             19 kperl-Mozilla-CA                                         noarch                         20130114-5.el7                             base                             11 kperl-Net-LibIDN                                         x86_64                         0.12-15.el7                                base                             28 kperl-Net-SMTP-SSL                                       noarch                         1.01-13.el7                                base                            9.1 kperl-Net-SSLeay                                         x86_64                         1.55-6.el7                                 base                            285 kperl-Package-DeprecationManager                         noarch                         0.13-7.el7                                 base                             18 kperl-Package-Stash                                      noarch                         0.34-2.el7                                 base                             34 kperl-Package-Stash-XS                                   x86_64                         0.26-3.el7                                 base                             31 kperl-Params-Util                                        x86_64                         1.07-6.el7                                 base                             38 kperl-Params-Validate                                    x86_64                         1.08-4.el7                                 base                             69 kperl-Sub-Install                                        noarch                         0.926-6.el7                                base                             21 kperl-Sys-Syslog                                         x86_64                         0.33-3.el7                                 base                             42 kperl-TimeDate                                           noarch                         1:2.30-2.el7                               base                             52 kperl-Try-Tiny                                           noarch                         0.12-2.el7                                 base                             23 kperl-devel                                              x86_64                         4:5.16.3-299.el7_9                         updates                         454 kperl-local-lib                                          noarch                         1.008010-4.el7                             base                             64 kpyparsing                                               noarch                         1.5.6-9.el7                                base                             94 ksystemtap-sdt-devel                                     x86_64                         4.0-13.el7                                 base                             76 k事务概要
=========================================================================================================================================================================
安装  5 软件包 (+37 依赖软件包)总下载量:3.0 M
安装大小:7.5 M
Downloading packages:
(1/42): gdbm-devel-1.10-8.el7.x86_64.rpm                                                                                                          |  47 kB  00:00:00     
(2/42): perl-CPAN-1.9800-299.el7_9.noarch.rpm                                                                                                     | 293 kB  00:00:00     
(3/42): perl-Data-OptList-0.107-9.el7.noarch.rpm                                                                                                  |  23 kB  00:00:00     
(4/42): perl-Digest-SHA-5.85-4.el7.x86_64.rpm                                                                                                     |  58 kB  00:00:00     
(5/42): libdb-devel-5.3.21-25.el7.x86_64.rpm                                                                                                      |  39 kB  00:00:00     
(6/42): perl-Class-Load-0.20-3.el7.noarch.rpm                                                                                                     |  27 kB  00:00:00     
warning: /var/cache/yum/x86_64/7/epel/packages/perl-Email-Date-Format-1.002-15.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
perl-Email-Date-Format-1.002-15.el7.noarch.rpm 的公钥尚未安装
(7/42): perl-Email-Date-Format-1.002-15.el7.noarch.rpm                                                                                            |  17 kB  00:00:00     
(8/42): perl-Config-Tiny-2.14-7.el7.noarch.rpm                                                                                                    |  25 kB  00:00:00     
(9/42): perl-ExtUtils-MakeMaker-6.68-3.el7.noarch.rpm                                                                                             | 275 kB  00:00:00     
(10/42): perl-ExtUtils-Manifest-1.61-244.el7.noarch.rpm                                                                                           |  31 kB  00:00:00     
(11/42): perl-IO-Socket-SSL-1.94-7.el7.noarch.rpm                                                                                                 | 115 kB  00:00:00     
(12/42): perl-IO-Socket-IP-0.21-5.el7.noarch.rpm                                                                                                  |  36 kB  00:00:00     
(13/42): perl-List-MoreUtils-0.33-9.el7.x86_64.rpm                                                                                                |  58 kB  00:00:00     
(14/42): perl-Digest-1.17-245.el7.noarch.rpm                                                                                                      |  23 kB  00:00:00     
(15/42): perl-ExtUtils-Install-1.58-299.el7_9.noarch.rpm                                                                                          |  75 kB  00:00:00     
(16/42): perl-ExtUtils-ParseXS-3.18-3.el7.noarch.rpm                                                                                              |  77 kB  00:00:00     
(17/42): perl-Log-Dispatch-2.41-1.el7.1.noarch.rpm                                                                                                |  82 kB  00:00:00     
(18/42): perl-MIME-Lite-3.030-1.el7.noarch.rpm                                                                                                    |  96 kB  00:00:00     
(19/42): perl-MIME-Types-1.38-2.el7.noarch.rpm                                                                                                    |  38 kB  00:00:00     
(20/42): perl-Mail-Sender-0.8.23-1.el7.noarch.rpm                                                                                                 |  59 kB  00:00:00     
(21/42): perl-Mail-Sendmail-0.79-21.el7.noarch.rpm                                                                                                |  29 kB  00:00:00     
(22/42): perl-Module-Implementation-0.06-6.el7.noarch.rpm                                                                                         |  17 kB  00:00:00     
(23/42): perl-Mozilla-CA-20130114-5.el7.noarch.rpm                                                                                                |  11 kB  00:00:00     
(24/42): perl-Net-SMTP-SSL-1.01-13.el7.noarch.rpm                                                                                                 | 9.1 kB  00:00:00     
(25/42): perl-Net-LibIDN-0.12-15.el7.x86_64.rpm                                                                                                   |  28 kB  00:00:00     
(26/42): perl-Net-SSLeay-1.55-6.el7.x86_64.rpm                                                                                                    | 285 kB  00:00:00     
(27/42): perl-Package-DeprecationManager-0.13-7.el7.noarch.rpm                                                                                    |  18 kB  00:00:00     
(28/42): perl-Parallel-ForkManager-1.18-2.el7.noarch.rpm                                                                                          |  28 kB  00:00:00     
(29/42): perl-Package-Stash-XS-0.26-3.el7.x86_64.rpm                                                                                              |  31 kB  00:00:00     
(30/42): perl-Package-Stash-0.34-2.el7.noarch.rpm                                                                                                 |  34 kB  00:00:00     
(31/42): perl-Params-Util-1.07-6.el7.x86_64.rpm                                                                                                   |  38 kB  00:00:00     
(32/42): perl-Params-Validate-1.08-4.el7.x86_64.rpm                                                                                               |  69 kB  00:00:00     
(33/42): perl-Sys-Syslog-0.33-3.el7.x86_64.rpm                                                                                                    |  42 kB  00:00:00     
(34/42): perl-TimeDate-2.30-2.el7.noarch.rpm                                                                                                      |  52 kB  00:00:00     
(35/42): perl-Try-Tiny-0.12-2.el7.noarch.rpm                                                                                                      |  23 kB  00:00:00     
(36/42): perl-devel-5.16.3-299.el7_9.x86_64.rpm                                                                                                   | 454 kB  00:00:00     
(37/42): perl-local-lib-1.008010-4.el7.noarch.rpm                                                                                                 |  64 kB  00:00:00     
(38/42): perl-Module-Runtime-0.013-4.el7.noarch.rpm                                                                                               |  19 kB  00:00:00     
(39/42): perl-MailTools-2.12-2.el7.noarch.rpm                                                                                                     | 108 kB  00:00:00     
(40/42): systemtap-sdt-devel-4.0-13.el7.x86_64.rpm                                                                                                |  76 kB  00:00:00     
(41/42): pyparsing-1.5.6-9.el7.noarch.rpm                                                                                                         |  94 kB  00:00:00     
(42/42): perl-Sub-Install-0.926-6.el7.noarch.rpm                                                                                                  |  21 kB  00:00:00     
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
总计                                                                                                                                     1.4 MB/s | 3.0 MB  00:00:02     
从 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 检索密钥
导入 GPG key 0x352C64E5:用户ID     : "Fedora EPEL (7) <epel@fedoraproject.org>"指纹       : 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5软件包     : epel-release-7-11.noarch (@extras)来自       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction正在安装    : perl-Sub-Install-0.926-6.el7.noarch                                                                                                                 1/42 正在安装    : perl-Net-SSLeay-1.55-6.el7.x86_64                                                                                                                   2/42 正在安装    : perl-Params-Util-1.07-6.el7.x86_64                                                                                                                  3/42 正在安装    : perl-Try-Tiny-0.12-2.el7.noarch                                                                                                                     4/42 正在安装    : perl-Module-Runtime-0.013-4.el7.noarch                                                                                                              5/42 正在安装    : perl-Module-Implementation-0.06-6.el7.noarch                                                                                                        6/42 正在安装    : perl-Params-Validate-1.08-4.el7.x86_64                                                                                                              7/42 正在安装    : perl-Data-OptList-0.107-9.el7.noarch                                                                                                                8/42 正在安装    : perl-Email-Date-Format-1.002-15.el7.noarch                                                                                                          9/42 正在安装    : perl-Digest-1.17-245.el7.noarch                                                                                                                    10/42 正在安装    : 1:perl-Digest-SHA-5.85-4.el7.x86_64                                                                                                                11/42 正在安装    : perl-Net-LibIDN-0.12-15.el7.x86_64                                                                                                                 12/42 正在安装    : 1:perl-TimeDate-2.30-2.el7.noarch                                                                                                                  13/42 正在安装    : perl-ExtUtils-Manifest-1.61-244.el7.noarch                                                                                                         14/42 正在安装    : perl-Package-Stash-XS-0.26-3.el7.x86_64                                                                                                            15/42 正在安装    : perl-IO-Socket-IP-0.21-5.el7.noarch                                                                                                                16/42 正在安装    : perl-MIME-Types-1.38-2.el7.noarch                                                                                                                  17/42 正在安装    : perl-MIME-Lite-3.030-1.el7.noarch                                                                                                                  18/42 正在安装    : perl-Mozilla-CA-20130114-5.el7.noarch                                                                                                              19/42 正在安装    : perl-IO-Socket-SSL-1.94-7.el7.noarch                                                                                                               20/42 正在安装    : perl-Mail-Sender-0.8.23-1.el7.noarch                                                                                                               21/42 正在安装    : perl-Net-SMTP-SSL-1.01-13.el7.noarch                                                                                                               22/42 正在安装    : perl-MailTools-2.12-2.el7.noarch                                                                                                                   23/42 正在安装    : perl-List-MoreUtils-0.33-9.el7.x86_64                                                                                                              24/42 正在安装    : perl-Package-DeprecationManager-0.13-7.el7.noarch                                                                                                  25/42 正在安装    : perl-Package-Stash-0.34-2.el7.noarch                                                                                                               26/42 正在安装    : perl-Class-Load-0.20-3.el7.noarch                                                                                                                  27/42 正在安装    : perl-Sys-Syslog-0.33-3.el7.x86_64                                                                                                                  28/42 正在安装    : gdbm-devel-1.10-8.el7.x86_64                                                                                                                       29/42 正在安装    : pyparsing-1.5.6-9.el7.noarch                                                                                                                       30/42 正在安装    : systemtap-sdt-devel-4.0-13.el7.x86_64                                                                                                              31/42 正在安装    : perl-Mail-Sendmail-0.79-21.el7.noarch                                                                                                              32/42 正在安装    : libdb-devel-5.3.21-25.el7.x86_64                                                                                                                   33/42 正在安装    : perl-ExtUtils-MakeMaker-6.68-3.el7.noarch                                                                                                          34/42 正在安装    : perl-ExtUtils-Install-1.58-299.el7_9.noarch                                                                                                        35/42 正在安装    : 1:perl-ExtUtils-ParseXS-3.18-3.el7.noarch                                                                                                          36/42 正在安装    : 4:perl-devel-5.16.3-299.el7_9.x86_64                                                                                                               37/42 正在安装    : perl-local-lib-1.008010-4.el7.noarch                                                                                                               38/42 正在安装    : perl-CPAN-1.9800-299.el7_9.noarch                                                                                                                  39/42 正在安装    : perl-Log-Dispatch-2.41-1.el7.1.noarch                                                                                                              40/42 正在安装    : perl-Config-Tiny-2.14-7.el7.noarch                                                                                                                 41/42 正在安装    : perl-Parallel-ForkManager-1.18-2.el7.noarch                                                                                                        42/42 验证中      : perl-local-lib-1.008010-4.el7.noarch                                                                                                                1/42 验证中      : perl-Module-Runtime-0.013-4.el7.noarch                                                                                                              2/42 验证中      : libdb-devel-5.3.21-25.el7.x86_64                                                                                                                    3/42 验证中      : perl-Mail-Sendmail-0.79-21.el7.noarch                                                                                                               4/42 验证中      : perl-MailTools-2.12-2.el7.noarch                                                                                                                    5/42 验证中      : perl-ExtUtils-Install-1.58-299.el7_9.noarch                                                                                                         6/42 验证中      : perl-Try-Tiny-0.12-2.el7.noarch                                                                                                                     7/42 验证中      : perl-Parallel-ForkManager-1.18-2.el7.noarch                                                                                                         8/42 验证中      : 1:perl-ExtUtils-ParseXS-3.18-3.el7.noarch                                                                                                           9/42 验证中      : pyparsing-1.5.6-9.el7.noarch                                                                                                                       10/42 验证中      : gdbm-devel-1.10-8.el7.x86_64                                                                                                                       11/42 验证中      : perl-Mail-Sender-0.8.23-1.el7.noarch                                                                                                               12/42 验证中      : perl-ExtUtils-MakeMaker-6.68-3.el7.noarch                                                                                                          13/42 验证中      : perl-Config-Tiny-2.14-7.el7.noarch                                                                                                                 14/42 验证中      : systemtap-sdt-devel-4.0-13.el7.x86_64                                                                                                              15/42 验证中      : perl-Sys-Syslog-0.33-3.el7.x86_64                                                                                                                  16/42 验证中      : perl-List-MoreUtils-0.33-9.el7.x86_64                                                                                                              17/42 验证中      : perl-IO-Socket-SSL-1.94-7.el7.noarch                                                                                                               18/42 验证中      : perl-Mozilla-CA-20130114-5.el7.noarch                                                                                                              19/42 验证中      : 4:perl-devel-5.16.3-299.el7_9.x86_64                                                                                                               20/42 验证中      : perl-MIME-Types-1.38-2.el7.noarch                                                                                                                  21/42 验证中      : perl-Params-Util-1.07-6.el7.x86_64                                                                                                                 22/42 验证中      : perl-Package-Stash-0.34-2.el7.noarch                                                                                                               23/42 验证中      : perl-IO-Socket-IP-0.21-5.el7.noarch                                                                                                                24/42 验证中      : perl-Package-Stash-XS-0.26-3.el7.x86_64                                                                                                            25/42 验证中      : perl-MIME-Lite-3.030-1.el7.noarch                                                                                                                  26/42 验证中      : perl-Net-SSLeay-1.55-6.el7.x86_64                                                                                                                  27/42 验证中      : perl-Params-Validate-1.08-4.el7.x86_64                                                                                                             28/42 验证中      : perl-Class-Load-0.20-3.el7.noarch                                                                                                                  29/42 验证中      : perl-Log-Dispatch-2.41-1.el7.1.noarch                                                                                                              30/42 验证中      : perl-Package-DeprecationManager-0.13-7.el7.noarch                                                                                                  31/42 验证中      : perl-ExtUtils-Manifest-1.61-244.el7.noarch                                                                                                         32/42 验证中      : perl-Net-SMTP-SSL-1.01-13.el7.noarch                                                                                                               33/42 验证中      : perl-Sub-Install-0.926-6.el7.noarch                                                                                                                34/42 验证中      : perl-CPAN-1.9800-299.el7_9.noarch                                                                                                                  35/42 验证中      : perl-Module-Implementation-0.06-6.el7.noarch                                                                                                       36/42 验证中      : 1:perl-TimeDate-2.30-2.el7.noarch                                                                                                                  37/42 验证中      : 1:perl-Digest-SHA-5.85-4.el7.x86_64                                                                                                                38/42 验证中      : perl-Data-OptList-0.107-9.el7.noarch                                                                                                               39/42 验证中      : perl-Net-LibIDN-0.12-15.el7.x86_64                                                                                                                 40/42 验证中      : perl-Digest-1.17-245.el7.noarch                                                                                                                    41/42 验证中      : perl-Email-Date-Format-1.002-15.el7.noarch                                                                                                         42/42 已安装:perl-CPAN.noarch 0:1.9800-299.el7_9           perl-Config-Tiny.noarch 0:2.14-7.el7 perl-ExtUtils-MakeMaker.noarch 0:6.68-3.el7 perl-Log-Dispatch.noarch 0:2.41-1.el7.1perl-Parallel-ForkManager.noarch 0:1.18-2.el7作为依赖被安装:gdbm-devel.x86_64 0:1.10-8.el7                              libdb-devel.x86_64 0:5.3.21-25.el7                    perl-Class-Load.noarch 0:0.20-3.el7                 perl-Data-OptList.noarch 0:0.107-9.el7                      perl-Digest.noarch 0:1.17-245.el7                     perl-Digest-SHA.x86_64 1:5.85-4.el7                 perl-Email-Date-Format.noarch 0:1.002-15.el7                perl-ExtUtils-Install.noarch 0:1.58-299.el7_9         perl-ExtUtils-Manifest.noarch 0:1.61-244.el7        perl-ExtUtils-ParseXS.noarch 1:3.18-3.el7                   perl-IO-Socket-IP.noarch 0:0.21-5.el7                 perl-IO-Socket-SSL.noarch 0:1.94-7.el7              perl-List-MoreUtils.x86_64 0:0.33-9.el7                     perl-MIME-Lite.noarch 0:3.030-1.el7                   perl-MIME-Types.noarch 0:1.38-2.el7                 perl-Mail-Sender.noarch 0:0.8.23-1.el7                      perl-Mail-Sendmail.noarch 0:0.79-21.el7               perl-MailTools.noarch 0:2.12-2.el7                  perl-Module-Implementation.noarch 0:0.06-6.el7              perl-Module-Runtime.noarch 0:0.013-4.el7              perl-Mozilla-CA.noarch 0:20130114-5.el7             perl-Net-LibIDN.x86_64 0:0.12-15.el7                        perl-Net-SMTP-SSL.noarch 0:1.01-13.el7                perl-Net-SSLeay.x86_64 0:1.55-6.el7                 perl-Package-DeprecationManager.noarch 0:0.13-7.el7         perl-Package-Stash.noarch 0:0.34-2.el7                perl-Package-Stash-XS.x86_64 0:0.26-3.el7           perl-Params-Util.x86_64 0:1.07-6.el7                        perl-Params-Validate.x86_64 0:1.08-4.el7              perl-Sub-Install.noarch 0:0.926-6.el7               perl-Sys-Syslog.x86_64 0:0.33-3.el7                         perl-TimeDate.noarch 1:2.30-2.el7                     perl-Try-Tiny.noarch 0:0.12-2.el7                   perl-devel.x86_64 4:5.16.3-299.el7_9                        perl-local-lib.noarch 0:1.008010-4.el7                pyparsing.noarch 0:1.5.6-9.el7                      systemtap-sdt-devel.x86_64 0:4.0-13.el7                    完毕!

2.3..2 node

所有节点安装node(四台机子都需要)
        tar xf mha4mysql-node-0.57.tar.gz


        cd mha4mysql-node-0.57
        perl Makefile.PL && make && make install

[root@mgt ~]# cd mha4mysql-node-0.57
[root@mgt mha4mysql-node-0.57]# perl Makefile.PL && make && make install
*** Module::AutoInstall version 1.06
*** Checking for Perl dependencies...
[Core Features]
- DBI        ...loaded. (1.627)
- DBD::mysql ...loaded. (4.023)
*** Module::AutoInstall configuration finished.
Checking if your kit is complete...
Looks good
Writing Makefile for mha4mysql::node
cp lib/MHA/BinlogManager.pm blib/lib/MHA/BinlogManager.pm
cp lib/MHA/BinlogPosFindManager.pm blib/lib/MHA/BinlogPosFindManager.pm
cp lib/MHA/BinlogPosFinderXid.pm blib/lib/MHA/BinlogPosFinderXid.pm
cp lib/MHA/BinlogHeaderParser.pm blib/lib/MHA/BinlogHeaderParser.pm
cp lib/MHA/BinlogPosFinder.pm blib/lib/MHA/BinlogPosFinder.pm
cp lib/MHA/NodeUtil.pm blib/lib/MHA/NodeUtil.pm
cp lib/MHA/BinlogPosFinderElp.pm blib/lib/MHA/BinlogPosFinderElp.pm
cp lib/MHA/SlaveUtil.pm blib/lib/MHA/SlaveUtil.pm
cp lib/MHA/NodeConst.pm blib/lib/MHA/NodeConst.pm
cp bin/filter_mysqlbinlog blib/script/filter_mysqlbinlog
/usr/bin/perl "-Iinc" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/filter_mysqlbinlog
cp bin/apply_diff_relay_logs blib/script/apply_diff_relay_logs
/usr/bin/perl "-Iinc" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/apply_diff_relay_logs
cp bin/purge_relay_logs blib/script/purge_relay_logs
/usr/bin/perl "-Iinc" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/purge_relay_logs
cp bin/save_binary_logs blib/script/save_binary_logs
/usr/bin/perl "-Iinc" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/save_binary_logs
Manifying blib/man1/filter_mysqlbinlog.1
Manifying blib/man1/apply_diff_relay_logs.1
Manifying blib/man1/purge_relay_logs.1
Manifying blib/man1/save_binary_logs.1
Installing /usr/local/share/perl5/MHA/BinlogManager.pm
Installing /usr/local/share/perl5/MHA/BinlogPosFindManager.pm
Installing /usr/local/share/perl5/MHA/BinlogPosFinderXid.pm
Installing /usr/local/share/perl5/MHA/BinlogHeaderParser.pm
Installing /usr/local/share/perl5/MHA/BinlogPosFinder.pm
Installing /usr/local/share/perl5/MHA/NodeUtil.pm
Installing /usr/local/share/perl5/MHA/BinlogPosFinderElp.pm
Installing /usr/local/share/perl5/MHA/SlaveUtil.pm
Installing /usr/local/share/perl5/MHA/NodeConst.pm
Installing /usr/local/share/man/man1/filter_mysqlbinlog.1
Installing /usr/local/share/man/man1/apply_diff_relay_logs.1
Installing /usr/local/share/man/man1/purge_relay_logs.1
Installing /usr/local/share/man/man1/save_binary_logs.1
Installing /usr/local/bin/filter_mysqlbinlog
Installing /usr/local/bin/apply_diff_relay_logs
Installing /usr/local/bin/purge_relay_logs
Installing /usr/local/bin/save_binary_logs
Appending installation info to /usr/lib64/perl5/perllocal.pod

    验证
        cd /usr/local/bin
        看到脚本就OK

2.3.3 manager (只在mgt上装)

tar xf mha4mysql-manager-0.57.tar.gz
cd /root/mha4mysql-manager-0.57
perl Makefile.PL && make && make install
cp sample/scripts/master_ip_failover /usr/local/bin/
cp sample/scripts/master_ip_online_change     /usr/local/bin/

[root@mgt ~]# cd mha4mysql-manager-0.57
[root@mgt mha4mysql-manager-0.57]# ls
AUTHORS  bin  COPYING  debian  inc  lib  Makefile.PL  MANIFEST  META.yml  README  rpm  samples  t  tests
[root@mgt mha4mysql-manager-0.57]# perl Makefile.PL && make && make install
*** Module::AutoInstall version 1.06
*** Checking for Perl dependencies...
[Core Features]
- DBI                   ...loaded. (1.627)
- DBD::mysql            ...loaded. (4.023)
- Time::HiRes           ...loaded. (1.9725)
- Config::Tiny          ...loaded. (2.14)
- Log::Dispatch         ...loaded. (2.41)
- Parallel::ForkManager ...loaded. (1.18)
- MHA::NodeConst        ...loaded. (0.57)
*** Module::AutoInstall configuration finished.
Checking if your kit is complete...
Looks good
Writing Makefile for mha4mysql::manager
cp lib/MHA/ManagerUtil.pm blib/lib/MHA/ManagerUtil.pm
cp lib/MHA/Config.pm blib/lib/MHA/Config.pm
cp lib/MHA/HealthCheck.pm blib/lib/MHA/HealthCheck.pm
cp lib/MHA/ServerManager.pm blib/lib/MHA/ServerManager.pm
cp lib/MHA/ManagerConst.pm blib/lib/MHA/ManagerConst.pm
cp lib/MHA/ManagerAdmin.pm blib/lib/MHA/ManagerAdmin.pm
cp lib/MHA/FileStatus.pm blib/lib/MHA/FileStatus.pm
cp lib/MHA/MasterFailover.pm blib/lib/MHA/MasterFailover.pm
cp lib/MHA/ManagerAdminWrapper.pm blib/lib/MHA/ManagerAdminWrapper.pm
cp lib/MHA/MasterMonitor.pm blib/lib/MHA/MasterMonitor.pm
cp lib/MHA/MasterRotate.pm blib/lib/MHA/MasterRotate.pm
cp lib/MHA/SSHCheck.pm blib/lib/MHA/SSHCheck.pm
cp lib/MHA/Server.pm blib/lib/MHA/Server.pm
cp lib/MHA/DBHelper.pm blib/lib/MHA/DBHelper.pm
cp bin/masterha_stop blib/script/masterha_stop
/usr/bin/perl "-Iinc" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/masterha_stop
cp bin/masterha_conf_host blib/script/masterha_conf_host
/usr/bin/perl "-Iinc" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/masterha_conf_host
cp bin/masterha_check_repl blib/script/masterha_check_repl
/usr/bin/perl "-Iinc" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/masterha_check_repl
cp bin/masterha_check_status blib/script/masterha_check_status
/usr/bin/perl "-Iinc" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/masterha_check_status
cp bin/masterha_master_monitor blib/script/masterha_master_monitor
/usr/bin/perl "-Iinc" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/masterha_master_monitor
cp bin/masterha_check_ssh blib/script/masterha_check_ssh
/usr/bin/perl "-Iinc" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/masterha_check_ssh
cp bin/masterha_master_switch blib/script/masterha_master_switch
/usr/bin/perl "-Iinc" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/masterha_master_switch
cp bin/masterha_secondary_check blib/script/masterha_secondary_check
/usr/bin/perl "-Iinc" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/masterha_secondary_check
cp bin/masterha_manager blib/script/masterha_manager
/usr/bin/perl "-Iinc" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/masterha_manager
Manifying blib/man1/masterha_stop.1
Manifying blib/man1/masterha_conf_host.1
Manifying blib/man1/masterha_check_repl.1
Manifying blib/man1/masterha_check_status.1
Manifying blib/man1/masterha_master_monitor.1
Manifying blib/man1/masterha_check_ssh.1
Manifying blib/man1/masterha_master_switch.1
Manifying blib/man1/masterha_secondary_check.1
Manifying blib/man1/masterha_manager.1
Installing /usr/local/share/perl5/MHA/ManagerUtil.pm
Installing /usr/local/share/perl5/MHA/Config.pm
Installing /usr/local/share/perl5/MHA/HealthCheck.pm
Installing /usr/local/share/perl5/MHA/ServerManager.pm
Installing /usr/local/share/perl5/MHA/ManagerConst.pm
Installing /usr/local/share/perl5/MHA/ManagerAdmin.pm
Installing /usr/local/share/perl5/MHA/FileStatus.pm
Installing /usr/local/share/perl5/MHA/MasterFailover.pm
Installing /usr/local/share/perl5/MHA/ManagerAdminWrapper.pm
Installing /usr/local/share/perl5/MHA/MasterMonitor.pm
Installing /usr/local/share/perl5/MHA/MasterRotate.pm
Installing /usr/local/share/perl5/MHA/SSHCheck.pm
Installing /usr/local/share/perl5/MHA/Server.pm
Installing /usr/local/share/perl5/MHA/DBHelper.pm
Installing /usr/local/share/man/man1/masterha_stop.1
Installing /usr/local/share/man/man1/masterha_conf_host.1
Installing /usr/local/share/man/man1/masterha_check_repl.1
Installing /usr/local/share/man/man1/masterha_check_status.1
Installing /usr/local/share/man/man1/masterha_master_monitor.1
Installing /usr/local/share/man/man1/masterha_check_ssh.1
Installing /usr/local/share/man/man1/masterha_master_switch.1
Installing /usr/local/share/man/man1/masterha_secondary_check.1
Installing /usr/local/share/man/man1/masterha_manager.1
Installing /usr/local/bin/masterha_stop
Installing /usr/local/bin/masterha_conf_host
Installing /usr/local/bin/masterha_check_repl
Installing /usr/local/bin/masterha_check_status
Installing /usr/local/bin/masterha_master_monitor
Installing /usr/local/bin/masterha_check_ssh
Installing /usr/local/bin/masterha_master_switch
Installing /usr/local/bin/masterha_secondary_check
Installing /usr/local/bin/masterha_manager
Appending installation info to /usr/lib64/perl5/perllocal.pod
[root@mgt mha4mysql-manager-0.57]# ls
AUTHORS  bin  blib  COPYING  debian  inc  lib  Makefile  Makefile.PL  MANIFEST  META.yml  pm_to_blib  README  rpm  samples  t  tests

 脚本说明
    master_ip_failover    自动切换时 VIP 管理的脚本

#!/usr/bin/env perl
use strict;
use warnings FATAL => 'all';use Getopt::Long;my (
$command, $ssh_user, $orig_master_host, $orig_master_ip,
$orig_master_port, $new_master_host, $new_master_ip, $new_master_port
);
#############################添加内容部分#########################################
my $vip = '192.168.184.200';								#指定vip的地址
my $brdc = '192.168.184.255';								#指定vip的广播地址
my $ifdev = 'ens33';										#指定vip绑定的网卡
my $key = '1';												#指定vip绑定的虚拟网卡序列号
my $ssh_start_vip = "/sbin/ifconfig ens33:$key $vip";		#代表此变量值为ifconfig ens33:1 192.168.184.200
my $ssh_stop_vip = "/sbin/ifconfig ens33:$key down";		#代表此变量值为ifconfig ens33:1 192.168.184.200 down
my $exit_code = 0;											#指定退出状态码为0
#my $ssh_start_vip = "/usr/sbin/ip addr add $vip/24 brd $brdc dev $ifdev label $ifdev:$key;/usr/sbin/arping -q -A -c 1 -I $ifdev $vip;iptables -F;";
#my $ssh_stop_vip = "/usr/sbin/ip addr del $vip/24 dev $ifdev label $ifdev:$key";
##################################################################################
GetOptions(
'command=s' => \$command,
'ssh_user=s' => \$ssh_user,
'orig_master_host=s' => \$orig_master_host,
'orig_master_ip=s' => \$orig_master_ip,
'orig_master_port=i' => \$orig_master_port,
'new_master_host=s' => \$new_master_host,
'new_master_ip=s' => \$new_master_ip,
'new_master_port=i' => \$new_master_port,
);exit &main();sub main {print "\n\nIN SCRIPT TEST====$ssh_stop_vip==$ssh_start_vip===\n\n";if ( $command eq "stop" || $command eq "stopssh" ) {my $exit_code = 1;
eval {
print "Disabling the VIP on old master: $orig_master_host \n";
&stop_vip();
$exit_code = 0;
};
if ($@) {
warn "Got Error: $@\n";
exit $exit_code;
}
exit $exit_code;
}
elsif ( $command eq "start" ) {my $exit_code = 10;
eval {
print "Enabling the VIP - $vip on the new master - $new_master_host \n";
&start_vip();
$exit_code = 0;
};
if ($@) {
warn $@;
exit $exit_code;
}
exit $exit_code;
}
elsif ( $command eq "status" ) {
print "Checking the Status of the script.. OK \n";
exit 0;
}
else {
&usage();
exit 1;
}
}
sub start_vip() {
`ssh $ssh_user\@$new_master_host \" $ssh_start_vip \"`;
}
## A simple system call that disable the VIP on the old_master
sub stop_vip() {
`ssh $ssh_user\@$orig_master_host \" $ssh_stop_vip \"`;
}sub usage {
print
"Usage: master_ip_failover --command=start|stop|stopssh|status --orig_master_host=host --orig_master_ip=ip --orig_master_port=port --new_master_host=host --new_master_ip=ip --new_master_port=port\n";
}

    master_ip_online_change    在线切换时 vip 的管理
    power_manager    故障发生后关闭主机的脚本
    send_report    因故障切换后发送报警的脚本

配置文件建立
    mkdir /etc/masterha
    vim /etc/masterha/app1.cnf

[server default]
manager_log=/var/log/masterha/app1/manager.log
manager_workdir=/var/log/masterha/app1
master_binlog_dir=/var/lib/mysql
master_ip_failover_script=/usr/local/bin/master_ip_failover
master_ip_online_change_script=/usr/local/bin/master_ip_online_change
password=123.com
ping_interval=1
remote_workdir=/tmp
repl_password=123.com
repl_user=myslave
secondary_check_script=/usr/local/bin/masterha_secondary_check -s 192.168.156.5 -s 192.168.156.6
shutdown_script=""
ssh_user=root
user=mha[server1]
hostname=192.168.156.4
port=3306[server2]
candidate_master=1
check_repl_delay=0
hostname=192.168.156.5
port=3306[server3]
hostname=192.168.156.6
port=3306

mkdir /var/log/masterha/app1

 测试MHA
    masterha_check_ssh --conf=/etc/masterha/app1.cnf
    masterha_check_repl --conf=/etc/masterha/app1.cnf

[root@mgt ~]# masterha_check_repl --conf=/etc/masterha/app1.cnf
Wed Aug 16 09:33:43 2023 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Wed Aug 16 09:33:43 2023 - [info] Reading application default configuration from /etc/masterha/app1.cnf..
Wed Aug 16 09:33:43 2023 - [info] Reading server configuration from /etc/masterha/app1.cnf..
Wed Aug 16 09:33:43 2023 - [info] MHA::MasterMonitor version 0.57.
Wed Aug 16 09:33:45 2023 - [info] GTID failover mode = 0
Wed Aug 16 09:33:45 2023 - [info] Dead Servers:
Wed Aug 16 09:33:45 2023 - [info] Alive Servers:
Wed Aug 16 09:33:45 2023 - [info]   192.168.156.4(192.168.156.4:3306)
Wed Aug 16 09:33:45 2023 - [info]   192.168.156.5(192.168.156.5:3306)
Wed Aug 16 09:33:45 2023 - [info]   192.168.156.6(192.168.156.6:3306)
Wed Aug 16 09:33:45 2023 - [info] Alive Slaves:
Wed Aug 16 09:33:45 2023 - [info]   192.168.156.5(192.168.156.5:3306)  Version=5.5.68-MariaDB (oldest major version between slaves) log-bin:enabled
Wed Aug 16 09:33:45 2023 - [info]     Replicating from 192.168.156.4(192.168.156.4:3306)
Wed Aug 16 09:33:45 2023 - [info]     Primary candidate for the new Master (candidate_master is set)
Wed Aug 16 09:33:45 2023 - [info]   192.168.156.6(192.168.156.6:3306)  Version=5.5.68-MariaDB (oldest major version between slaves) log-bin:enabled
Wed Aug 16 09:33:45 2023 - [info]     Replicating from 192.168.156.4(192.168.156.4:3306)
Wed Aug 16 09:33:45 2023 - [info] Current Alive Master: 192.168.156.4(192.168.156.4:3306)
Wed Aug 16 09:33:45 2023 - [info] Checking slave configurations..
Wed Aug 16 09:33:45 2023 - [info]  read_only=1 is not set on slave 192.168.156.5(192.168.156.5:3306).
Wed Aug 16 09:33:45 2023 - [warning]  relay_log_purge=0 is not set on slave 192.168.156.5(192.168.156.5:3306).
Wed Aug 16 09:33:45 2023 - [info]  read_only=1 is not set on slave 192.168.156.6(192.168.156.6:3306).
Wed Aug 16 09:33:45 2023 - [warning]  relay_log_purge=0 is not set on slave 192.168.156.6(192.168.156.6:3306).
Wed Aug 16 09:33:45 2023 - [info] Checking replication filtering settings..
Wed Aug 16 09:33:45 2023 - [info]  binlog_do_db= , binlog_ignore_db= 
Wed Aug 16 09:33:45 2023 - [info]  Replication filtering check ok.
Wed Aug 16 09:33:45 2023 - [info] GTID (with auto-pos) is not supported
Wed Aug 16 09:33:45 2023 - [info] Starting SSH connection tests..
Wed Aug 16 09:33:49 2023 - [info] All SSH connection tests passed successfully.
Wed Aug 16 09:33:49 2023 - [info] Checking MHA Node version..
Wed Aug 16 09:33:51 2023 - [info]  Version check ok.
Wed Aug 16 09:33:51 2023 - [info] Checking SSH publickey authentication settings on the current master..
Wed Aug 16 09:33:51 2023 - [info] HealthCheck: SSH to 192.168.156.4 is reachable.
Wed Aug 16 09:33:52 2023 - [info] Master MHA Node version is 0.57.
Wed Aug 16 09:33:52 2023 - [info] Checking recovery script configurations on 192.168.156.4(192.168.156.4:3306)..
Wed Aug 16 09:33:52 2023 - [info]   Executing command: save_binary_logs --command=test --start_pos=4 --binlog_dir=/var/lib/mysql --output_file=/tmp/save_binary_logs_test --manager_version=0.57 --start_file=master-bin.000003 
Wed Aug 16 09:33:52 2023 - [info]   Connecting to root@192.168.156.4(192.168.156.4:22).. Creating /tmp if not exists..    ok.Checking output directory is accessible or not..ok.Binlog found at /var/lib/mysql, up to master-bin.000003
Wed Aug 16 09:33:53 2023 - [info] Binlog setting check done.
Wed Aug 16 09:33:53 2023 - [info] Checking SSH publickey authentication and checking recovery script configurations on all alive slave servers..
Wed Aug 16 09:33:53 2023 - [info]   Executing command : apply_diff_relay_logs --command=test --slave_user='mha' --slave_host=192.168.156.5 --slave_ip=192.168.156.5 --slave_port=3306 --workdir=/tmp --target_version=5.5.68-MariaDB --manager_version=0.57 --relay_log_info=/var/lib/mysql/relay-log.info  --relay_dir=/var/lib/mysql/  --slave_pass=xxx
Wed Aug 16 09:33:53 2023 - [info]   Connecting to root@192.168.156.5(192.168.156.5:22).. Checking slave recovery environment settings..Opening /var/lib/mysql/relay-log.info ... ok.Relay log found at /var/lib/mysql, up to relay-bin.000002Temporary relay log file is /var/lib/mysql/relay-bin.000002Testing mysql connection and privileges.. done.Testing mysqlbinlog output.. done.Cleaning up test file(s).. done.
Wed Aug 16 09:33:54 2023 - [info]   Executing command : apply_diff_relay_logs --command=test --slave_user='mha' --slave_host=192.168.156.6 --slave_ip=192.168.156.6 --slave_port=3306 --workdir=/tmp --target_version=5.5.68-MariaDB --manager_version=0.57 --relay_log_info=/var/lib/mysql/relay-log.info  --relay_dir=/var/lib/mysql/  --slave_pass=xxx
Wed Aug 16 09:33:54 2023 - [info]   Connecting to root@192.168.156.6(192.168.156.6:22).. Checking slave recovery environment settings..Opening /var/lib/mysql/relay-log.info ... ok.Relay log found at /var/lib/mysql, up to relay-bin.000002Temporary relay log file is /var/lib/mysql/relay-bin.000002Testing mysql connection and privileges.. done.Testing mysqlbinlog output.. done.Cleaning up test file(s).. done.
Wed Aug 16 09:33:55 2023 - [info] Slaves settings check done.
Wed Aug 16 09:33:55 2023 - [info] 
192.168.156.4(192.168.156.4:3306) (current master)+--192.168.156.5(192.168.156.5:3306)+--192.168.156.6(192.168.156.6:3306)Wed Aug 16 09:33:55 2023 - [info] Checking replication health on 192.168.156.5..
Wed Aug 16 09:33:55 2023 - [info]  ok.
Wed Aug 16 09:33:55 2023 - [info] Checking replication health on 192.168.156.6..
Wed Aug 16 09:33:55 2023 - [info]  ok.
Wed Aug 16 09:33:55 2023 - [info] Checking master_ip_failover_script status:
Wed Aug 16 09:33:55 2023 - [info]   /usr/local/bin/master_ip_failover --command=status --ssh_user=root --orig_master_host=192.168.156.4 --orig_master_ip=192.168.156.4 --orig_master_port=3306 IN SCRIPT TEST====/sbin/ifconfig ens33:1 down==/sbin/ifconfig ens33:1 192.168.156.100===Usage: master_ip_failover --command=start|stop|stopssh|status --orig_master_host=host --orig_master_ip=ip --orig_master_port=port --new_master_host=host --new_master_ip=ip --new_master_port=port
Wed Aug 16 09:33:55 2023 - [warning] shutdown_script is not defined.
Wed Aug 16 09:33:55 2023 - [info] Got exit code 0 (Not master dead).MySQL Replication Health is OK.

启动命令
    nohup masterha_manager --conf=/etc/masterha/app1.cnf --remove_dead_master_conf --ignore_last_failover < /dev/null > /var/log/masterha/app1/manager.log 2>&1 &

 启动时masterIP异常
    需要工程手动配置VIP

2.3.4 测试

  停用master的mariadb服务

 master

 slave1

2.3.5  故障恢复

   修改app1.cnf启动配置
        添加master主机配置信息
    分别在slave上重新指定master主机及binlog日志同步信息


总结

总结来说,MHA是一种简单而有效的高可用解决方案,可以确保MySQL和MariaDB数据库在主节点故障时能够自动切换到可用的从节点上,从而保证数据库的连续性和可用性。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/92894.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

零售行业供应链管理核心KPI指标(三)

完美订单满足率和退货率 完美订单满足率有三个方面的因素影响&#xff1a;订单按时、足量、无损交货。通常情况下零售企业追求线上订单履行周期慢慢达到行业平均水平&#xff0c;就是交付的速度变快了&#xff0c;这个肯定是一件好事情&#xff0c;趋势越来越好。 同时&#…

Vim的插件管理器之Vundle

1、安装Vundle插件管理器 Vim可以安装插件&#xff0c;但是需要手动安装比较麻烦&#xff0c;Vim本身没有提供插件管理器&#xff0c;所以会有很多的第三方的插件管理器&#xff0c;有一个vim的插件叫做 “vim-easymotion”&#xff0c;在它的github的安装说明里有列出对于不同…

log4j:WARN No appenders could be found for logger问题

本文将idea场景下的使用。 IDEA中&#xff0c;将配置文件命名为log4j.properties&#xff08;该命名才会被自动加载&#xff09;&#xff0c; 并放到某个目录下&#xff08;通常放到resources目录&#xff09;&#xff0c;并在resources上右键&#xff0c;找到Mark Directory a…

Nginx转发请求到后端服务报400 Bad Request

问题描述 系统部署好后&#xff0c;进行测试时发现有部分接口出错&#xff0c;项目采用Nginx作为后端代理服务器&#xff0c;有Nginx统一将请求转发到后端的网关服务&#xff0c;再由网关服务路由到具体的服务上&#xff0c;发布好后&#xff0c;大部分接口都是正常的&#xff…

POSTGRESQL 关于2023-08-14 数据库自动启动文章中使用KILL 来进行配置RELOAD的问题解释...

开头还是介绍一下群&#xff0c;如果感兴趣Polardb ,mongodb ,MySQL ,Postgresql ,redis &#xff0c;SQL SERVER ,ORACLE,Oceanbase 等有问题&#xff0c;有需求都可以加群群内有各大数据库行业大咖&#xff0c;CTO&#xff0c;可以解决你的问题。加群请加 liuaustin3微信号 &…

常见排序集锦-C语言实现数据结构

目录 排序的概念 常见排序集锦 1.直接插入排序 2.希尔排序 3.选择排序 4.堆排序 5.冒泡排序 6.快速排序 hoare 挖坑法 前后指针法 非递归 7.归并排序 非递归 排序实现接口 算法复杂度与稳定性分析 排序的概念 排序 &#xff1a;所谓排序&#xff0c;就是使一串记录&#…

【计算机网络】13、ARP 包:广播自己的 mac 地址和 ip

机器启动时&#xff0c;会向外广播自己的 mac 地址和 ip 地址&#xff0c;这个即称为 arp 协议。范围是未经过路由器的部分&#xff0c;如下图的蓝色部分&#xff0c;范围内的设备都会在本地记录 mac 和 ip 的绑定信息&#xff0c;若有重复则覆盖更新&#xff08;例如先收到 ma…

ESP32+VSCode开发环境搭建(全网最强最终解决方案)

文章目录 1 安装步骤2 开发机器环境准备3 安装ESP-IDF-tools离线包4 创建VSCode配置文件(纯净的开发环境)5 安装espressif IDF 插件6 程序测试7 常见问题7.1环境变量设置问题&#xff1f;问题1&#xff1a;到底是设置IDF_TOOLS_PATH和IDF_PATH还是只配置一个IDF_TOOLS_PATH? 7…

Spring的简介ioc容器及注入方式

一.Spring的简介 1.Spring的特性 Spring是一个开源框架&#xff0c;它由Rod Johnson创建。它是为了解决企业应用开发的复杂性而创建的。 Spring使用基本的JavaBean来完成以前只可能由EJB完成的事情。 然而&#xff0c;Spring的用途不仅限于服务器端的开发。从简单性、可测试性…

Python文件操作与输入输出:从基础到高级应用

文章目录 &#x1f340;引言&#x1f340;文件操作基础&#x1f340;上下文管理器与文件自动关闭&#x1f340;文件的迭代与逐行读取&#x1f340;文件的其他常见操作&#x1f340;输入输出基础&#x1f340; 文件输入输出&#x1f340;格式化输出&#x1f340;高级文件操作&am…

(二)掌握最基本的Linux服务器用法——Linux下简单的C/C++ 程序、项目编译

1、静态库与动态库 静态库(Static Library)&#xff1a;静态库是编译后的库文件&#xff0c;其中的代码在编译时被链接到程序中&#xff0c;因此它会与程序一起形成一个独立的可执行文件。每个使用静态库的程序都会有自己的库的副本&#xff0c;这可能会导致内存浪费。常用后缀…

AI 绘画Stable Diffusion 研究(九)sd图生图功能详解-老照片高清修复放大

大家好&#xff0c;我是风雨无阻。 通过前面几篇文章的介绍&#xff0c;相信各位小伙伴&#xff0c;对 Stable Diffusion 这款强大的AI 绘图系统有了全新的认知。我们见识到了借助 Stable Diffusion的文生图功能&#xff0c;利用简单的几个单词&#xff0c;就可以生成完美的图片…

7-3 求给定精度的简单交错序列部分和

分数 15 全屏浏览题目 切换布局 作者 C课程组 单位 浙江大学 本题要求编写程序&#xff0c;计算序列部分和 1 - 1/4 1/7 - 1/10 ... 直到最后一项的绝对值不大于给定精度eps。 输入格式: 输入在一行中给出一个正实数eps。 输出格式: 在一行中按照“sum S”的格式输出…

.net连接mysql,提示找不到请求的 .Net Framework Data Provider。可能没有安装

开发完成的.net程序需要连接mysql数据库&#xff0c;在个人电脑上运行没问题&#xff0c;别人运行时提示“提示找不到请求的 .Net Framework Data Provider。可能没有安装”。经过查询&#xff0c;安装Connector/NET 8.1.0&#xff0c;下载地址如下所示&#xff1a; https://d…

(分治) 剑指 Offer 16. 数值的整数次方 ——【Leetcode每日一题】

❓剑指 Offer 16. 数值的整数次方 难度&#xff1a;中等 实现 pow(x, n) &#xff0c;即计算 x 的 n 次幂函数&#xff08;即&#xff0c; x n x^n xn&#xff09;。不得使用库函数&#xff0c;同时不需要考虑大数问题。 示例 1&#xff1a; 输入&#xff1a;x 2.00000, n …

腾讯云轻量服务器测评:2核 2G 4M

腾讯云轻量2核2G4M服务器&#xff0c;4M带宽下载速度可达512KB/秒&#xff0c;系统盘为50GB SSD盘&#xff0c;300GB月流量&#xff0c;地域节点可选上海、广州和北京&#xff0c;腾讯云百科分享腾讯云2核2G4M轻量应用服务器配置性能表&#xff1a; 目录 腾讯云轻量2核2G4M服…

谈谈网络协议的定义、组成和重要性

个人主页&#xff1a;insist--个人主页​​​​​​ 本文专栏&#xff1a;网络基础——带你走进网络世界 本专栏会持续更新网络基础知识&#xff0c;希望大家多多支持&#xff0c;让我们一起探索这个神奇而广阔的网络世界。 目录 一、网络协议的定义 二、网络协议的组成 1、…

Vite更新依赖缓存失败,强制更新依赖缓存

使用vitets开发一段时间了&#xff0c;感觉并不是想象中的好用&#xff0c;特别是出现些稀奇古怪的问题不好解决&#xff0c;比如下面这个问题 上午9:50:08 [vite] error while updating dependencies: Error: ENOENT: no such file or directory, open E:/workspace-dir/node…

常见期权策略类型有哪些?

这几天在做一个期权策略类型的整理分类&#xff0c;怎么解释期权策略&#xff0c;期权策略是现代金融市场中运用非常广泛、变化非常丰富、结构非常精妙的金融衍生产品&#xff1b;同时也是一种更为复杂也更为灵活的投资工具&#xff0c;下文介绍常见期权策略类型有哪些&#xf…

区间预测 | MATLAB实现QRLSTM长短期记忆神经网络分位数回归时间序列区间预测

区间预测 | MATLAB实现QRLSTM长短期记忆神经网络分位数回归时间序列区间预测 目录 区间预测 | MATLAB实现QRLSTM长短期记忆神经网络分位数回归时间序列区间预测效果一览基本介绍模型描述程序设计参考资料 效果一览 基本介绍 MATLAB实现QRLSTM长短期记忆神经网络分位数回归时间序…