keepalived實現LVS的高可用性

2021-10-23 23:14:22 字數 1353 閱讀 6726

192.168.31.169 cip 代表客戶機

192.168.31.170 代表路由裝置外網位址

192.168.160.136 代表路由裝置內網位址

10.0.0.200 代表路由器在內網被vip指向外網的位址

170和136用裝置模擬路由器效果

192.168.160.140 rip 代表http伺服器

192.168.160.150 rip 代表http伺服器

192.168.160.160 dip 代表lvs裝置內網位址

192.168.160.170 dip 代表lvs裝置內網位址

192.168.160.200 vip 代表lvs裝置外網位址

vim keepalived.conf

! configuration file for keepalived

global_defs

notification_email_from keepalived@localhost

smtp_server 127.0.0.1

smtp_connect_timeout 30

router_id ka1

vrrp_mcast_group4 224.100.100.100

}vrrp_instance vi_1

virtual_ipaddress

notify_master "/etc/keepalived/notify.sh master"

notify_backup "/etc/keepalived/notify.sh backup"

notify_fault "/etc/keepalived/notify.sh fault"

}vrrp_instance vi_2

virtual_ipaddress

notify_master "/etc/keepalived/notify.sh master"

notify_backup "/etc/keepalived/notify.sh backup"

notify_fault "/etc/keepalived/notify.sh fault"

}

virtual_server 192.168.160.200 80 

connect_timeout 3

nb_get_retry 3

delay_before_retry 3

}} real_server 192.168.160.150 80

connect_timeout 3

nb_get_retry 3

delay_before_retry 3

}}}

通過keepalived搭建LVS高可用集群

通過keepalived搭建lvs高可用集群 實驗環境 主director server 192.168.163.3 備director server 192.168.163.4 real server1 192.168.163.5 real server2 192.168.163.6 vip 19...

LVS和keepalived高可用集群部署

keepalived採用vrrp熱備份協議實現linux伺服器的多機熱備功能 vrrp 虛擬路由冗餘協議 是針對路由器的一種備份解決方案 modprobe ip vs 載入ip vs模組 rpm ivh mnt packages ipvsadm 1.27 7.el7.x86 64.rpm 安裝管理軟...

Keepalived 實現高可用

對於主負載均衡伺服器,修改配置檔案 vim etc keepalived keepalived.conf configuration file for keepalived global defs vrrp instance vi 1 virtual ipaddress 備用負載均衡伺服器 vim ...