Re: [Keepalived-devel] vrrp_script doesn't seem to work
Status: Beta
Brought to you by:
acassen
|
From: Vonlanthen, E. <Elm...@un...> - 2009-03-24 07:06:16
|
Hello,
I see, that on machine 2 the vrrp-script is not defined. So machine 1
has a priority of 121 if everything is ok and machine 2 has a priority
of 100.
If the server on machine 1 isn't listening anymore on port 80 the prio
would be 101. But this value is still higher then the prio of machine 2.
(but the configuration with "weight -2" should work)
I think that is the problem. But I am not expert.
Best regards
Elmar
________________________________
From: YungWei.Chen [mailto:Yun...@re...]
Sent: Tuesday, March 24, 2009 3:01 AM
To: kee...@li...
Subject: [Keepalived-devel] vrrp_script doesn't seem to work
Hi,
I am trying to configure keepalived on 2 machines using
keepalived 1.1.13 so that if one goes down, the other will take over.
This part seems to work fine.
Now I want to further specify that if port 80 on machine 1
is no longer being listened, its priority will be reduced so that
machine 2 can take over.
I did that by introducing vrrp_script block into the conf
file on machine 1 as shown below, but it doesn't seem to work. Any idea
why it doesn't work? Thanks.
Here's the keepalived.conf on machine 1.
! Configuration File for keepalived
global_defs {
notification_email {
web...@xx...
}
notification_email_from mac...@xx...
smtp_server 127.0.0.1
smtp_connect_timeout 30
}
vrrp_script chk_http_port {
script "</dev/tcp/127.0.0.1/80"
interval 2
!weight -5
}
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 51
priority 101
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
192.168.12.33
}
track_script {
chk_http_port weight 20
}
}
Here's the keepalived.conf on machine 2.
! Configuration File for keepalived
global_defs {
notification_email {
web...@xx...
}
notification_email_from mac...@xx...
smtp_server 127.0.0.1
smtp_connect_timeout 30
}
vrrp_instance VI_1 {
state BACKUP
interface eth0
virtual_router_id 51
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
smtp_alert
virtual_ipaddress {
192.168.12.33
}
}
|