Keepalived实验环境设定

1.环境设定图(示例)

2.环境设定

#部署rs1和rh2(单网卡NAT模式)

root@rs1 \~# vmset.sh eth0 xxx.xx.xx.xx rs1

root@rs1 \~# dnf install httpd -y

root@rs1 \~# echo RS1 - xxx.xx.xx.xx > /var/www/html/index.html

root@rs1 \~# systemctl enable --now httpd

rrss1

rrss2

#测试:

#设定ka1和ka2

root@KA1 \~# vmset.sh eth0 xx.xx.xx.xx KA1

root@KA2 \~# vmset.sh eth0 xx.xx.xx.xx KA2

#设定本地解析

root@KA1 \~# vim /etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4

::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

xx.xx.xx.xx KA1

xx.xx.xx.xx KA2

xx.xx.xx.xx rrss1

xx.xx.xx.xx rrss2

root@KA1 \~# for i in 60 10 20

> do

> scp /etc/hosts xx.xx.xx.xx.$i:/etc/hosts

> done

#在其他主机中查看/etc/hosts

#在ka1中开启时间同步服务

root@KA1 \~# vim /etc/chrony.conf

26 allow 0.0.0.0/0

29 local stratum 10

root@KA1 \~# systemctl restart chronyd

root@KA1 \~# systemctl enable --now chronyd

#在ka2中使用ka1的时间同步服务

root@KA2 \~# vim /etc/chrony.conf

pool 192.168.186.50 iburst

root@KA2 \~# systemctl restart chronyd

root@KA2 \~# systemctl enable --now chronyd

root@KA2 \~# chronyc sources -v

相关推荐
Yana.nice3 小时前
Linux 只保留 30 天内日志(find命令删除日志文件)
linux·运维·chrome
andxe5 小时前
安科士 AndXe 技术博客:400G QSFP112 SR4 光模块|AI 算力与超算短距互联最优方案
网络·人工智能·光模块·光通信
shiyi.十一6 小时前
第2章:应用层 — 知识要点与架构
网络·计算机网络·架构
吳所畏惧6 小时前
宝塔面板Redis密码修改指南:SSH命令修改 vs 面板UI界面修改,哪个更靠谱?
运维·服务器·数据库·redis·缓存·ssh
DFT计算杂谈6 小时前
无 Root 权限在 Tesla K80 零门槛部署 DeepSeek 大模型
linux·服务器·网络·数据库·机器学习
水境传感 李兆栋6 小时前
GNSS 位移监测站 :毫米级感知,筑牢安全监测防线
网络
维天说7 小时前
CLI-Switch 2026年3月版历史设计:Hook、TTY 隔离与 JSON 状态
java·服务器·json
Zhang~Ling7 小时前
从 fopen 到 struct file:从零开始拆解 Linux 文件 I/O
linux·运维·服务器
DeeplyMind8 小时前
Linux 深入 per-VMA lock:Linux 缺页路径如何摆脱 mmap_lock
linux·per-vma lock
爱写代码的阿森8 小时前
鸿蒙三方库 | harmony-utils之PreferencesUtil首选项数据监听详解
服务器·华为·harmonyos·鸿蒙·huawei