- 論壇徽章:
- 0
|
各位好,因?yàn)樽罱捻?xiàng)目,LVS的服務(wù)器基本搭完了,多虧壇子里面的各位熱心幫忙。
現(xiàn)在出現(xiàn)了個(gè)小問題,是關(guān)于LVS備份機(jī)和,真實(shí)機(jī)的健康檢查的。
我是用的Keepalived,之前我配置的單獨(dú)監(jiān)控80網(wǎng)站或者3306數(shù)據(jù)庫的時(shí)候都可以做到負(fù)載均衡,
但是把這倆和起來的時(shí)候卻哪個(gè)都不行了,到底是哪里出了問題呢。誰能給我個(gè)建議么?
以下是我的配置文件
# Configuration File for keepalived
global_defs {
notification_email {
xxxxxxx
}
notification_email_from xxxxxxx
smtp_server xxxxxxxx
smtp_connect_timeout 30
lvs_id LVS_ONE
}
vrrp_sync_group VG1 {
VI_1
}
vrrp_sync_group VG2 {
VI_2
}
vrrp_instance VI_1 {
state MASTER
interface eth0
lvs_sync_daemon_interface eth0
virtual_router_id 1
priority 101
advert_int 1
authentication {
auth_type PASS
auth_pass mysqlcluster
}
virtual_ipaddress {
192.168.1.124
}
}
vrrp_instance VI_2 {
state MASTER
interface eth0
lvs_sync_daemon_interface eth0
virtual_router_id 2
priority 101
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
192.168.1.123
}
}
virtual_server 192.168.1.124 3306 { (此處定義負(fù)載均衡部分,使用DR方式)
delay_loop 6
lvs_sched wlc
lvs_method DR
persistence_timeout 60
ha_suspend
protocol TCP
real_server 192.168.1.36 3306 {
weight 1
TCP_CHECK {
connect_timeout 10
}
}
real_server 192.168.1.245 3306 {
weight 1
TCP_CHECK {
connect_timeout 10
}
}
real_server 192.168.1.37 3306 {
weight 1
TCP_CHECK {
connect_timeout 10
}
}
}
virtual_server 192.168.1.123 80 {
delay_loop 6
lvs_sched wlc
lvs_method DR
persistence_timeout 60
ha_suspend
protocol TCP
real_server 192.168.1.237 80 {
weight 1
TCP_CHECK {
connect_timeout 10
}
}
real_server 192.168.1.245 80 {
weight 1
TCP_CHECK {
connect_timeout 10
}
}
} |
|