public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Bastian Balthazar Bux <BastianBalthazarBux@pnpitalia.it>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Load Balancing / Redundant Network ?
Date: Wed, 14 Sep 2005 22:07:43 +0200	[thread overview]
Message-ID: <4328830F.9060907@pnpitalia.it> (raw)
In-Reply-To: <02E97941F0AF594D9CF56EE628E3BE1FC4EA@vodka.office.red-herring.net>

Mal Herring wrote:
> Hi List,
> Been looking on forums.gentoo.org looking for a way to pair two NIC's so
> that should the primary fail, the secondary takes over...
> 
> The situation is this:
> 
> 8 HP DL380G4's all running Gentoo moving into a data centre rack, the
> firewall is currently a Netscreen(Juniper) 25 and another will be added
> to give us Active/Passive failover on the firewalls.
> 
> Redundant switches will be added behind the firewalls to ensure that is
> not a single point of failure, all the DL380 have two NIC's in them and
> currently only one is active.
> 
> All boxes covered with HP on a 24x7x4 Carepaq, redundant power supplies
> to be added - DC is a N+1 so fine there...
> 
> Biggest issue I am facing and becoming lost on is teaming the NIC's so I
> can connect NIC1 to Switch 1 and NIC2 to switch 2 etc...
> 
> Can anyone help ?
> 
> Ta
> 
> Mal
> 
rather dirty but what about put this script in a "*/5" minutes cron ?

------- check_connectivity --------
#! /bin/sh

# counter of failed ping
FAILED_PING=0

# after how much time the script is forced to exit
# warning %s is a gnu extension to date
STOP_TIME=$(( $(date +%s) + 300 -2 ))

# host used for chech
REACHABLE_HOSTS="192.168.1.123 192.168.1.124"

# seconds to wait before to switch (approx)
# left operand = tentatives
# right operand = no of hosts in REACHABLE_HOSTS
TTW=$(( 5 * 2 ))

# if this become "1" call houston
SWITCHED=0

PING_CMD="arping -c1 -Ieth0 -w1 -q"


while [[ "$(date +%s)" -lt "${STOP_TIME}" ]] && [[ ${SWITCHED} -eq 0 ]]
do
        for host in ${REACHABLE_HOSTS}
        do
                if ($PING_CMD $host) ; then
                        FAILED_PING=1
                else
                        FAILED_PING=$(( FAILED_PING + 1 ))
                fi
        done

        if [[ ${FAILED_PING} -gt ${TTW} ]] ; then
                SWITCHED=1
                # put the replace interface fx here
                echo "switch_interface"
        fi
        sleep 1
done
------- check_connectivity --------

Still todo are:
-  the switch_interface() interface function something like relink
   /etc/conf.d/net and restart the net
- the "return to normality" script that once eth0 work again for some
  seconds switch back
- A lock that prevent the script to start if the interface is switched
  (and instead run the check for "normal" status)
- a mail to the admin

P.S. has never checked in real life, do your checks before to use it

Cheers,
Francesco R.
-- 
gentoo-user@gentoo.org mailing list



  parent reply	other threads:[~2005-09-14 20:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-14 12:51 [gentoo-user] Load Balancing / Redundant Network ? Mal Herring
2005-09-14 15:19 ` Olaf Niermann
2005-09-15 18:08   ` A. Khattri
2005-09-15 20:42     ` Mike Williams
2005-09-16 17:46       ` A. Khattri
2005-09-14 20:07 ` Bastian Balthazar Bux [this message]
2005-09-15 21:08 ` kashani
2005-09-18 21:22 ` Scott Storck
2005-09-19  4:00   ` kashani
  -- strict thread matches above, loose matches on Subject: below --
2005-09-19  7:07 Mal Herring
     [not found] <4OnWT-26l-11@gated-at.bofh.it>
2005-09-28 10:13 ` Yoann Pannier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4328830F.9060907@pnpitalia.it \
    --to=bastianbalthazarbux@pnpitalia.it \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox