Hi,

On Wed, Nov 23, 2011 at 08:52:43AM +1100, Andrew Beekhof wrote:
> On Wed, Nov 23, 2011 at 4:05 AM, Dejan Muhamedagic <[email protected]> 
> wrote:
> > On Tue, Nov 22, 2011 at 04:44:50PM +0100, [email protected] wrote:
> >> Hi again,
> >>
> >> that's strange because I did tests around this parameter
> >> LRMD_MAX_CHILDREN,
> >> with 24 Dummy resources, therefore resources which do quite nothing and so
> >> Pacemaker
> >> should start all resources at quite the same time one after the other.
> >> Then monitor op
> >> should also be quite at the same time one after the other.
> >> First, I test with no  LRMD_MAX_CHILDREN in /etc/sysconfig/pacemaker so
> >> default value
> >> which is probably 4 as you told me, then  I set it to 2, restart Pacemaker
> >> and did same test,
> >> and finally set it to 24 (just for a school case) and did the same test .
> >> And the result is the same for the three tests :
> >> when all the 24 Dummy resources are started , as you can see below,
> >> the op monitor seems to be gathered by 4, whatever is the
> >> LRMD_MAX_CHILDREN value,
> >> whereas my understanding was the monitor operations should have been
> >> parallelized for
> >> almost the 24 resources as the monitor takes a very short while to be
> >> completed ...
> >
> >> Where am I wrong ?
> >
> > It could be that the init script on your platform doesn't
> > support this parameter. You should talk to your vendor.
> 
> Init script?  Doesn't the lrmd just look for that variable in its environment?

No, it doesn't. lrmadmin has to be used to set the parameter:

lrmadmin -p max-children $LRMD_MAX_CHILDREN

Thanks,

Dejan

P.S. Attached suse openais init script.

> _______________________________________________
> Linux-HA mailing list
> [email protected]
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems
#!/bin/bash
#
# Corosync daemon init script for LSB-compliant Linux distributions.
#
# openais       Start the openais (corosync) cluster service
#
# chkconfig: - 20 20
# processname:  corosync
# pidfile:      /var/run/corosync.pid
# description:  Corosync/OpenAIS
### BEGIN INIT INFO
# Description: Manages the openais cluster services.
#
# Short-Description: openais cluster services.
# Provides: openais
# Required-Start: $network
# Should-Start: $syslog sshd drbd $named $remote_fs logd xendomains xend iscsi 
libvirtd
# Required-Stop: $network
# Default-Start: 3 5
# Default-Stop: 0 6
# Should-Stop: $syslog sshd drbd $named $remote_fs logd xendomains xend iscsi 
libvirtd
### END INIT INFO

do_force=0
prog="corosync"
exec="/usr/sbin/corosync"
lockfile="/var/lock/subsys/$prog"

OPENAIS_SYSCONFIG=/etc/sysconfig/openais
if [ -f $OPENAIS_SYSCONFIG ]; then
        . $OPENAIS_SYSCONFIG
fi
PACEMAKER_SYSCONFIG=/etc/sysconfig/pacemaker
if [ -f $PACEMAKER_SYSCONFIG ]; then
        . $PACEMAKER_SYSCONFIG
fi
LRMADMIN="/usr/sbin/lrmadmin"

SBD_CONFIG=/etc/sysconfig/sbd
SBD_BIN="/usr/sbin/sbd"
if [ -f $SBD_CONFIG ]; then
        . $SBD_CONFIG
fi

[ -x "$exec" ] || exit 0

SBD_DEVS=${SBD_DEVICE%;}
SBD_DEVICE=${SBD_DEVS//;/ -d }

StartSBD() {
        test -x $SBD_BIN || return
        if [ -n "$SBD_DEVICE" ]; then
                if ! pidofproc $SBD_BIN >/dev/null 2>&1 ; then
                        echo -n "Starting SBD - "
                        if ! $SBD_BIN -d $SBD_DEVICE -D $SBD_OPTS watch ; then
                                echo "SBD failed to start; aborting."
                                exit 1
                        fi
                fi
        fi
}

StopSBD() {
        test -x $SBD_BIN || return
        if [ -n "$SBD_DEVICE" ]; then
                echo -n "Stopping SBD - "
                if ! $SBD_BIN -d $SBD_DEVICE -D $SBD_OPTS message LOCAL exit ; 
then
                        echo "SBD failed to stop; aborting."
                        exit 1
                fi
        fi
        while pidofproc $SBD_BIN >/dev/null 2>&1 ; do
                sleep 1
        done
        echo -n "done "
}

wait_for_lrmd() {
        local maxwait=30
        local i=0
        while [ $i -lt $maxwait ]; do
                $LRMADMIN -C > /dev/null 2>&1 &&
                        break
                sleep 1
                i=$(($i+1))
        done
        if [ $i -lt $maxwait ]; then
                return 0
        else
                echo "lrmd apparently didn't start"
                return 1
        fi
}
set_lrmd_options() {
        test -x $LRMADMIN || return
        if [ -n "$LRMD_MAX_CHILDREN" ]; then
                wait_for_lrmd || return
                $LRMADMIN -p max-children $LRMD_MAX_CHILDREN
        fi
}

internal_status() {
    checkproc $exec > /dev/null 2>&1
    return $?
}

status() {
        if internal_status; then
                echo "Running"
                return 0
    else
                echo "Stopped"
                return 7
        fi
}

start() {
    export COROSYNC_DEFAULT_CONFIG_IFACE
    : 
${COROSYNC_DEFAULT_CONFIG_IFACE="openaisserviceenableexperimental:corosync_parser"}
    echo -n $"Starting OpenAIS/Corosync daemon ($prog): "
    if ! internal_status; then
        StartSBD
        echo -n "starting... "
        startproc $exec
    fi

    sleep 2 # give it time to fail... $? isn't definitive

    if internal_status; then
        set_lrmd_options
        echo "OK"
    touch "$lockfile"
        return 0
    fi

    echo "Failed"
    return 1
}

do_force=0
do_forever=1

stop() {
    local waitcount=0
    local iter=0
    local stopsbd=1
    local sig=TERM
    echo -n $"Stopping OpenAIS/corosync daemon ($prog): "

    while internal_status; do
        if [ $waitcount -eq 0 ]; then
           c_pid="`pidofproc $exec`"
           if [ $iter -gt 0 ]; then
              if [ $do_force = 1 ]; then
                 echo -n " Escalating... "
                 sig=KILL
                 # Do not stop SBD if we forcibly killed corosync; other
                 # nodes may still have a legitimate desire to STONITH us.
                 stopsbd=0
              fi
              if [ $do_forever = 0 ]; then
                 echo "Failed"
                 return 1
              fi
           fi
           # Start a new cycle:
           kill -$sig $c_pid
           waitcount=0
           iter=$[iter+1]
        fi

        waitcount=$[waitcount+1]
        echo -n "."
        sleep 2
    done

    if [ $stopsbd = 1 ]; then
        StopSBD
    fi

    rm -f "$lockfile"
    echo "OK"
    return 0
}

restart() {
    stop
    start
}

case "$1" in
    start|stop|restart)
        $1
        ;;
    force-stop)
        do_force=1
        stop
        ;;
    reload|force-reload)
        restart
        ;;
    condrestart|try-restart)
        [ ! -f "$lockfile" ] || restart
        ;;
    status)
        status $prog
        ;;
    *)
        echo $"Usage: $0 
{start|stop|restart|try-restart|condrestart|reload|force-reload|force-stop|status}"
        exit 2
esac
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to