本環境基於centos7部署,基本架構圖:
部署流程:
lvs1:
# yum install ipvsadm
# ipvsadm #檢視是否輸出安裝成功
# yum install keepalived
# vim /etc/keepalived/keepalived.conf
global_defs
notification_email_from ***@qq.com
smtp_server smtp.qq.com
smtp_connect_timeout 30
router_id lvs1
}vrrp_instance vi_1
virtual_ipaddress
}virtual_server 192.168.1.10 80
}weight 1
tcp_check }}
# vim /etc/sysctl.conf #開啟路由**
net.ipv4.ip_forward= 1
# sysctl -p
# service keepalived start
lvs2配置跟lvs大致相同
# vim /etc/keepalived/keepalived.conf
state backup
#service keepalived start
後端web伺服器使用nginx即可
瀏覽器請求
#ipvsadm -l #檢視排程資訊
lvs keepalived多例項部署
多例項部署就是就是在一台ds上搭建多個vip,為多個集群進行排程工作 這裡我用1臺ds部署2個vip,同時搭建以備ds yum y install keepalived主ds vim etc keepalived keepalived.conf修改配置檔案 configuration file fo...
安裝lVS keepalived心得
接著昨天蛋疼地無網裝keepalived,今天又在裝lvs。首先按照網上的教程做 這裡就說自己遇到的問題,第乙個是找不到 usr src kernels下的核心檔案。要先rpm kernel devel才會有。其次,用ln s 軟鏈結一直鏈不上去,可以在安裝keepalived的 configure...
LVS Keepalived負載均衡配置
lvs一般是和keepalived一起組合使用的,雖然也可以單獨使用lvs,但配置比較繁瑣,且可用性也沒有前者高。lvs和keepalived組合使用後,配置lvs的vip和負載均衡就都在keepalived中進行配置,只是在keepalived中呼叫lvs 配置 keepalived.conf g...