-----Ursprüngliche Nachricht-----
Von: Eddie C [mailto:[EMAIL PROTECTED]
Gesendet: Freitag, 15. Februar 2008 21:21
An: General Linux-HA mailing list
Betreff: Re: [Linux-HA] is ldirectord ready for Hearbeat v2 style
cluster?
>
>
> Micheal,
>
> Can you refer me to the documents you used for the setup or even
> describe what steps you took. I find a lot of documentation on LVS,
> but some of it is on LVS with ha V1. Some of the docs are for older
> kernels and OS. Sometimes docs suggest ARP tables sometimes not. I
> realize the setup should be simple but I myself have tried a few
> times.
>
> Thank you,
> Edward
>
>

Hi Eddie,

I hope this step by step instructions helps you. This are the
steps I needed to set up a 2 node HA/LB cluster like this schema
http://www.ultramonkey.org/3/topologies/sl-ha-lb-eg.html
It works on CentOS 4.5 with HA v2 style.

By the way: Thanks to all who helped me!


I thought that it could be useful for other people to know
how it works or where the stumbling blocks are located.
But excuse me for my bad english :)

In the following I summarise the particular steps:
(Everything is to do on both nodes!)

First update (or install) your heartbeat to the latest version.
With RedHat or CentOS this is more than easy with yum.
It will get all dependancies, too!

# yum list heartbeat heartbeat-gui heartbeat-devel \
        heartbeat-pils heartbeat-stonith heartbeat-ldirectord
Installed Packages
  heartbeat.i386                        2.1.2-3.el4.centos      installed
  heartbeat-gui.i386            2.1.2-3.el4.centos      installed
  heartbeat-ldirectord.i386     2.1.2-3.el4.centos      installed
  heartbeat-pils.i386           2.1.2-3.el4.centos      installed
  heartbeat-stonith.i386        2.1.2-3.el4.centos      installed
Available Packages
  heartbeat.i386                        2.1.3-3.el4.centos      extras
  heartbeat-gui.i386            2.1.3-3.el4.centos      extras
  heartbeat-devel.i386          2.1.3-3.el4.centos      extras
  heartbeat-ldirectord.i386     2.1.3-3.el4.centos      extras
  heartbeat-pils.i386           2.1.3-3.el4.centos      extras
  heartbeat-stonith.i386        2.1.3-3.el4.centos      extras
# yum remove heartbeat-gui              // Who needs this? ;)
# yum install heartbeat-devel           // Just to try out ...
# yum update heartbeat heartbeat-devel heartbeat-pils \
        heartbeat-stonith heartbeat-ldirectord
# rpm -qa | grep heartbeat
 heartbeat-2.1.3-3.el4.centos
 heartbeat-devel-2.1.3-3.el4.centos
 heartbeat-pils-2.1.3-3.el4.centos
 heartbeat-stonith-2.1.3-3.el4.centos
 heartbeat-ldirectord-2.1.3-3.el4.centos


Then update ipvsadm, too. Here I got help from the offical website
( http://www.linuxvirtualserver.org/software/ipvs.html ).
Because the kernel version in CentOS 4.5 is 2.6.9, the latest ipvs
version is 1.2.0, and therefore the latest ipvsadm version is 1.24-6
(I know this is a little bit confusing...)
Since the kernel version 2.6.10 is the ipvs version 1.2.1 included.

# up2date redhat-rpm-config rpm-build
# up2date --get-source kernel
        // That don't works for me, I just wget it from the web
# cd /path/to/kernel-2.6.9-55.EL.src.rpm
# rpm -ivh kernel-2.6.9-55.EL.src.rpm
# cd /usr/src/redhat/SPECS
# rpmbuild -bp --target=i686 kernel-2.6.spec
# cp -a /usr/src/redhat/BUILD/kernel-2.6.9/linux-2.6.9 /usr/src
# ln -s /usr/src/linux-2.6.9 /usr/src/linux
# cd /path/to/ipvsadm-1.24-6.src.rpm
# rpmbuild --rebuild ipvsadm-1.24-6.src.rpm
# rpm -Uvh /usr/src/redhat/RPMS/i386/ipvsadm-1.24-6.i386.rpm
# ipvsadm -v
 ipvsadm v1.24 2005/12/10 (compiled with popt and IPVS v1.2.0)


Then add following lines to /etc/sysctl.conf
# cat /etc/sysctl.conf
...
 net.ipv4.conf.all.arp_ignore = 1
 net.ipv4.conf.eth0.arp_ignore = 1
 net.ipv4.conf.eth1.arp_ignore = 1
 net.ipv4.conf.all.arp_announce = 2
 net.ipv4.conf.eth0.arp_announce = 2
 net.ipv4.conf.eth1.arp_announce = 2
 net.ipv4.ip_forward = 1
...
# /sbin/sysctl –p               // make changes take effect


Create a file named "/etc/sysconfig/network-scripts/ifcfg-lo:0"
that contains IP information for the VIP and its network:
# cat /etc/sysconfig/network-scripts/ifcfg-lo:0
 DEVICE=lo:0
 IPADDR=172.30.4.170    # the VIP
 NETMASK=255.255.255.255
 NETWORK=172.30.0.0
 BROADCAST=172.30.255.255
 ONBOOT=yes                     # important
 NAME=loopback
# service network restart
# ifconfig -a   // check for new device


# route                 // check for correct default gateway
# route del default eth1        // eth1 is not correct in my case
# route add default gw 172.30.0.10 eth0
# vi /etc/sysconfig/networking/devices/ifcfg-eth0  // check/add gw
# vi /etc/sysconfig/networking/devices/ifcfg-eth1  // remove gw
# service network restart


Next is to configure heartbeat:

As I found in the lvs mailing list, the LVSSyncDaemonSwap
isn't needed anymore since kernel 2.4.27 (Post by horms:
http://www.gossamer-threads.com/lists/lvs/users/18833#18833 )


# cat /root/haresources.temp
 defas1 ldirectord::ldirectord.cf 172.30.4.170/16/eth0
# python /usr/lib/heartbeat/haresources2cib.py \
        /root/haresources.temp


# cat /etc/ha.d/ha.cf
 use_logd yes
 crm on
 keepalive 5
 deadtime 15
 warntime 10
 initdead 45
 udpport 694
 bcast eth1
 serial /dev/ttyS0
 baud 115200
 node defas1 defas2


# cat /etc/ha.d/authkeys
 auth 1
 1 sha1 Hello world, nice weather! :)


