(1)实践的硬件环境准备
准备4台物理服务器或者4台VM虚拟机,其中两台用来做Keepalived服务器,两台做web测试站点
HOSTNAME | I P | 解 释 |
lb01 | 10.0.0.7 | Keepalived主服务器(Nginx主负载均衡器) |
lb02 | 10.0.0.8 | Keepalived备服务器(Nginx备负载均衡器) |
web01 | 10.0.0.9 | web01服务器 |
web02 | 10.0.0.10 | web02服务器 |
(2)开始安装Keepalived软件
#yum install Keepalived -y
#rpm -qa Keepalived
(注意:上面安装过程需要在lb01和lb02两台服务器同时安装)
(3)启动Keepalived服务并检查
启动及检查Keepalived服务命令如下:
#/ect/init.d/Keepalived start
#ps -ef | grep Keep | grep -v grep