安装不抢占能源

作者: 关于计算机  发布:2019-11-04

keepalived做HA时,平常会遇上抢占式的master和backup之间的切换

example:

常常倘若master服务死掉后backup会造成master,不过当master服务又好了的时候 master此时会抢占VIP,那样就能够发出一回切换对作业繁忙的网站以来是不佳的。所以大家要在配置文件参与  nopreempt  非抢占,可是那么些参数只好用于state 为backup,故大家在用HA的时候最佳master 和backup的state都安装成backup 让其通过priority来竞争。

小心:那样铺排后,大家要留意运转keepalived服务的意气风产生机勃勃,假如自身想让A成为backup那就无法先运维A的keepalived服务。

以下是组成MHA架构主、备库配置事例

主库

[root@mysqltest ~]# more /etc/keepalived/keepalived.conf
#20140916
#!/bin/bash

global_defs {
    router_id mysqlmha
}

vrrp_script check_run {
  script "/etc/keepalived/check_mysql.sh"
  interval 1
}

vrrp_instance VI_1 {
    state BACKUP    --这里状态钦点为backup
    interface eth0
    virtual_router_id 151
    priority 100
    advert_int 1
    nopreempt        --设置 nopreempt 幸免抢占财富
    authentication {
        auth_type PASS
        auth_pass 1111
    }

    track_script {
        check_run
    }
    virtual_ipaddress {
        192.168.66.53
    }
}

备库

[root@ceshi ~]# more /etc/keepalived/keepalived.conf
! Configuration File for keepalived

global_defs {
  router_id mysqlmha
}

vrrp_script check_run {
  script "/etc/keepalived/check_mysql.sh"
  interval 1
}

vrrp_instance VI_1 {
    state BACKUP
    interface eth0
    virtual_router_id 151
    priority 90
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass 1111
    }

    track_script {
      check_run
    }

    virtual_ipaddress {
        192.168.66.53
    }
}

CentOS 6.3下Haproxy+Keepalived+Apache配置笔记 http://www.linuxidc.com/Linux/2013-06/85598.htm

Haproxy + KeepAlived 实现WEB群集 on CentOS 6 http://www.linuxidc.com/Linux/2012-03/55672.htm

Keepalived+Haproxy配置高可用负载均衡 http://www.linuxidc.com/Linux/2012-03/56748.htm

Haproxy+Keepalived营造高可用负载均衡 http://www.linuxidc.com/Linux/2012-03/55880.htm

CentOS 7 上配置LVS + Keepalived + ipvsadm http://www.linuxidc.com/Linux/2014-11/109237.htm

Keepalived高可用集群搭建 http://www.linuxidc.com/Linux/2014-09/106965.htm

Keepalived 的详实介绍:请点这里
Keepalived 的下载地址:请点这里

正文永远更新链接地址:http://www.linuxidc.com/Linux/2014-12/110736.htm

图片 1

本文由今晚买四不像发布于关于计算机,转载请注明出处:安装不抢占能源

关键词:

上一篇:SELinux导致故障解决实例
下一篇:没有了