华为鲲鹏+uos ha + lvs安装

所有ha机器执行:

apt install libdbi-perl libdbd-mysql-perl corosync pcs pacemaker crmsh

修改pcs端口(我用的默认的2224): vim /etc/default/pcsd

systemctl restart pcsd 
pam_tally2 --user hacluster --reset ls /etc/corosync/corosync.conf

cat /etc/ha.d/ldirectord.cf

checktimeout=3
checkinterval=5
autoreload=yes
logfile="/var/log/ldirectord.log"
quiescent=no
virtual=172.16.70.123:17100
        real=172.16.70.225:17100 gate
        real=172.16.70.226:17100 gate
        real=172.16.70.227:17100 gate
        real=172.16.70.228:17100 gate
        real=172.16.70.229:17100 gate
        scheduler=rr
        service=mysql
        protocol=tcp
        checkport=17100
        checktype=negotiate
        login="sysdba"
        passwd="Bgview@2020"
        database="mysql"
        request="SELECT 1"

操作系统设置好hacluster用户密码

一台执行:

pcs host auth test1:2224 test2:2224 test3:2224 -u hacluster -p abc123

pcs cluster setup db_ha_lvs test1 test2 test3 transport udp link mcastport=2225 --force

pcs cluster start --all

pcs cluster enable --all

pcs property set stonith-enabled=false

crm_verify -L

pcs resource create vip --disabled ocf:heartbeat:IPaddr nic=enp8s0f0 ip=172.16.70.123 cidr_netmask=24 broadcast=172.16.70.255 op monitor interval=5s timeout=20s

pcs resource create lvs --disabled ocf:heartbeat:ldirectord op monitor interval=10s timeout=10s

pcs resource group add dbservice vip

pcs resource group add dbservice lvs

启动
pcs resource enable lvs vip

更新vip
pcs resource update vip --disabled ocf:heartbeat:IPaddr nic=enp8s0f1 ip=172.16.80.123 cidr_netmask=24 broadcast=172.16.80.255 op monitor interval=5s timeout=20s

你可能感兴趣的:(华为鲲鹏+uos ha + lvs安装)