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

相关推荐
发疯的技术鼠35 分钟前
03-优先级与调度
linux
manduic1 小时前
汽车座舱Buck选型实战:AWK6613 对比 SCT2432,参数逐项对齐(附选型清单)
网络·汽车
无足鸟ICT2 小时前
【RHCA+】sosreport(收集诊断文档)
linux·运维·服务器
GeW3 小时前
世界目光聚焦中国:底层技术、Linux、数据库的破局逻辑
linux·数据库
星恒随风4 小时前
MySQL 从零入门(十):MVCC、Undo Log 与 Read View 详解——InnoDB 如何实现事务隔离?
linux·数据库·笔记·sql·mysql
瑞雪兆丰年兮5 小时前
Linux零基础快速入门-第二章 Linux基础命令
linux·运维·服务器
通信王666 小时前
NBIOT NTN协议整理-TS36.211
网络
咋的啥名都用不了呢~8 小时前
Linux项目部署6(安装Elasticsearch)
linux
光电笑映8 小时前
TCP 为什么可靠?从三次握手、滑动窗口到拥塞控制全面拆解(上)
运维·服务器·网络·udp
飞奔的瓜牛8 小时前
Linux 下使用 OpenSSL 生成自签名证书完整指南
运维·服务器·nginx