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

相关推荐
AlanBruce3 小时前
摩尔信使MThings功能综述与应用使用指南
linux·自动化·plc·mthings·摩尔信使
虹科网络安全4 小时前
Redis 安全公告:CVE-2026-81934 TLS 处理漏洞及修复建议
网络·人工智能·网络安全
小程序设计5 小时前
某师范学院网络规划与设计
网络·安全
可爱系程序猿6 小时前
WSD 打印机时好时坏:从发现服务、地址变化到 Standard TCP/IP 端口的迁移记录
网络·网络协议·tcp/ip·程序人生·电脑
陈陈CHENCHEN7 小时前
【Linux】服务器根目录磁盘扩容操作记录
linux·运维·服务器
蓝速科技8 小时前
便民服务大厅 AI 数字人一体机场景适配与落地指南丨蓝速科技
大数据·网络·数据结构·人工智能·自然语言处理·数据分析·运维开发
GeW8 小时前
RHCE快速拿证全攻略:考点拆解+实验强化+时间规划,一次通关
linux
沸速存储9 小时前
AI 机器人靠哪些内存与存储驱动整机运行?
服务器·科技·嵌入式硬件·电脑
济南凡维9 小时前
CODESOFT中如何将标签保存为PDF文件
网络·人工智能·打印机·codesoft
码农小韩9 小时前
Linux应用开发(八)——TCP/IP网络编程基础
linux·嵌入式软件开发·linux操作系统·嵌入式操作系统·linux网络编程·linux应用