Резервирование с помощью CARP

CARP – протокол, позволяющий задействовать один IP-адрес для нескольких машин в сети. Таким образом можно реализовать отказоустойчивость (избыточность) и масштабирование (увеличение нагрузки). Пусть у нас имеется два сервера с собственными ip-адресами – и, и хочется дополнительно настроить общий адрес, который предоставляет какой-либо сервис пользователям (к примеру, маршрутизация или DNS). Инструкция по использованию технологии CARP под катом.

Первым делом собираем свое ядро. Скачиваем исходники


Выбираем Configure – Distributions – src, отмечаем галочкой base и src.
Настраиваем конфиг ядра, кладем его в /root/kernels и компилируем. Проделываем эти действия на обоих серверах.

# cd /usr/src/sys/i386/conf
# mkdir -p /root/kernels
# cp GENERIC /root/kernels/CARP
# ln -s /root/kernels/CARP
# vim CARP
device carp
# cd /usr/src
# make buildkernel KERNCONF=CARP
# make installkernel KERNCONF=CARP
# vim /etc/sysctl.conf

Настраиваем carp-интерфейс на основном сервере:

# vim /etc/rc.conf
ifconfig_carp0="vhid 1 pass secretpassword advskew 0"

На запасном сервере:

# vim /etc/rc.conf
ifconfig_carp0="vhid 1 pass secretpassword advskew 100"

Объединяемые интерфейсы должны обладать одинаковыми параметрами vhid и pass. Параметр advskew отвечает за приоритет. Чем меньше – тем “главнее” будет интерфейс. Когда интерфейс с наименьшим advskew упадет, главным (т.е. MASTER) станет интерфейс со вторым по значению параметром advskew.

Перезагружаемся. Пробуем вытащить кабель из основного сервера. Радуемся, если все продолжает работать.

Также с помощью CARP можно создавать высокопроизводительные кластеры. Об этом, а также о том, как запускать сервисы по подъему CARP, в следующий раз.

Похожие статьи

146 thoughts on “Резервирование с помощью CARP”

  1. Every weekend i used to visit this site, for the reason that i
    wish for enjoyment, since this this site conations in fact pleasant funny data too.

  2. Excellent blog right here! Also your site so much up fast!
    What web host are you using? Can I am getting your
    affiliate link to your host? I desire my website
    loaded up as quickly as yours lol

  3. Hi there to every body, it’s my first pay a quick visit of this
    webpage; this web site consists of remarkable and actually excellent data for visitors.

  4. If some one desires to be updated with most recent technologies
    then he must be visit this web page and be up to date daily.

  5. really interesting review. At the same time visit the complete site that could be gamed game slot.
    These pages has received identification from agen slot
    deposit pulsa casino males and females in Dalam negeri. Certainly, there are
    usually numerous attractive promos if you happen to join at the moment.

  6. I believe that is one of the so much important information for
    me. And i’m glad studying your article. However should commentary on few common things, The
    site style is perfect, the articles is in reality excellent : D.
    Just right activity, cheers

  7. I do not know whether it’s just me or if everybody else encountering
    problems with your blog. It seems like some of the written text within your posts are running off the screen. Can somebody else please comment and let me know if this is happening to them as well?
    This may be a problem with my web browser because I’ve had this happen before.

  8. It’s an remarkable piece of writing designed for all the online viewers;
    they will get benefit from it I am sure.

  9. really interesting review. Furthermore visit my own, personal, personal site to understand slot via pulsa.
    The following incredible web page has received track record by using slot pulsa gambling house levels of competition in Dalam negeri.
    There are actually plenty of handy promos in the event you join lately.

  10. Its not my first time to visit this website, i am browsing this site
    dailly and take pleasant data from here everyday.

  11. necessary review. Also visit this site which might be played out slot deposit pulsa tanpa
    potongan. This website has received status out of slot on line
    casino customers in Negara sendiri. Truth be told there are actually many appealing promos because you join nowadays.

  12. This is my first time pay a quick visit at here and i am genuinely impressed to read all at alone place.

  13. great post, very informative. I’m wondering why the other experts of this sector don’t understand this.
    You must continue your writing. I am sure, you’ve a huge readers’ base already!

  14. Please let me know if you’re looking for a writer for your site.

    You have some really great articles and I believe I would be a
    good asset. If you ever want to take some of the load off, I’d absolutely love to write some
    articles for your blog in exchange for a link back to
    mine. Please blast me an e-mail if interested. Thank you!

  15. really interesting review. Additionally visit typically
    the site to appreciate situs slot online. This great
    web page has received fine reputation by using agen slot deposit pulsa gaming people in Dalam negri.
    Generally there are usually plenty of desired promos should you ever join currently.

  16. fascinating review. Moreover visit typically
    the site to apply slot. This particular web site has received detection having
    slot deposit pulsa tanpa potongan gambling house people
    in Dalam negeri. At this time there tend to be numerous amazing promos if
    you ever join at this point.

  17. Hey this is somewhat of off topic but I was wondering
    if blogs use WYSIWYG editors or if you have to
    manually code with HTML. I’m starting a blog soon but have no coding know-how so I wanted to get
    guidance from someone with experience. Any help would be enormously appreciated!

  18. Every weekend i used to pay a visit this web site, as i
    want enjoyment, as this this site conations actually nice funny
    information too.

  19. For most up-to-date information you have to visit world wide web and on web
    I found this website as a finest site for most up-to-date updates.

  20. Thanks , I have just been looking for information approximately this topic for a while and yours is the best I have found out till now.
    However, what in regards to the bottom line? Are you certain about the supply?

  21. Wow! At last I got a weblog from where I can in fact get valuable facts concerning
    my study and knowledge.

  22. What i do not understood is if truth be told how you’re
    not really a lot more neatly-appreciated than you might be now.
    You’re so intelligent. You know thus considerably relating
    to this subject, made me personally imagine it from so many numerous
    angles. Its like women and men don’t seem to be involved until it’s one thing to accomplish with Girl gaga!
    Your own stuffs outstanding. At all times handle
    it up!

  23. Thanks for every other wonderful article. Where else could anybody get that kind of info in such an ideal manner of writing?
    I’ve a presentation subsequent week, and I’m on the look for such info.

  24. Asking questions are really nice thing if you are not understanding
    something completely, however this post gives nice understanding yet.

Leave a Reply

Your email address will not be published. Required fields are marked *