piranha配置

典型的高可用负载均衡
1)lvs + ldirectord + heartbeat
lvs(ipvsadmin) 调度器,将用户请求分发到后端真实服务器,不负责健康检查
ldirectord 服务监控,真实服务器的服务异常,将其从lvs节点表中去除,恢复后添加
heartbeat 高可用,监控lvs节点是否正常,控制vip飘移

2) lvs + keepalived
lvs
keepalived

3) piranha

yum -y install piranha

dr /etc/sysctl.conf

net.ipv4.ip_forward = 1

realserver /etc/sysctl.conf

net.ipv4.conf.lo.arp_ignore = 1
net.ipv4.conf.lo.arp_announce = 2
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2 

sysctl -p

/etc/sysconfig/ha/lvs.cf

service = lvs
primary = 10.10.100.12
backup = 10.10.100.13
backup_active = 1
heartbeat = 1
heartbeat_port = 1050
keepalive = 6
deadtime = 10
debug_level = NONE

network = direct

virtual web-80 {
       address = 10.10.100.11 em2:0
       vip_nmask = 255.255.255.255
       fwmark = 100
       active = 1
       load_monitor = uptime
       timeout = 5
       reentry = 10
       port = http
       send = "GET / HTTP/1.0\r\n\r\n"
       expect = "HTTP"
       scheduler = sh
       persistent = 300
       pmask = 255.255.255.255
       protocol = tcp

       server srv01 {
               address = 10.10.100.12
               active = 1
               weight = 10
       }

       server srv02 {
               address = 10.10.100.13
               active = 1
               weight = 10000
       }
}

/etc/sysconfig/network-scripts/ifcfg-lo:0

DEVICE=lo:0
IPADDR=10.10.100.11
NETMASK=255.255.255.255
ONBOOT=yes

/etc/sysconfig/network-scripts/route-lo:0

10.10.100.11/32 dev lo:0

http://www.gossamer-threads.com/lists/lvs/users/24231
http://www.ultramonkey.org/2.0.1/topologies/sl-ha-lb-eg.html

posted on 2014-10-24 11:01 北京涛子 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/liujitao79/p/4047766.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值