Ucarp

From AleikoumWiki

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
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 !
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 !!!!
== Objectif ==
== Objectif ==
Line 11: Line 13:
=== Environnement ===
=== Environnement ===
 +
 +
=== Scripts indispensables ===
 +
 +
 +
/etc/sysconfig/carp/vip-down
 +
<pre>
 +
#!/bin/sh
 +
exec /sbin/ifconfig $1 down
 +
</pre>
 +
 +
 +
/etc/sysconfig/carp/vip-up
 +
<pre>
 +
#!/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
 +
</pre>
 +
=== Sur le Master ===
=== Sur le Master ===
 +
 +
/etc/sysconfig/carp/vip-100.conf
 +
<pre>
 +
# Virtual IP configuration file for UCARP
 +
# The number (from 001 to 255) in the name of the file is the identifier
 +
PASSWORD="labase-vip"
 +
BIND_INTERFACE="eth0"
 +
VIP_INTERFACE="eth0:0"
 +
OPTIONS="-k 1 -P"
 +
</pre>
 +
 +
/etc/sysconfig/network-scripts/ifcfg-eth0
 +
<pre>
 +
DEVICE=eth0
 +
ONBOOT=yes
 +
BOOTPROTO=static
 +
IPADDR=10.10.10.110
 +
NETMASK=255.255.255.0
 +
</pre>
 +
 +
 +
/etc/sysconfig/network-scripts/ifcfg-eth0:0
 +
<pre>
 +
DEVICE=eth0:0
 +
BOOTPROTO=static
 +
IPADDR=10.10.10.100
 +
NETMASK=255.255.255.0
 +
ONBOOT=no
 +
ONPARENT=no
 +
</pre>
=== Sur le Backup ===
=== Sur le Backup ===
 +
 +
/etc/sysconfig/carp/vip-100.conf
 +
<pre>
 +
# Virtual IP configuration file for UCARP
 +
# The number (from 001 to 255) in the name of the file is the identifier
 +
PASSWORD="labase-vip"
 +
BIND_INTERFACE="eth0"
 +
VIP_INTERFACE="eth0:1"
 +
OPTIONS="-k 10 -P"
 +
</pre>
 +
 +
 +
/etc/sysconfig/network-scripts/ifcfg-eth0
 +
<pre>
 +
DEVICE=eth0
 +
BOOTPROTO=static
 +
IPADDR=10.10.10.107
 +
NETMASK=255.255.255.0
 +
ONBOOT=yes
 +
TYPE=Ethernet
 +
</pre>
 +
 +
 +
/etc/sysconfig/network-scripts/ifcfg-eth0:1
 +
<pre>
 +
DEVICE=eth0:1
 +
BOOTPROTO=static
 +
IPADDR=10.10.10.100
 +
NETMASK=255.255.255.0
 +
ONBOOT=no
 +
ONPARENT=no
 +
</pre>
== Liens ==
== Liens ==
http://gentoo-wiki.com/HOWTO_Setup_IP_failover_with_UCARP
http://gentoo-wiki.com/HOWTO_Setup_IP_failover_with_UCARP

Revision as of 13:16, 29 January 2008

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

On a deux machines A et B.
Ces machines sont "identiques" !


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="labase-vip"
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="labase-vip"
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