背景:
(1)vim /usr/local/etc/keepalived/keepalived.conf
(2)keepalived基本安装即可完成,启动测试之:
service keepalived restart
来自:
http://www.cnblogs.com/littlehb/archive/2012/12/13/2816652.html
lb_algo 实现keepalive,
这块的参数在如果进行多个memcache进行连接时很重要:
LVS的10个调度算法 :
keepalived 配置有个 lb_algo的参数,参照下面的文章设置 http://chqz1987.blog.163.com/blog/static/51438311201272804410941/
virtual_server 61.164.122.8 80 {
delay_loop 6 #(每隔10秒查询realserver状态)
lb_algo wrr #(lvs 算法)
lb_kind DR #(Direct Route)
persistence_timeout 60 #(同一IP的连接60秒内被分配到同一台realserver)
protocol TCP #(用TCP协议检查realserver状态)
real_server 61.164.122.9 80 {
weight 3 #(权重)
TCP_CHECK {
connect_timeout 10 #(10秒无响应超时)
nb_get_retry 3
delay_before_retry 3
connect_port 80
}
}
real_server 61.164.122.10 80 {
weight 3
TCP_CHECK {
connect_timeout 10
nb_get_retry 3
delay_before_retry 3
connect_port 80
}
}
}
(1)vim /usr/local/etc/keepalived/keepalived.conf
(2)keepalived基本安装即可完成,启动测试之:
service keepalived restart
来自:
http://www.cnblogs.com/littlehb/archive/2012/12/13/2816652.html
lb_algo 实现keepalive,
这块的参数在如果进行多个memcache进行连接时很重要:
LVS的10个调度算法 :
keepalived 配置有个 lb_algo的参数,参照下面的文章设置 http://chqz1987.blog.163.com/blog/static/51438311201272804410941/
virtual_server 61.164.122.8 80 {
delay_loop 6 #(每隔10秒查询realserver状态)
lb_algo wrr #(lvs 算法)
lb_kind DR #(Direct Route)
persistence_timeout 60 #(同一IP的连接60秒内被分配到同一台realserver)
protocol TCP #(用TCP协议检查realserver状态)
real_server 61.164.122.9 80 {
weight 3 #(权重)
TCP_CHECK {
connect_timeout 10 #(10秒无响应超时)
nb_get_retry 3
delay_before_retry 3
connect_port 80
}
}
real_server 61.164.122.10 80 {
weight 3
TCP_CHECK {
connect_timeout 10
nb_get_retry 3
delay_before_retry 3
connect_port 80
}
}
}
作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:http://jackxiang.com/post/6879/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!
最后编辑: jackxiang 编辑于2014-8-14 16:12
评论列表