[prev in list] [next in list] [prev in thread] [next in thread] 

List:       keepalived-devel
Subject:    Re: [Keepalived-devel] New Master stay the master
From:       Martin Barry <marty () supine ! com>
Date:       2010-09-30 14:31:15
Message-ID: 20100930143115.GA15787 () merboo ! mamista ! net
[Download RAW message or body]

$quoted_author = "Bryan Talbot" ;
> 
> What's required to avoid flapping and still have automatic failover on
> loss of service and no automatic fail back to a specific master when
> service is restored?  Is that even possible with just 2 hosts?  Seems
> like a quorum based system would be needed to do that properly.

Something I thought of but never got around to testing was to use the
floating VRRP priority and have two track_script entries, one that checked
the load balancing service and the other that checked whether the server was
MASTER.

The configuration files would have both start as BACKUP but the preferred
node with a slightly higher priority (so they never deadlock).

check_load_balancer would adjust the priority by a large amount (e.g. 50)
check_master would adjust the priority by a medium amount (e.g. 10)

Lets just walk through an example.

At start:
Node    Priority        State
1       101             BACKUP
2       100             BACKUP

First election won by node 1:
Node    Priority        State
1       101             MASTER
2       100             BACKUP

check_master succeeds on node 1:
Node    Priority        State
1       111             MASTER
2       100             BACKUP

check_load_balancer fails on node 1:
Node    Priority        State
1       61              MASTER
2       100             BACKUP

Next election won by node 2:
Node    Priority        State
1       61              BACKUP
2       100             MASTER

check_master succeeds on node 2 and fails on node 1:
Node    Priority        State
1       51              BACKUP
2       110             MASTER

check_load_balancer recovers on node 1:
Node    Priority        State
1       101             BACKUP
2       110             MASTER


Note that the final state is stable until node 2 either fails completely or
check_load_balancer fails. check_master increasing the priority means we
don't need nopreempt. 

Anyone want to test my theory? :-)

cheers
Marty

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Keepalived-devel mailing list
Keepalived-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/keepalived-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic