Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1494005
  • 博文数量: 408
  • 博客积分: 10036
  • 博客等级: 上将
  • 技术积分: 4440
  • 用 户 组: 普通用户
  • 注册时间: 2006-04-06 13:57
文章分类

全部博文(408)

文章存档

2011年(1)

2010年(2)

2009年(1)

2008年(3)

2007年(7)

2006年(394)

我的朋友

分类: LINUX

2006-07-13 10:45:53

 
Webme09.cublog.cn
google

The Keepalived Solution

provides a strong and robust health checking for LVS clusters. It implements a framework of health checking on multiple layers for server failover, and VRRPv2 stack to handle director failover.

Configuation example

Now we're going to using keepalived to contruct a highly-available VS/NAT web cluster with two load balancers and three web servers. The topology is illustrated in the following figure. In the example, virtual IP address and gateway IP address are 10.23.8.80 and 172.18.1.254, which are floating between the two load balancers (LD1 and LD2), and the ip addresses of three real servers are 172.18.1.11, 172.18.1.12 and 172.18.1.11 respectively.

In our example, the keepalived configuration file (/etc/keepalived/keepalived.conf) at the LD1 looks like:

vrrp_sync_group VG1 {
group {
VI_1
VI_2
}
}

vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 51
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
10.23.8.80
}
}

vrrp_instance VI_2 {
state MASTER
interface eth1
virtual_router_id 51
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
172.18.1.254
}
}

virtual_server 10.23.8.80 80 {
delay_loop 6
lb_algo wlc
lb_kind NAT
persistence_timeout 600
protocol TCP

real_server 172.18.1.11 80 {
weight 100
TCP_CHECK {
connect_timeout 3
}
}
real_server 172.18.1.12 80 {
weight 100
TCP_CHECK {
connect_timeout 3
}
}
real_server 172.18.1.13 80 {
weight 100
TCP_CHECK {
connect_timeout 3
}
}
}

The Keepalived configuration file at LD2 is similar to that of LD1, except to change the state of VI_1 and VI_2 from MASTER to BACKUP.

 
Webme09.cublog.cn
google
阅读(1360) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~