Redhat7 PCS建立无共享存储浮动地址集群

发布于:2025-02-11 ⋅ 阅读:(45) ⋅ 点赞:(0)

更新记录

日期 版本号 内容
9/22/2024 Ver 1.0 重新排版修正

0写在前面

0.1 简述

  1. 时间有限使用VMware6.7环境
  2. 使用Centos7.8最小化安装方式(不用配置本地yum仓库)
  3. 注意查看主机名(主机双机操作,部分单机操作)
序号 Host IPAddr Application
1 PCS01 10.10.10.216
2 PCS02 10.10.10.217
3 Virtual IP 10.10.10.215

1. 预先配置部分

1.1. 预先安装程序

dnf install gzip nano  tcpdump -y

gzip:用于导入模板库

nano:编辑软件

tcpdump:数据包抓包

2. 防火墙配置

2.1 主机名/防火墙/selinux配置

PCS01 PCS02同样配置

#关闭防火墙
systemctl disable --now firewalld

#selinux配置更改
sed -i "s/enforcing/disabled/g" /etc/selinux/config

#验证selinux配置
grep disabled /etc/selinux/config  -n

#修改主机名
hostnamectl set-hostname pcs01



#重启生效
reboot

2.2 配置防火墙允许集群组件通过(可选)

如需安全要求

PCS01 PCS02同样配置

#开启并自启防火墙
systemctl start firewalld && systemctl enable firewalld

firewall-cmd --permanent --add-service=high-availability 
firewall-cmd --permanent --add-service=ntp 
firewall-cmd --reload 

3. PCS集群构建

3.1安装pacemaker配置工具

PCS01 PCS02同样配置

 yum install -y pacemaker corosync pcs psmisc policycoreutils-python fence-agents-all 
 rpm -qi fence-agents-all

3.2 NTP时钟和解析配置

PCS01以微软"Time"为NTP服务器,

PCS02以"PCS01"为NTP服务器,

如内网环境见 NTP时间服务器 的文章

## PCS01 配置
yum install -y ntp
ntpdate time.windows.com
nano /etc/ntp.conf

crontab -e
*/30 * * * * /sbin/ntpdate time.windows.com &> /dev/null


post-83-63c62b9dad84a

post-83-63c62b9d93195

## PCS02 配置
yum install -y ntp
nano /etc/ntp.conf

crontab -e
*/30 * * * * /sbin/ntpdate time.windows.com &> /dev/null

post-83-63c62b9e2acae

post-83-63c62b9dc4c4a