Getting Apa with HOT-STANDBY to work on HP-UX 11.23

Hola, para configurar apa con una tarjeta de failover, en cado de que falla la primaria salta automáticamente a la secundaria sin tener perdida de servicio:

Lo primero que tenemos que hacer es elegir las tarjetas que queremos que formen el grupo de failover, para ello tienen que estar en la misma subred con el linkloop probamos que tengan conectividad:

wopper@root:>lanscan
Hardware Station Crd Hdw Net-Interface NM MAC HP-DLPI DLPI
Path Address In# State NamePPA ID Type Support Mjr#
10/0/2/1/0 0x0017A4768A34 0 UP lan0 snap0 1 ETHER Yes 119
10/0/10/1/0 0x0017A4767A32 2 UP lan2 snap2 2 ETHER Yes 119
10/0/12/1/0 0x0017A4769A6A 3 UP lan3 snap3 3 ETHER Yes 119
wopper@root:>linkloop -i 0 0x0017A4769A6A
Link connectivity to LAN station: 0x0017A4769A6A
-- OK
wopper@root:>linkloop -i 3 0x0017A4768A34
Link connectivity to LAN station: 0x0017A4768A34
-- OK

Ahora ya que tenemos las 2 tarjetas que vamos a usar, las añadimos a la configuración de puertos de apa:

wopper@root:>vi /etc/rc.config.d/hp_apaportconf
"hp_apaportconf" [Read only] 96 lines, 3585 characters
#####################################################################
# @(#) hp_apaportconf $Revision: 1.8 $ $Date: 2000/05/15 16:21:10 $
# hp_apaportconf : contains configuration values for Physical Ports for
# HP Auto-Port Aggregation interfaces
#
# HP_APAPORT_INTERFACE_NAME Name of physical interface (lan0, lan1...)
#
# HP_APAPORT_GROUP_CAPABILITY Set the group capability for the port
# The HP_APAPORT_INIT_ARGS are reserved by HP. They are NOT user changable.

HP_APAPORT_INIT_ARGS="HP_APAPORT_GROUP_CAPABILITY HP_APAPORT_PRIORITY HP_APAPORT_CONFIG_MODE HP_APAPORT_KEY HP_APAPORT
_SYSTEM_PRIORITY"

HP_APAPORT_INTERFACE_NAME[0]=lan0
HP_APAPORT_CONFIG_MODE[0]=LAN_MONITOR
HP_APAPORT_INTERFACE_NAME[1]=lan3
HP_APAPORT_CONFIG_MODE[1]=LAN_MONITOR

# End of hp_apaportconf configuration file

Una vez que hemos añadido las 2 tarjetas a el fichero de configuración, paramos y arrancamos los demonios de APA para que los cambios tengan efecto:

wopper@root:>/sbin/init.d/hplm stop
ERROR: Unable to open /etc/lanmon/lanconfig for reading. UNIX errno = 2
/sbin/init.d/hplm stopped.
wopper@root:>/sbin/init.d/hpapa stop
/sbin/init.d/hpapa stopped.
wopper@root:>/sbin/init.d/hpapa start
/sbin/init.d/hpapa started.
Please be patient. This may take about 40 seconds.
HP_APA_DEFAULT_PORT_MODE = MANUAL
/usr/sbin/hp_apa_util -S 0 LAN_MONITOR
/usr/sbin/hp_apa_util -S 3 LAN_MONITOR
/sbin/init.d/hpapa Completed successfully.
wopper@root:>/sbin/init.d/hplm start
/sbin/init.d/hplm started.
/etc/lanmon/lanconfig.ascii not present on the system.
lanapplyconf will not be executed

Ahora simplemente lanzamos el lanqueryconf que se encarga de mirar que tarjetas tenemos configuradas dentro de la misma vlan y con ellos nos crea una plantilla que podemos editar, en esté caso, con la configuración que nos pone por defecto lo deja perfecto:

