keepalived03:資源搶占問題
01
Keepalived構建高可用服務器,有MASTER,BACKUP之分,在MASTER主機宕掉之後,BACKUP主機會接替
02
所有的任務,但是當MASTER主機修復後,會搶占資源,這樣就是不必要的切換
03
如何讓MASTER恢復後不搶占BACKUP的資源:將兩個主機均設置成BACKUP,因為不搶占只支持BACKUP模式
04
那個成為MASTER,靠優先級決定
05
! Configuration File for keepalived
06
07
global_defs {
08
notification_email {
09
[email protected]
10
}
11
notification_email_from keepalived@localhost
12
smtp_server 127.0.0.1
13
smtp_connect_timeout 30
14
router_id LVS_DEVEL
15
}
16
vrrp_sync_group VGM {
17
group {
18
VI_1
19
}
20
}
21
vrrp_script chk_http_port {
22
script "killall -0 httpd"
23
interval 1
24
}
25
vrrp_instance VI_1 {
26
state BACKUP #BACKUP
27
interface eth0
28
virtual_router_id 51
29
priority 50 #50
30
advert_int 1
31
authentication {
32
auth_type PASS
33
auth_pass westos
34
}
35
track_interface {
36
eth0
37
eth1
38
}
39
virtual_ipaddress {
40
192.168.0.150/24 dev eth0
41
10.0.0.150/24 dev eth1
42
}
43
track_script {
44
chk_http_port
45
}
46
47
}