码迷,mamicode.com
首页 > 其他好文 > 详细

keepalived高可用双主配置文件

时间:2018-06-05 00:42:42      阅读:127      评论:0      收藏:0      [点我收藏+]

标签:高可用


###########################lb01

cat /etc/keepalived/keepalived.conf

! Configuration File for keepalived_lb01


global_defs {

#  notification_email {

#  918391635@qq.com

#  }


   router_id LB01

}


vrrp_script check_lb {  

script "/server/scripts/check_lb.sh"  

interval 2                            

weight 2

}


vrrp_instance VI_1 {

    state BACKUP

    interface eth0

    virtual_router_id 51

    priority 100

    advert_int 1

    authentication {

        auth_type PASS

        auth_pass 1111

    }

    virtual_ipaddress {

     10.0.0.3/24 dev eth0 label eth0:1  

    }

    track_script {

    check_lb

    }

}   

vrrp_instance VI_2 {

    state MASTER

    interface eth0

    virtual_router_id 52

    priority 150

    advert_int 1

    authentication {

        auth_type PASS

        auth_pass 1111

    }

    virtual_ipaddress {

     10.0.0.4/24 dev eth0 label eth0:2

    }

}

#######################lb02

 cat /etc/keepalived/keepalived.conf

! Configuration File for keepalived_lb01


global_defs {

#  notification_email {

#  918391635@qq.com

#  }


   router_id LB01

}


vrrp_script check_lb {  

script "/server/scripts/check_lb.sh"  

interval 2                            

weight 2

}


vrrp_instance VI_1 {

    state MASTER

    interface eth0

    virtual_router_id 51

    priority 150

    advert_int 1

    authentication {

        auth_type PASS

        auth_pass 1111

    }

    virtual_ipaddress {

     10.0.0.3/24 dev eth0 label eth0:1  

    }

    track_script {

    check_lb

    }

}   

vrrp_instance VI_2 {

    state BACKUP

    interface eth0

    virtual_router_id 52

    priority 100

    advert_int 1

    authentication {

        auth_type PASS

        auth_pass 1111

    }

    virtual_ipaddress {

     10.0.0.4/24 dev eth0 label eth0:2

    }

}


keepalived高可用双主配置文件

标签:高可用

原文地址:http://blog.51cto.com/13667111/2124815

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!