redhat7.4下離線安裝MHA0.58

hunterjoy發表於2021-07-25

 安裝文件


離線安裝

安裝環境redhat7.4+MHA0.58+MySQL5.7.30


1、下載MHA Node and MHA Manager安裝包


2、配置SSH互信



3、安裝 MHA Node

3.1安裝目標:

在master、slave、management server節點都需要安裝


3.2 在 RHEL/CentOS 作業系統下, 安裝如下(兩種方式,任選其一)

3.2.1  rpm包安裝()

## If you have not installed DBD::mysql, install it like below, or install from source.

# yum install perl-DBD-MySQL


## Get MHA Node rpm package from "Downloads" section.

 yum -y localinstall mha4mysql-node-0.58-0.el7.centos.noarch.rpm




4、安裝 MHA Manager

在master節點安裝即可

4.1需要提前安裝如下:

MHA Node package

DBD::mysql

Config::Tiny

Log::Dispatch

Parallel::ForkManager

Time::HiRes (included from Perl v5.7.3)


4.2 在 RHEL/CentOS 作業系統下, 安裝如下(兩種方式,任選其一)

4.2.1 rpm包安裝

## Install dependent Perl modules

 yum install perl-DBD-MySQL

 yum install perl-Config-Tiny

 yum install perl-Log-Dispatch

 yum install perl-Parallel-ForkManager


## Install MHA Node, since MHA Manager uses some modules provided by MHA Node.

rpm -ivh mha4mysql-node-X.Y-0.noarch.rpm


## Finally you can install MHA Manager

 rpm -ivh mha4mysql-manager-X.Y-0.noarch.rpm


--------- MHA Manager具體安裝步驟-----------

配置redhat7.4YUM源

yum install perl

yum install perl-DBI

yum install perl-DBD-MySQL

yum install perl-IO-Socket-SSL


yum -y localinstall perl-Mail-Sender-0.8.23-1.el7.noarch.rpm

yum -y localinstall perl-Mail-Sendmail-0.79-21.el7.noarch.rpm

yum -y localinstall perl-MIME-Types-1.38-2.el7.noarch.rpm

yum -y localinstall perl-Email-Date-Format-1.002-15.el7.noarch.rpm

yum -y localinstall perl-MIME-Lite-3.030-1.el7.noarch.rpm(之前需要perl-MIME-Types和perl-Email-Date-Format)

yum -y localinstall perl-Log-Dispatch-2.41-1.el7.1.noarch.rpm(之前需要perl-Mail-Sender、perl-Mail-Sendmail和perl-MIME-Lite)

yum -y localinstall perl-Parallel-ForkManager-1.05-1.el7.noarch.rpm

yum -y localinstall mha4mysql-node-0.58-0.el7.centos.noarch.rpm

驗證node安裝:

cd /usr/bin

 ls apply_diff_relay_logs save_binary_logs filter_mysqlbinlog purge_relay_logs


yum -y localinstall perl-Config-Tiny-2.14-7.el7.noarch.rpm


yum -y localinstall mha4mysql-manager-0.58-0.el7.centos.noarch.rpm

驗證manager安裝:

[root@manage module]# ll /usr/bin/master*

-rwxr-xr-x. 1 root root 1995 Mar 22  2018 /usr/bin/masterha_check_repl

-rwxr-xr-x. 1 root root 1779 Mar 22  2018 /usr/bin/masterha_check_ssh

-rwxr-xr-x. 1 root root 1865 Mar 22  2018 /usr/bin/masterha_check_status

-rwxr-xr-x. 1 root root 3201 Mar 22  2018 /usr/bin/masterha_conf_host

-rwxr-xr-x. 1 root root 2517 Mar 22  2018 /usr/bin/masterha_manager

-rwxr-xr-x. 1 root root 2165 Mar 22  2018 /usr/bin/masterha_master_monitor

-rwxr-xr-x. 1 root root 2373 Mar 22  2018 /usr/bin/masterha_master_switch

-rwxr-xr-x. 1 root root 5172 Mar 22  2018 /usr/bin/masterha_secondary_check

-rwxr-xr-x. 1 root root 1739 Mar 22  2018 /usr/bin/masterha_stop


配置MHA

su - asuser

mkdir -p /data/masterha/

cp /home/asuser/mysql_auto_install/mha/cfg_mha/app.cnf .

cp /home/asuser/mysql_auto_install/mha/cfg_mha/master_ip_failover .




masterha_check_ssh --conf=/data/masterha/app.cnf

masterha_check_repl --conf=/data/masterha/app.cnf

masterha_check_status --conf=/data/masterha/app.cnf


su - asuser

nohup /usr/bin/masterha_manager --conf=/data/masterha/app.cnf --remove_dead_master_conf --ignore_last_failover >/data/masterha/manager.log  </dev/null 2>&1 &






來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/543979/viewspace-2783190/,如需轉載,請註明出處,否則將追究法律責任。

相關文章