1.环境
1.1 平台概念
★SUSE Linux Enterprise Server 12 SP5 x86_6
★SUSE Linux Enterprise High Availability Extension 12 SP5
★cLVM存储架构+OCFS2文件系统架构
1.2 软件仓储需求
# zypper mr -da
# zypper ar http://192.168.55.131/repo/SUSE/Products/SLE-SERVER/12-SP5/x86_64/product/ OsPool
# zypper ar http://192.168.55.131/repo/SUSE/Products/SLE-HA/12-SP5/x86_64/product/ HAPool
# zypper ar -f http://192.168.55.131/repo/SUSE/Updates/SLE-SERVER/12-SP5/x86_64/update/ OsUpdate
# zypper ar -f http://192.168.55.131/repo/SUSE/Updates/SLE-HA/12-SP5/x86_64/update/ HAUpdate
# zypper ref
# zypper dup
1.3 网络架构
1.4 配置Hosts
# vim /etc/hosts
192.168.55.51 ha1
192.168.55.52 ha2
192.168.55.53 vip
1.5 NTP时钟同步
# echo "server 192.168.55.131 iburst" >> /etc/ntp.conf
# systemctl enable ntpd.service
# systemctl start ntpd.service
# ntpq -p
1.6 存储信息
2. 部署HA
2.1 系统升级及安装HA软件
# zypper dup
# zypper -n in --auto-agree-with-licenses -t pattern ha_sles
// 重启系统
# reboot
2.2 配置心跳网络
# yast cluster
//将生成的心跳配置文件,传输到其他节点
# scp /etc/corosync/corosync.conf ha2:/etc/corosync/
2.3 配置sbd屏蔽磁盘
A. 设置检查包
# echo softdog > /etc/modules-load.d/watchdog.conf
# systemctl restart systemd-modules-load
# systemctl status systemd-modules-load
# lsmod | grep dog
B. 创建sbd磁盘
# sbd -d /dev/sdb -d /dev/sdc -d /dev/sdd -1 15 -4 30 create
# sbd -d /dev/sdb -d /dev/sdc -d /dev/sdd dump
C. 修改sbd配置文件
# vim /etc/sysconfig/sbd
SBD_DEVICE="/dev/xx;/dev/xx;/dev/xx"
SBD_DELAY_START=no
D. 启动sbd守护进程
# systemctl enable sbd
2.4 启动集群
# rcpacemaker start
或
# systemctl start pacemaker.service
# com_mon -1
2.5 集群全局设置
# crm configure
2.6 设置SBD资源
# crm configure
2.7 节点cLVM先决条件
#vim /etc/lvm/lvm.conf
locking_type= 3
use_lvmetad= 0
2.8 配置DLM和CLVMD资源
# crm configure
2.9 创建cLVM存储卷
# pvcreate /dev/sde
# vgcreate -cy vgdemo /dev/sde
# lvcreate -l 100%FREE -n lvdemo vgdemo
2.10 OCFS2文件系统资源
# mkdir /opt/demo
# mkfs.ocfs2 /dev/vgdemo/lvdemo
# crm configure
# crm_mon -1
# crm_mon -1n