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 ![](https://i-blog.csdnimg.cn/direct/aad634ca7931429ca6ccfd9d35824e12.png) ![](https://i-blog.csdnimg.cn/direct/9dedd372e4e546dd9b849e45c441f3b8.png) rrss2 ![](https://i-blog.csdnimg.cn/direct/c537f14291994bc6b283a3cd3cec42ec.png) ![](https://i-blog.csdnimg.cn/direct/4191e0c316074df4bda5e31e74eb7b4e.png) #测试: ![](https://i-blog.csdnimg.cn/direct/02a198935b324980b94d441d89f2465a.png) ![](https://i-blog.csdnimg.cn/direct/f5d0a7fffb94473bbb2fe6210bba8680.png) #设定ka1和ka2 \[root@KA1 \~\]# vmset.sh eth0 xx.xx.xx.xx KA1 \[root@KA2 \~\]# vmset.sh eth0 xx.xx.xx.xx KA2 ![](https://i-blog.csdnimg.cn/direct/4108a478b96d4b1c9cec296dc1346eb1.png) ![](https://i-blog.csdnimg.cn/direct/fcd90268eff74b689f08082edf04fc9e.png) #设定本地解析 \[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 ![](https://i-blog.csdnimg.cn/direct/29e5c6fc2dc14b6896a4b380ce0998b7.png) \[root@KA1 \~\]# for i in 60 10 20 \> do \> scp /etc/hosts xx.xx.xx.xx.$i:/etc/hosts \> done ![](https://i-blog.csdnimg.cn/direct/6aa24ceef15940acae0c1423a74f96b7.png) #在其他主机中查看/etc/hosts ![](https://i-blog.csdnimg.cn/direct/0f8627b177764e4a99ef0c0508b18b52.png) #在ka1中开启时间同步服务 \[root@KA1 \~\]# vim /etc/chrony.conf 26 allow 0.0.0.0/0 29 local stratum 10 ![](https://i-blog.csdnimg.cn/direct/26a4034e4f924543bceeeaadbce50c93.png) \[root@KA1 \~\]# systemctl restart chronyd \[root@KA1 \~\]# systemctl enable --now chronyd ![](https://i-blog.csdnimg.cn/direct/ec4b58f444db44ea9b7432d5fe35155c.png) #在ka2中使用ka1的时间同步服务 \[root@KA2 \~\]# vim /etc/chrony.conf pool 192.168.186.50 iburst ![](https://i-blog.csdnimg.cn/direct/174100e858c14d978033e9b09e771260.png) \[root@KA2 \~\]# systemctl restart chronyd \[root@KA2 \~\]# systemctl enable --now chronyd ![](https://i-blog.csdnimg.cn/direct/96bb61d6bca64e36b320a6b314b50416.png) \[root@KA2 \~\]# chronyc sources -v ![](https://i-blog.csdnimg.cn/direct/3a1c3db05c3f4780b6d59825baae7570.png)

相关推荐
杜子不疼.1 小时前
UU云电脑深度测评:高性价比游戏云电脑,办公版本即将推出
服务器·游戏·电脑
huohaiyu1 小时前
从URL到页面的完整解析流程
前端·网络·chrome·url
袁袁袁袁满4 小时前
Linux云服务器如何判断系统是否发生过异常断电?
linux·运维·服务器
winfreedoms4 小时前
Puppypi——hiwonder-toolbox中配置文件解析
网络·智能路由器
学不完的4 小时前
haproxy
linux·运维·https·负载均衡·haproxy
LCG元4 小时前
STM32MP1边缘网关:Linux系统下Modbus转MQTT协议转换实战
linux·stm32·嵌入式硬件
cyber_两只龙宝5 小时前
Nginx--企业高性能web服务器高级配置详解
linux·运维·nginx·云原生
Elastic 中国社区官方博客6 小时前
使用 Elastic 进行网络监控:统一网络可观测性
大数据·开发语言·网络·人工智能·elasticsearch·搜索引擎·全文检索
如若1237 小时前
AutoDL云服务器 NVIDIA 570驱动 EGL渲染修复全记录
运维·服务器·python
i建模7 小时前
Omarchy设置防火墙
linux·运维