Ucarp

From AleikoumWiki

Revision as of 10:26, 12 March 2008 by Erwan (Talk | contribs)
Jump to: navigation, search

Voila ce que j'ai retenu de la mise en place d'Ucarp... bon je risque de corriger plus d'une fois cette page mais apres tout c'est un wiki et c'est fait pour ca !

A VENIR !!!!

Contents

Objectif

Imaginons la situation suivante :
On a une machine tres critique (base de donnees, web ou autre...) que l'on souhaite pouvoir remonter, rapidement et a distance, en cas de probleme.
...
C'est une problematique standard pour un admin reseau et on va voir comment avec Ucarp, on va pouvoir resoudre ce soucis.

/!\ Attention : cette procedure explique comment mettre en place Ucarp et comment l'exploiter ! Je n'aborderai jamais la problematique de synchronisation entre les deux machines. Je pars du principe que ces machines sont synchros !


La Mise en Place

Environnement

Scripts indispensables

/etc/sysconfig/carp/vip-down

#!/bin/sh
exec /sbin/ifconfig $1 down


/etc/sysconfig/carp/vip-up
#!/bin/sh
# We could use ifup directly, but it complains if the address is already used
. /etc/sysconfig/network-scripts/ifcfg-$1
exec /sbin/ifconfig $1 ${IPADDR} netmask ${NETMASK} up


Sur le Master

/etc/sysconfig/carp/vip-100.conf

# Virtual IP configuration file for UCARP
# The number (from 001 to 255) in the name of the file is the identifier
PASSWORD="plop"
BIND_INTERFACE="eth0"
VIP_INTERFACE="eth0:0"
OPTIONS="-k 1 -P"

/etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=10.10.10.110
NETMASK=255.255.255.0


/etc/sysconfig/network-scripts/ifcfg-eth0:0

DEVICE=eth0:0
BOOTPROTO=static
IPADDR=10.10.10.100
NETMASK=255.255.255.0
ONBOOT=no
ONPARENT=no

Sur le Backup

/etc/sysconfig/carp/vip-100.conf

# Virtual IP configuration file for UCARP
# The number (from 001 to 255) in the name of the file is the identifier
PASSWORD="plop"
BIND_INTERFACE="eth0"
VIP_INTERFACE="eth0:1"
OPTIONS="-k 10 -P"


/etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
BOOTPROTO=static
IPADDR=10.10.10.107
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet


/etc/sysconfig/network-scripts/ifcfg-eth0:1

DEVICE=eth0:1
BOOTPROTO=static
IPADDR=10.10.10.100
NETMASK=255.255.255.0
ONBOOT=no
ONPARENT=no

Liens

http://gentoo-wiki.com/HOWTO_Setup_IP_failover_with_UCARP

Personal tools