企业部分实战--利用pcs +pacemaker +corosync实现高可用集群的搭建和fence实现虚拟机断电自动重启
一、实验环境搭建
虚拟机封装
1.修改主机名 : hostnamectl set-hostname home
2.配置网络: cat /etc/sysconfig/network-scripts/ifcfg-br0
TYPE="Ethernet"
BOOTPROTO="none"
NAME="br0"
DEVICE="eth0"
ONBOOT="yes"
IPADDR="172.25.12.1"
PREFIX="24"
GATEWAY="172.25.254.250"
DNS1="114.114.114.114"
cat /etc/sysconfig/network-scripts/ifcfg-ens160
DEVICE=lo
ONBOOT=yes
NAME=ens160
BRIDGE=br0
TYPE=Ethernet
3.配置主机解析 vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.25.12.1 server1
172.25.12.2 server2
172.25.12.3 server3
172.25.12.4 server4
4.禁用项目
systemctl disable --now NetworkManager
systemctl disable --now firewalld
vim /etc/sysconfig/selinux
5.配置yum仓库
vim /etc/rc.d/rc.local
mount /iso/rhel-server-7.6-x86_64-dvd.iso /var/www/html/rhel7.6/
vim /etc/yum.repos.d/dvd.repo
[rhel7.6]
name=rhel7.6
baseurl=http://172.25.12.12/rhel7.6/
gpgcheck=0
[HighAvailability]
name=HighAvailability
baseurl=htt