LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   vrrp_script not working (https://www.linuxquestions.org/questions/linux-newbie-8/vrrp_script-not-working-895012/)

sgm277 08-02-2011 12:14 AM

vrrp_script not working
 
hello, I set tup a sample HA system using keepalived vrrp_script,but I want the vrrp_script is not working when I shutdown the mysql process,and not log found in /var/log/message related to vrrp_script, the version of keepalived I used is 1.2.2 and I also try 1.2.1,but both failed.

I am googling for long time but still don'g get any solution.

Had anybody encounted the same issue with me?
Thanks in advance.
Below is my keepalived.cfg
keepalived.conf

vrrp_script check_mysqld {
script "killall -0 mysqld"
interval 2
weight 4
}
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 51
priority 100
advert_int 1
virtual_ipaddress {
192.168.100.100
}
track_script{
check_mysqld
}

kbp 08-02-2011 07:59 PM

What does the backup nodes config look like ?

<edit> found an example HA mysqld config, there is a lot more detail there than you may have thought of </edit>

sgm277 08-03-2011 04:29 AM

Hello kbp,

mysql slave configure is:

vrrp_script check_mysqld {
script "killall -0 mysqld"
interval 2
weight 4
}
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 51
priority 99
advert_int 1
virtual_ipaddress {
192.168.100.100
}
track_script{
check_mysqld
}

kbp 08-03-2011 06:10 AM

I just noticed you're missing a closing '}' on both scripts at the end, if you lay it out with proper indentation it will be easier to notice these kinds of mistakes

Eg.
Code:

vrrp_script check_mysqld {
    script "killall -0 mysqld"
    interval 2
    weight 4
}
vrrp_instance VI_1 {
    state MASTER
    interface eth0
    virtual_router_id 51
    priority 99
    advert_int 1
    virtual_ipaddress {
        192.168.100.100
    }
    track_script{
        check_mysqld
    }
}


sgm277 08-04-2011 04:13 AM

Sorry I missed one }, this is not the root cause, I had successfully used the vrrp_script function on Ubuntu box,I don't know why it is not working on CentOs X86_64 system.
I used keepalived -f /usr/local/etc/keepalived.conf --dont-fork --log-console --log-detail to try to troubleshut the issue but unfortunately I got the same log as /var/log/message,no valuable information found.


All times are GMT -5. The time now is 03:50 PM.