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

相关推荐
你好潘先生4 分钟前
别再记命令了,用 yeero do 说句人话就能跑脚本,而且不烧 token
服务器·python·命令行
orion5712 小时前
Missing Semester Class1:course overview and introduction of shell
linux
用户1204872216118 小时前
Linux驱动编译与加载
linux·嵌入式
程序员老赵19 小时前
服务器文件不想 SFTP 上传?Docker 跑个 File Browser,浏览器就能管理
服务器·docker·开源
vivo互联网技术1 天前
从 10 分钟到 1 秒:ES 深度分页任意跳页的三轮优化实战
服务器·数据库·redis·elasticsearch·深度分页
用户805533698031 天前
Input 子系统架构:Core、Handler、Driver 三层是怎么协作的
linux·嵌入式
用户805533698031 天前
RK-Forge外设系列开篇 - 把板子从「能启动」变成「能用」:Ethernet/SPI/MMC 三个纯接线外设
linux·github·嵌入式
七歌杜金房1 天前
我终于又有了自己的 Linux 电脑
linux·debian·mac
tntxia3 天前
linux curl命令详解_curl详解
linux