hi everybody!

    I have some questions about corosync-cfgtool
   
    1. What should I do when "corosync-cfgtool -s" return "Could not initialize corosync configuration API error" ? Restart corosync ?(I don't think it's a good idea)

    2. How can the process happen automatically when network problems is repaired, instead of using "corosync-cfgtool -r" manually?



    My testing environment is :
    2 PC (on virtualbox-3.2.12)
    Double network card and double heart-beat link(eth0 and eth1)
    OS: RHEL 5.3 x86
    primary rpms: corosync-1.3.0 and pacemaker-1.0.10
    corosync.conf:(relevant portion)
   
        compatibility: whitetank

        totem {
                version: 2
                secauth: off
                threads: 0
                rrp_mode: active
                interface{
                        ringnumber:0
                        bindnetaddr:10.10.10.0
                        mcastaddr:235.3.4.5
                        mcastport:9876
                        }
                interface{
                        ringnumber:1
                        bindnetaddr:20.20.20.0
                        mcastaddr:235.3.4.6
                        mcastport:9877
                }       
        }



   
    When something bad happen on one of the double-heart-beat-link
    --------just like: ifdown eth0, or pull out one of the netting twine-----

    I use:(ifdown eth1 before)
        corosync-cfgtool -s
    found that:
        Printing ring status.
        Local node ID 185207306
        RING ID 0
        id    = 10.10.10.11
        status    = ring 0 active with no faults
        RING ID 1
        id    = 20.20.20.11
        status    = Marking seqid 14089 ringid 1 interface 20.20.20.11 FAULTY - adminisrtative intervention required.
    then:
        ifup eth1
    and:
        corosync-cfgtool -r

    The problem is repaired.

    BUT, I want this process happen automatically when network problems is repaired, I write this shell, and start it when service corosync start:

 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    #!/bin/bash
    local_is_down=0
    ip_res=`corosync-cfgtool -s|grep id|awk '{print $3}'`
    while [ -z "$ip_res" ]
    do
            sleep 5
            ip_res=`corosync-cfgtool -s|grep id|awk '{print $3}'`
    done

    ip_num=`corosync-cfgtool -s|grep "no faults"|wc -l`

    while true
    do
            sleep 10
            res=`corosync-cfgtool -s`
            echo "$res" |grep FAULTY &> /dev/null
            if [ "$?" -ne 0 ];then
                    tmp_num=`echo "$res"|grep "no faults"|wc -l`
                    if [ "$tmp_num" -eq "$ip_num" ];then
                            local_is_down=0
                    else
                             continue
                     fi
            else
             mii-tool |grep "no link" &> /dev/null  
                    if [ $? -eq 0 ];then
                           local_is_down=1         #pull out one of the netting twine
                    else
                           for IP in $ip_res
                           do
                                   ifconfig|grep "$IP" &> /dev/null            
                                   if [ $? -ne 0 ];then
                                           local_is_down=1    #ifdown
                                    fi
                            done
                       fi

                          if [ $local_is_down -eq 1 ];then
                              corosync-cfgtool -r &> /dev/null
                       fi
             fi
    done &
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    The shell works well mostly, however, it does not work sometimes because command "corosync-cfgtool -s" return
    "Could not initialize corosync configuration API error 6"

and the pacemaker process seems also done.


 THANKS!
_______________________________________________
Pacemaker mailing list: Pacemaker@oss.clusterlabs.org
http://oss.clusterlabs.org/mailman/listinfo/pacemaker

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker

Reply via email to