First, thanks for trying to help!
Le 09/07/2014 07:08, Remi Locherer a écrit :
> On Mon, Jul 07, 2014 at 08:44:43PM +0200, Mxher wrote:
>> Hello again,
>>
>> I'm doing few more tests and now I'm wondering if this is possible to
>> disallow CARP to have some resources on serverA and others on serverB?
>
> Have you set the sysctl net.inet.carp.preempt=1?
>
Yes it is.
>>
>> Here is my tests (advbase=1 and advskew=0 for every interfaces on both
>> servers):
>
> advskew should be different on master from backkup. Try advskew=200 on
> obsd2.
>
> Please read man carp. The first example is exactly what you need.
>
It's not; I will describe my tests more precisely (sorry for the long
post again):
1) Initial state
root@obsd1:~# sysctl -a|grep net.inet.carp.preempt
net.inet.carp.preempt=1
root@obsd2:~# sysctl -a|grep net.inet.carp.preempt
net.inet.carp.preempt=1
root@obsd1:~# ifconfig HA|grep carp:
carp: MASTER carpdev em0 vhid 1 advbase 1 advskew 0
carp: MASTER carpdev em1 vhid 2 advbase 1 advskew 0
carp: MASTER carpdev em2 vhid 3 advbase 1 advskew 0
carp: MASTER carpdev em3 vhid 4 advbase 1 advskew 0
root@obsd2:~# ifconfig HA|grep carp:
carp: BACKUP carpdev em0 vhid 1 advbase 1 advskew 200
carp: BACKUP carpdev em1 vhid 2 advbase 1 advskew 200
carp: BACKUP carpdev em2 vhid 3 advbase 1 advskew 200
carp: BACKUP carpdev em3 vhid 4 advbase 1 advskew 200
2) Unplug of em3 on obsd1: the failover is done as expected
root@obsd1:~# ifconfig HA|grep carp:
carp: BACKUP carpdev em0 vhid 1 advbase 1 advskew 0
carp: BACKUP carpdev em1 vhid 2 advbase 1 advskew 0
carp: BACKUP carpdev em2 vhid 3 advbase 1 advskew 0
carp: INIT carpdev em3 vhid 4 advbase 1 advskew 0
root@obsd2:~# ifconfig HA|grep carp:
carp: MASTER carpdev em0 vhid 1 advbase 1 advskew 200
carp: MASTER carpdev em1 vhid 2 advbase 1 advskew 200
carp: MASTER carpdev em2 vhid 3 advbase 1 advskew 200
carp: MASTER carpdev em3 vhid 4 advbase 1 advskew 200
3) (re)Plug of em3 on obsd1: resources gets back on obsd1 because of the
advskew greater on obsd2 (this is the exact purpose of advskew, and I
want to avoid it, but I did it to show you).
root@obsd1:~# ifconfig HA|grep carp:
carp: MASTER carpdev em0 vhid 1 advbase 1 advskew 0
carp: MASTER carpdev em1 vhid 2 advbase 1 advskew 0
carp: MASTER carpdev em2 vhid 3 advbase 1 advskew 0
carp: MASTER carpdev em3 vhid 4 advbase 1 advskew 0
root@obsd2:~# ifconfig HA|grep carp:
carp: BACKUP carpdev em0 vhid 1 advbase 1 advskew 200
carp: BACKUP carpdev em1 vhid 2 advbase 1 advskew 200
carp: BACKUP carpdev em2 vhid 3 advbase 1 advskew 200
carp: BACKUP carpdev em3 vhid 4 advbase 1 advskew 200
4) Unplug of em2 on obsd2 AND unplug of em3 on obsd1: resources get
"mixed" between the two nodes.
I don't think this is a bug, it seems to be design to act like this and
I can understand why. But, in my case, I must avoid that.
root@obsd1:~# ifconfig HA|grep carp:
carp: MASTER carpdev em0 vhid 1 advbase 1 advskew 0
carp: MASTER carpdev em1 vhid 2 advbase 1 advskew 0
carp: MASTER carpdev em2 vhid 3 advbase 1 advskew 0
carp: INIT carpdev em3 vhid 4 advbase 1 advskew 0
root@obsd2:~# ifconfig HA|grep carp:
carp: BACKUP carpdev em0 vhid 1 advbase 1 advskew 200
carp: BACKUP carpdev em1 vhid 2 advbase 1 advskew 200
carp: INIT carpdev em2 vhid 3 advbase 1 advskew 200
carp: MASTER carpdev em3 vhid 4 advbase 1 advskew 200