[web-server-1]
主机名 = host-1
系统 = centos-7.3
地址 = 192.168.2.37
软件 = keepaliveed-1.3.5
httpd-2.4
[web-server-2]
主机名 = host-1
系统 = centos-7.3
地址 = 192.168.2.149
软件 = keepaliveed-1.3.5
httpd-2.4
(机器均操作)
1.安装keepavlied
yum install keepalived -y
#文件
/etc/keepalived/keepalived.conf #keepalived服务主配置文件
/etc/rc.d/init.d/keepalived #服务启动脚本
/etc/sysconfig/keepalived
/usr/bin/genhash
/usr/libexec/keepalived
/usr/sbin/keepalived
2.部署httpd(举例)
yum -y install httpd
systemctl start httpd
3.测试验证,看返回是否对应
(host-1操作)
echo "37" >> /var/ww/html/index.html
curl http://192.168.2.37
(host-2操作)
echo "149" >> /var/ww/html/index.html
curl http://192.168.2.149
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。