wopper@root:>lanqueryconf -s
ASCII output is in file /etc/lanmon/lanconfig.ascii
wopper@root:>vi /etc/lanmon/lanconfig.ascii
"/etc/lanmon/lanconfig.ascii" 74 lines, 4118 characters
# ********************************************************
# *********** LAN MONITOR CONFIGURATION FILE *************
# ********************************************************

NODE_NAME wopper

# ****************************************************************
# The valid range for POLLING_INTERVAL: 500,000-10,000,000 usec **
# Default value for POLLING_INTERVAL: 10,000,000 usec **
# Minimum value for DEAD_COUNT: 2 **
# Default value for DEAD_COUNT: 3 **
# ****************************************************************
POLLING_INTERVAL 10000000
DEAD_COUNT 3

# ****************************************************************
# By default, LM_RAPID_ARP is off. **
# If LM_RAPID_ARP is on, the valid ranges are: **
# LM_RAPID_ARP_INTERVAL: 1000000-4000000 (default:1000000) usec **
# LM_RAPID_ARP_COUNT: 5 - 60 (default is 10) **
# (LM_RAPID_ARP_INTERVAL * LM_RAPID_ARP_COUNT) <= 60s **
# ****************************************************************
LM_RAPID_ARP off
LM_RAPID_ARP_INTERVAL 1000000
LM_RAPID_ARP_COUNT 10

# ****************************************************************
# to HP Auto Port Aggregation Support Guide at **
# http://docs.hp.com. **
# ****************************************************************

FAILOVER_GROUP lan900
STATIONARY_IP 10.7.11.13
PRIMARY lan0 5
STANDBY lan3 3

Despues lanzamos el lancheckconf que se encarga de comprobar que la sintaxis del fichero es la correcta:

wopper@root:>lancheckconf
Reading ASCII file /etc/lanmon/lanconfig.ascii
Verification of input file /etc/lanmon/lanconfig.ascii is complete.

Despues aplicamos la configuración e inmediatamente entra en vigor la nueva configuración, este cambio se realiza en caliente sin perder la red en ningun momento, nuestra nueva tarjeta es la lan900 que engloba a la lan0 y lan3:

wopper@root:>lanapplyconf
Reading ASCII file /etc/lanmon/lanconfig.ascii
Creating Fail-Over Group lan900
Updated binary file /etc/lanmon/lanconfig
wopper@root:>netstat -ni
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll
lo0 4136 127.0.0.0 127.0.0.1 568180 0 568180 0 0
lan900 1500 10.7.112.0 10.7.115.131 122 0 48 0 0
wopper@root:>lanscan -q
2
900 0 3

Nuestras 2 tarjetas desaparecen del lanscan para que solo empleemos la lan900 que a todos los efectos de commandos (lanadmin,linkloop,etc) es igual que una lan física normal:

wopper@root:>lanscan
Hardware Station Crd Hdw Net-Interface NM MAC HP-DLPI DLPI
Path Address In# State NamePPA ID Type Support Mjr#
10/0/10/1/0 0x0017A4767A32 2 UP lan2 snap2 2 ETHER Yes 119
LinkAgg0 0x0017A4768A34 900 UP lan900 snap900 6 ETHER Yes 119
LinkAgg1 0x000000000000 901 DOWN lan901 snap901 7 ETHER Yes 119
LinkAgg2 0x000000000000 902 DOWN lan902 snap902 8 ETHER Yes 119
LinkAgg3 0x000000000000 903 DOWN lan903 snap903 9 ETHER Yes 119
LinkAgg4 0x000000000000 904 DOWN lan904 snap904 10 ETHER Yes 119
wopper@root:>

Con el lanadmin se puede ver el estado y config del hot-standby:

wopper@root:>lanadmin -x -y 900
Hot Standby = ON
wopper@root:>lanadmin -x -v 900
Link Aggregate PPA # : 900
Number of Ports : 2
Ports PPA : 0 3
Link Aggregation State : LINKAGG MANUAL
Load Balance Mode : Hot Standby (LB_HOT_STANDBY)