Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 May 2015 10:58:29 -0700
From:      motty cruz <motty.cruz@gmail.com>
To:        Konstantin Kukushkin <dark@rambler-co.ru>
Cc:        =?UTF-8?Q?Trond_Endrest=C3=B8l?= <Trond.Endrestol@fagskolen.gjovik.no>,  freebsd-questions@freebsd.org
Subject:   Re: Help! carp slave take over as master at boot!
Message-ID:  <CALoOYy7doZusm6bWHtV7wkQaC4kkr6Sd-8vWxSLEvky04gwpDQ@mail.gmail.com>
In-Reply-To: <55531870.9060607@rambler-co.ru>
References:  <55511AF3.3030408@gmail.com> <alpine.BSF.2.20.1505120742290.46962@mail.fig.ol.no> <CALoOYy6Tb3Pc2fLJFnQE+z85Mwc1_eSTYBD8T=j4vo-i8kCRmg@mail.gmail.com> <55531870.9060607@rambler-co.ru>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
Hello Konstantin

This is a new setup; my goal is to have a redundant "file server"; if
"Machine A(master) goes down or just reboot for any reason, I want Machine
B(slave) to take over as Master and I want Machine (B slave) to stay Master
when Machine A come back on-line.

Here is what I have thus far:
Machine A (master)
ifconfig_igb0_alias0=3D"inet vhid 31 advbase 12 advskew 40 pass password2
19.16.31.80/24"

Machine B (slave)
ifconfig_igb0_alias0=3D"inet vhid 31 advbase 12 advskew 80 pass  password2
19.16.31.80/24"
both machines: /etc/sysctl.conf
# net.inet.carp.preempt=3D1

(Machine A ) /etc/devd.conf
##### Check status of CARP interface ########
notify 5 {
                   match "system"          "CARP";
                   match "subsystem"       "[0-9]+@[0-9a-z]+";
                   match "type"            "(MASTER)";
                   action "/usr/local/sbin/startmaster.pl";
};

notify 5 {
        match "system"          "CARP";
        match "type"            "[0-9]+@[0-9a-z]+";
        match "subsystem"       "(BACKUP)";
        action "/usr/local/sbin/slave.sh";
};


(Machine B) /etc/devd.conf
### Check status of CARP interface  ###
notify 5 {
                   match "system"          "CARP";
                   match "subsystem"       "[0-9]+@[0-9a-z]+";
                   match "type"            "(MASTER)";
                   action "/usr/local/sbin/startmaster.pl";
};



notify 5 {
        match "system"          "CARP";
        match "type"            "[0-9]+@[0-9a-z]+";
        match "subsystem"       "(BACKUP)";
        action "/usr/local/sbin/slave.sh";
};

if Master machine reboots, I want slave to take over as Master and stay
Master even after Machine with lowest advskew come back online.

any ideas?


Thanks,
Motty



On Wed, May 13, 2015 at 2:25 AM, Konstantin Kukushkin <dark@rambler-co.ru>
wrote:

> 13.05.2015 04:19, motty cruz =D0=BF=D0=B8=D1=88=D0=B5=D1=82:
>
>> Hi thanks for your reply;
>>
>> Machine A (master)
>> ifconfig_igb0_alias0=3D"inet vhid 31 advbase 12 advskew 40 pass password=
2
>> 19.16.31.80/24"
>>
>> Machine B (slave)
>> ifconfig_igb0_alias0=3D"inet vhid 31 advbase 12 advskew 80 pass  passwor=
d2
>> 19.16.31.80/24"
>>
>> if I reboot slave, on boot it takes over as Master, any idea why?
>> both machines: /etc/sysctl.conf
>> # net.inet.carp.preempt=3D1
>>
>
> I don't understand master was rebooted so check runtime configuration of
> sysctl net.inet.carp.preempt on master.
> Check also /var/log/messages on both computers, sysctl
> net.inet.carp.demotion on master (CARP may be demoted due to
> interface/pfsync errors. CARP with preemption may be demoted also by down
> any other interface with CARP on the system).
> Check firewall on slave, may be it block ingress packets from master.
>
>
>  On Mon, May 11, 2015 at 10:45 PM, Trond Endrest=C3=B8l <
>> Trond.Endrestol@fagskolen.gjovik.no> wrote:
>>
>>  On Mon, 11 May 2015 14:11-0700, Motty Cruz wrote:
>>>
>>>  Hello, I have two machines running FreeBSD 10.1 Release. Machine A is
>>>> the
>>>> master in Carp with advskew 20 and Machine B slave with advskew 200 bo=
th
>>>>
>>> are
>>>
>>>> set to advbase 10. however, slave machine becomes Master on boot;
>>>>
>>>> my questions is, how do I configure both machines so if reboot any of
>>>> the
>>>> machines whatever machine is Master stays master if secondary machine
>>>>
>>> reboot.
>>>
>>> You should augment your posting with facts. You may withhold any
>>> sensitive information such as IP addresses, but a copy of the relevant
>>> lines from /etc/rc.conf and /etc/sysctl.conf would be helpful.
>>>
>>> Have you tried setting:
>>>
>>> net.inet.carp.preempt=3D1
>>>
>>> in /etc/sysctl.conf?
>>>
>>> Try the command:
>>>
>>> sysctl net.inet.carp.preempt=3D1
>>>
>>> to see any immediate effect.
>>>
>>> --
>>> +-------------------------------+------------------------------------+
>>> | Vennlig hilsen,               | Best regards,                      |
>>> | Trond Endrest=C3=B8l,              | Trond Endrest=C3=B8l,           =
        |
>>> | IT-ansvarlig,                 | System administrator,              |
>>> | Fagskolen Innlandet,          | Gj=C3=B8vik Technical College, Norway=
,  |
>>> | tlf. mob.   952 62 567,       | Cellular...: +47 952 62 567,       |
>>> | sentralbord 61 14 54 00.      | Switchboard: +47 61 14 54 00.      |
>>> +-------------------------------+------------------------------------+
>>>
>>
>
> --
> =D0=A1 =D1=83=D0=B2=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=D0=BC, =D0=9A=D0=
=BE=D0=BD=D1=81=D1=82=D0=B0=D0=BD=D1=82=D0=B8=D0=BD =D0=9A=D1=83=D0=BA=D1=
=83=D1=88=D0=BA=D0=B8=D0=BD,
> Rambler Internet Holding
> mailto:dark@rambler-co.ru
> =D1=82=D0=B5=D0=BB.: 8 (495) 785-17-00#2129
>



--=20
Thanks for your support,
Motty



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?CALoOYy7doZusm6bWHtV7wkQaC4kkr6Sd-8vWxSLEvky04gwpDQ>