直接在centos上使用redhat的
piranha 来完成负载均衡其实相对使用keepalived还要简单一些的
- serial_no = 41
-
primary = 192.168.1.200
-
service = lvs
-
backup_active = 0
-
backup = 0.0.0.0
-
heartbeat = 1
-
heartbeat_port = 539
-
keepalive = 6
-
deadtime = 18
-
network = direct
-
debug_level = NONE
-
virtual {
-
active = 1
-
address = 192.168.1.219 eth1:1
-
vip_nmask = 255.255.255.128
-
port = 80
-
send = "HEAD / HTTP/1.0\r\n\r\n"
-
expect = "HTTP/1.1 200 OK"
-
use_regex = 0
-
load_monitor = none
-
scheduler = wlc
-
protocol = tcp
-
timeout = 5
-
reentry = 15
-
quiesce_server = 0
-
server p1.test.net {
-
address = 192.168.1.191
-
active = 1
-
port = 80
-
weight = 1
-
}
-
server p2.test.net {
-
address = 192.168.1.134
-
active = 1
-
port = 80
-
weight = 1
-
}
-
}
-
virtual nginx.test.net_lvs {
-
active = 1
-
address = 192.168.1.220 eth1:2
-
vip_nmask = 255.255.255.128
-
port = 80
-
send = "GET / HTTP/1.0\r\n\r\n"
-
expect = "HTTP"
-
use_regex = 0
-
load_monitor = none
-
scheduler = wlc
-
protocol = tcp
-
timeout = 6
-
reentry = 15
-
quiesce_server = 0
-
server tb1.test.net {
-
address = 192.168.1.197
-
active = 1
-
port = 80
-
weight = 1
-
}
-
server tb2.test.net {
-
address = 192.168.1.205
-
active = 1
-
port = 80
-
weight = 1
-
}
-
}
Realserver上的配置和使用其他方式配置没有任何区别的。
阅读(945) | 评论(0) | 转发(0) |