环境规划
配置说明
- Client的网关指向 192.168.1.4
- RS,keepalived 网关指向 192.168.43.17
- RS上安装 httpd服务,RS1,RS2的vip为 192.168.43.100,RS3,RS4的vip为 192.168.43.200
- keepalived服务器上安装 keepalived服务,配置两个vip,192.168.43.100,192.168.43.200
- 路由器上开启路由转发的功能
keepalived 配置
安装keepalived软件包
yum install keepalived -y
配置文件
vim /etc/keepalived/keepalived.conf
! Configuration File for keepalived
global_defs {
notification_email {
root@localhost
}
notification_email_from keepalived@localhost
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id keepalived-01 // keepalived-02
vrrp_m