1

I faced with new for me, unknown value of "state" variable - "EQUAL". Be more specific:

vrrp_script chk_master {
    script "/var/<path>/scripts/cmaster.sh"
    timeout 25
    interval 30
    weight -120
}

vrrp_instance VI {
        interface eth0
        state EQUAL
        priority 101
        virtual_router_id 68
        advert_int 1
        authentication {
                auth_type PASS
                auth_pass password:
        }
        virtual_ipaddress {
                x.x.x.x/x
        }

        track_script {
            chk_master
        }

        notify /usr/local/bin/keepalived-notify.sh
}

vrrp_script chk_standby {
    script "/var/<path>/scripts/cstandby.sh"
    timeout 25
    interval 30
    weight 20
}

vrrp_instance VI2 {
        interface eth0
        state EQUAL
        priority 100
        virtual_router_id 69
        advert_int 1
        authentication {
                auth_type PASS
                auth_pass password:
        }
        virtual_ipaddress {
                x.x.x.x/x
        }

        track_script {
            chk_standby
        }

        notify /usr/local/bin/keepalived-notify2.sh
}

Does anybody know what is meaning of this state? What is difference between "EQUAL" and "MASTER"/"BACKUP" states? I didn't find answer in official docs. Thnx.

  • EQUAL is not a valid state. This idea appears to have originated with [this](https://sourceforge.net/p/keepalived/mailman/message/4590876//) post. – SiHa Oct 01 '20 at 11:58

2 Answers2

2

In MASTER/BACKUP, the MASTER is always selected if it is operation. With EQUAL, neither one is preferred.

If you have MASTER/BACKUP and the master fails, you'll fail over to the BACKUP. But when the MASTER recovers, you'll switch back to it. With EQUAL, that would not happen.

David Schwartz
  • 31,449
  • 2
  • 55
  • 84
  • 3
    This incorrect. There is no such thing as an `EQUAL` state: https://github.com/acassen/keepalived/issues/707, and never has been. Just someone who used it, because they didn't want to set either `MASTER` or `BACKUP`. Setting both to `BACKUP` does apparently work, though. – SiHa Oct 01 '20 at 11:50
0

As per the comment of @SiHa in the accepted answer, "EQUAL" is not a state, GitHub community addressing the issue just because at a specific version (commit) of keepalived the EQUAL did not reported an error it doesn't magically become a new state, now if you try equal state you will get an error "unknown state 'EQUAL', defaulting to BACKUP".

MoonLight
  • 111
  • 4