加入收藏 | 设为首页 | 会员中心 | 我要投稿 济南站长网 (https://www.0531zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

Centos 6.0系统lvs+keepalived+mysql实现mysql数据库热备主主复制

发布时间:2016-09-18 15:46:50 所属栏目:Linux 来源:站长网
导读:今天这篇文章接着昨天的相关知识,一样是为了前天刚做的mysql热备; 大家知道实现mysql_Ha的方案有很多,常见的heartbeat、keepalived,这里说的就是keepalived

上master的基本一样,只是几个地方修改下而已

global_defs {
   notification_email {
   coffee_lanshan@sina.com
    }
   notification_email_from admin@example.com
   smtp_server 127.0.0.1
   smtp_connect_timeout 30
   router_id Mysql_ha
}
 
vrrp_instance VI_1 {
    state BACKUP
    interface eth0
    virtual_router_id 51
    priority 90
    advert_int 1
    nopreempt
    authentication {
        auth_type PASS
        auth_pass 123456
    }
    virtual_ipaddress {
        192.168.135.200
    }
}
 
virtual_server 192.168.135.200 3306 {
    delay_loop 2
    lb_algo wrr
    lb_kind DR
    persistence_timeout 10
    protocol TCP
 
    real_server 192.168.135.135 3306 {
    weight 3
    notify_down /usr/local/Mysql/bin/mysql.sh
    TCP_CHECK {
    connect_timeout 10
    nb_get_retry 3
    delay_before_retry 3
    connect_port 3306
}
}
}

(编辑:济南站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读