LVS+keepalived的配置只能访问一个realserver

piaopiao11 2016-11-04 06:17:50
如题


贴上我的keepalive的配置文件
! Configuration File for keepalived

global_defs {
notification_email {
test@gmail.com
}
notification_email_from root@localhost
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id LVS_1
}

vrrp_instance LVS_HA {
state MASTER
interface bond0
virtual_router_id 60
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
192.168.53.251
}
}

virtual_server 192.168.53.251 80 {
delay_loop 6
lb_algo rr
lb_kind DR
nat_mask 255.255.255.0
persistence_timeout 5
protocol TCP

real_server 192.168.53.237 80 {
weight 1
TCP_CHECK {

delay_before_retry 3
connect_timeout 20
connect_port 80
#nb_get_retry 3
retry 3
}
}

real_server 192.168.53.236 80 {
weight 1
TCP_CHECK {

delay_before_retry 3
connect_timeout 20
connect_port 80
#nb_get_retry 3
retry 3
}
}
}



为什么每次只能访问236 或者237呢,当能访问236的时候,我用多个客户端,多次请求每次都是236,于是我吧236这台的http服务停掉,他就访问不了了,这不应该啊。同理有时访问是237的时候也一样,停掉了237就访问不了了,请高手指点指点
...全文
1046 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复

18,773

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 专题技术讨论区
社区管理员
  • 专题技术讨论区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