# cat /etc/logd.cf
 debugfile /var/log/ha-debug
 logfile /var/log/ha-log
 sendqlen 256
 recvqlen 256


# cat /etc/ha.d/ldirectord.cf
 checktimeout=5
 checkinterval=10
 autoreload=yes
 logfile="/var/log/ldirectord.log"
 quiescent=yes
 virtual=172.30.4.170:80
        fallback=127.0.0.1:80
        real=172.30.4.150:80 gate 100
        real=172.30.4.160:80 gate 75
        service=http
        request="alive.html"
        receive="I'm alive!"
        scheduler=wlc
        persistent=600
        protocol=tcp
        checktype=negotiate


# cat /path/to/htdocs/alive.html
 I'm alive!


# vi /usr/lib/ocf/resource.d/heartbeat/ldirectord
        // change the config file path to /etc/ha.d/ldirectord.cf


# cat /etc/group | grep hacl            //check for user and group
 haclient:x:90:root
# cat /etc/passwd | grep hacl
 hacluster:x:90:90::/var/lib/heartbeat/cores/hacluster:/bin/bash


# /etc/init.d/heartbeat start
        // wait a minute to startup and stabilize


# cibadmin -Ql > local.xml
# vi local.xml
        // change the class of ldirectord from heartbeat to ocf
<primitive class="ocf" provider="heartbeat"
        type="ldirectord" id="ldirectord">
        // add the lvs_support flag to the IPaddr attributes
 <nvpair id="IPaddr_172_30_4_170_attr_3"
        name="lvs_support" value="true"/>

# cibadmin -R -x local.xml
        // wait a few seconds...


# /etc/init.d/heartbeat stop
# service network restart
# ifconfig –a (check for lo:0)
# /etc/init.d/heartbeat start
        // wait a minute to startup and stabilize


# crm_mon -1
 ============
 Last updated: Fri Feb  8 11:44:44 2008
 Current DC: defas2 (8d083aa4-14cc-4cca-9a8c-e7308fb2743c)
 2 Nodes configured.
 1 Resources configured.
 ============

 Node: defas2 (8d083aa4-14cc-4cca-9a8c-e7308fb2743c): online
 Node: defas1 (6ca8e370-6b00-4b8c-85fe-a67da4c562ba): online

 Resource Group: group_1
        ldirectord_1      (heartbeat::ocf:ldirectord): Started defas1
        IPaddr_172_30_4_170 (heartbeat::ocf:IPaddr):     Started defas1



# ifconfig -a
        // Host 1 should have the VIP on eth0:0
        // Host 2 should have the VIP on lo:0


# ipvsadm -ln   // Only the active Host will list any useful info
 IP Virtual Server version 1.2.0 (size=4096)
 Prot LocalAddress:Port Scheduler Flags
   -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
 TCP  172.30.4.170:80 wlc persistent 600
   -> 172.30.4.160:80              Route   75     0          0
   -> 172.30.4.150:80              Local   100    0          0



It could be that stopping/failover the IPaddr isn't working correct.
In this case look at this thread:
http://www.gossamer-threads.com/lists/linuxha/users/46136#46136


I hope it was useful for you or somebody other.

Best regards,
Stephan Berlet



HELPING HEADS for Hard- and Software
-------------------------------------------------------------------------
Für Ihre Projekte entwickeln wir maßgeschneiderte Lösungen - schnell,
flexibel und direkt vor Ort. Unser eingespieltes Team an erfahrenen Hard-
und Software-Spezialisten unterstützt Sie dort, wo Sie uns brauchen.



--------------------------------------------------------------------------
SysDesign GmbH
Säntisstrasse 25
D-88079 Kressbronn am Bodensee

Geschäftsführer: Franz Kleiner, Achim Solle
Handelsregister: Ulm 632138
--------------------------------------------------------------------------

_______________________________________________
Linux-HA mailing list
Linux-HA@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to