KEEPALIVED 做LVS+HA实例安装与配置

简介: --------------------------------------master-------------------------------------------------------wget http://www.

--------------------------------------master-------------------------------------------------------
wget http://www.keepalived.org/software/keepalived-2.0.9.tar.gz
tar zxvf keepalived-2.0.9.tar.gz
cd keepalived-2.0.9
./configure --perfix=/ --mandir=/usr/local/share/man
make &&make install
cp keepalived/etc/init.d/keepalived.rh.init /etc/init.d/keepalived
chmod +x /etc/init.d/keepalived
cp keepalived/etc/init.d/keepalived.sysconfig /etc/sysconfig/keepalived
chkconfig --add keepalived
chkconfig --level 345 keepalived on

编辑

vi /etc/sysconfig/keepalived
global_defs {
notification_email {
finalsd@gmail.com
}
notification_email_from finaxx@gmail.com
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id haproxy-ha
}
vrrp_sync_group VG1 {
group {
VI1
}
}
vrrp_instance VI1 {
state BACKUP
smtp_alert
notify_fault "/root/script/notify_mail.sh fault"
notify_master "/root/script/notify_mail.sh master"
nopreempt
insterface eth1

track_interface {
eth 0
eth 1
}
virtual_router_id 51
priority 150
advert_int 1
authentication {
auth_type PASS
auth_pass abc123..
}
virtual_ipaddress {
192.168.1.1/24 dev eth1 scope global
}
}
virtual_server 192.168.1.1 80 {
delay_loop 3
lb_algo wlc #rr wrr
lb_kind DR
persistence_timeout 1200
protocol TCP
ha_suspend

real_server 192.168.1.11 80 {
weight 3
TCP_CHECK {
connect_timeout 3
connect_port 80
}
}
real_server 192.168.1.12 80 {
weight 3
TCP_CHECK {
connect_timeout 3
connect_port 80
}
}
}

service keepalived start

--------------------------------------backup-------------------------------------------------------
wget http://www.keepalived.org/software/keepalived-2.0.9.tar.gz
tar zxvf keepalived-2.0.9.tar.gz
cd keepalived-2.0.9
./configure --perfix=/ --mandir=/usr/local/share/man
make &&make install
cp keepalived/etc/init.d/keepalived.rh.init /etc/init.d/keepalived
chmod +x /etc/init.d/keepalived
cp keepalived/etc/init.d/keepalived.sysconfig /etc/sysconfig/keepalived
chkconfig --add keepalived
chkconfig --level 345 keepalived on

编辑

vi /etc/sysconfig/keepalived
global_defs {
notification_email {
finalsd@gmail.com
}
notification_email_from finaxx@gmail.com
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id haproxy-ha
}
vrrp_sync_group VG1 {
group {
VI1
}
}
vrrp_instance VI1 {
state BACKUP
smtp_alert
notify_fault "/root/script/notify_mail.sh fault"
notify_master "/root/script/notify_mail.sh master"
insterface eth1

track_interface {
eth 0
eth 1
}
virtual_router_id 51
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass abc123..
}
virtual_ipaddress {
192.168.1.1/24 dev eth1 scope global
}
}
virtual_server 192.168.1.1 80 {
delay_loop 3
lb_algo wlc #rr wrr
lb_kind DR
persistence_timeout 1200
protocol TCP
ha_suspend

real_server 192.168.1.11 80 {
weight 3
TCP_CHECK {
connect_timeout 3
connect_port 80
}
}
real_server 192.168.1.12 80 {
weight 3
TCP_CHECK {
connect_timeout 3
connect_port 80
}
}
}


相关实践学习
部署高可用架构
本场景主要介绍如何使用云服务器ECS、负载均衡SLB、云数据库RDS和数据传输服务产品来部署多可用区高可用架构。
负载均衡入门与产品使用指南
负载均衡(Server Load Balancer)是对多台云服务器进行流量分发的负载均衡服务,可以通过流量分发扩展应用系统对外的服务能力,通过消除单点故障提升应用系统的可用性。 本课程主要介绍负载均衡的相关技术以及阿里云负载均衡产品的使用方法。
目录
相关文章
|
8天前
|
运维 算法 Linux
LVS详解(四)——LVS安装与配置命令
LVS详解(四)——LVS安装与配置命令
15 2
|
5月前
|
负载均衡 应用服务中间件 Linux
Nginx系列教程(14) - LVS+KeepAlived+Nginx实现高性能负载均衡集群
Nginx系列教程(14) - LVS+KeepAlived+Nginx实现高性能负载均衡集群
175 0
|
4月前
|
负载均衡 监控 调度
Keepalived+Lvs(dr)调度器主备配置小实验
Keepalived和LVS(Linux Virtual Server)是两个常用的开源软件,通常结合使用以提供高可用性和负载均衡的解决方案。 Keepalived是一种用于实现高可用性的软件,它可以监控服务器的健康状态,并在主服务器出现故障时自动切换到备份服务器。
95 2
|
4月前
|
负载均衡 网络协议 Linux
小白带你学习linux的keepalived+lvs和keepalived双机热备(三十七)
小白带你学习linux的keepalived+lvs和keepalived双机热备(三十七)
75 0
|
5月前
|
负载均衡 算法 网络协议
Keepalived+LVS搭建高可用负载均衡
Keepalived+LVS搭建高可用负载均衡
180 1
|
7月前
|
负载均衡 监控 Linux
LVS + keepalived
LVS + keepalived
65 1
|
7月前
|
负载均衡 测试技术
LVS+KeepAlived构建高可用集群
LVS+KeepAlived构建高可用集群
54 0
|
7月前
|
缓存 负载均衡 网络协议
LVS+KeepAlived快速入门2
LVS+KeepAlived快速入门2
91 0
|
7月前
|
负载均衡 算法 网络协议
LVS+KeepAlived快速入门1
LVS+KeepAlived快速入门2
70 0
|
7月前
|
域名解析 负载均衡 网络协议
keepalived+vip+lvs高可用负载均衡服务演化
keepalived+vip+lvs高可用负载均衡服务演化
317 0