首页 > 其他 > 详细

keepalived高可用双主配置文件

时间:2018-06-05 00:29:35      阅读:250      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!