Hello Thomas and all,

I Configured High availability for Squid in 2 nodes. I Tested with that setup for apache and it works fine. When i modify that same setup for squid i got the following error. HA gets started at the first time. When i stop the squid service in that primary node i got that error. I attached the files for reference.

Any Idea about that?

OS : Fedore 7
HA Version : 2.1.2
Squid Version : Squid 26 Stable 16

Error:
============
Last updated: Mon Jan  7 09:21:02 2008
Current DC: squid-1.kovaiteam.com (e0083465-ae84-4949-be8a-62d80ce20236)
2 Nodes configured.
1 Resources configured.
============

Node: squid-2.mydomain.com (01efc983-be1e-4ab2-9142-a5cc030cbd85): online
Node: squid-1.mydomain.com (e0083465-ae84-4949-be8a-62d80ce20236): online

Full list of resources:

Resource Group: group_1
IPaddr_172_16_1_100 (heartbeat::ocf:IPaddr): Started squid-1.mydomain.com squid_2 (heartbeat:squid): Started squid-1.mydomain.com (unmanaged) FAILED

Failed actions:
   squid_2_stop_0 (node=squid-1.mydomain.com, call=8, rc=1): Error

Thanks,
Jayaprakash S
#!/bin/sh
#
VARRUN=/var/run

. ${OCF_ROOT}/resource.d/heartbeat/.ocf-shellfuncs

PidFile=/usr/local/squid26s17/var/log/squid.pid

silent_status() {
  if
    [ -f $PidFile  ]
  then
    ProcessRunning `cat $PidFile`
  else
    : No pid file
    false
  fi
}

########################################Jagan###########################
SQLOC=/usr/local/squid26s17

# Source function library.
. /etc/rc.d/init.d/functions

PATH=${SQLOC}/sbin:/usr/bin:/sbin:/bin:/usr/sbin:$PATH
export PATH

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

# check if the squid conf file is present
[ -f ${SQLOC}/etc/squid.conf ] || exit 0

if [ -f /etc/sysconfig/squid ]; then
  . /etc/sysconfig/squid
fi

# don't raise an error if the config file is incomplete
# set defaults instead:
SQUID_OPTS=${SQUID_OPTS:-"-D"}
SQUID_PIDFILE_TIMEOUT=${SQUID_PIDFILE_TIMEOUT:-20}
SQUID_SHUTDOWN_TIMEOUT=${SQUID_SHUTDOWN_TIMEOUT:-100}

# determine the name of the squid binary
[ -f ${SQLOC}/sbin/squid ] && SQUID=squid
[ -z "$SQUID" ] && exit 0

prog="$SQUID"

# determine which one is the cache_swap directory
CACHE_SWAP=`sed -e 's/#.*//g' ${SQLOC}/etc/squid.conf | \
        grep cache_dir |  awk '{ print $3 }'`
[ -z "$CACHE_SWAP" ] && CACHE_SWAP=${SQLOC}/var/cache

RETVAL=0

start() {
    for adir in $CACHE_SWAP; do
        if [ ! -d $adir/00 ]; then
             echo -n "init_cache_dir $adir... "
             ocf_run $SQUID -z -F -D 2>/dev/null
             echo $?
        fi
    done

    echo -n $"Starting $prog: "

    echo "32768" > /proc/sys/fs/file-max

    ulimit -HSn 32768
#jagan
  if
    silent_status
  then
    ocf_log info "$CMD already running (pid $ApachePID)"
    return $OCF_SUCCESS
  fi
   ocf_run $SQUID $SQUID_OPTS 2> /dev/null
#end
    RETVAL=$?
    if [ $RETVAL -eq 0 ]; then


       timeout=0;
       while : ; do
          [ ! -f ${SQLOC}/var/logs/squid.pid ] || break
          if [ $timeout -ge $SQUID_PIDFILE_TIMEOUT ]; then
             RETVAL=1
             break
          fi
          sleep 1 && echo -n "."
          timeout=$((timeout+1))
       done
    fi
    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$SQUID
    [ $RETVAL -eq 0 ] && echo_success
    [ $RETVAL -ne 0 ] && echo_failure
    ocf_log info echo
    return $ec
    return $RETVAL

}

stop() {

    #echo -n  $"Stopping $prog: "
    ocf_run $SQUID -k check >/dev/null 2>&1
    RETVAL=$?
    if [ $RETVAL -eq 0 ] ; then

        ocf_run $SQUID -k shutdown &
        rm -f /var/lock/subsys/$SQUID
        timeout=0
        while : ; do
                [ -f  ${SQLOC}/var/logs/squid.pid ] || break
                if [ $timeout -ge $SQUID_SHUTDOWN_TIMEOUT ]; then
#jagan
                    return 1
                fi
                sleep 2 && ocf_log info echo -n "."
                timeout=$((timeout+2))
        done
        echo echo_success
    else
        echo echo_failure
    fi
    return $RETVAL
}

reload() {
    ocf_run $SQUID $SQUID_OPTS -k reconfigure
}

restart() {
    stop
    start
}

condrestart() {
    [ -e /var/lock/subsys/squid ] && restart || :
}

rhstatus() {
    status $SQUID
    ocf_run $SQUID -k check
}

probe() {
    return 0
}

case "$1" in
start)
    start
    ;;

stop)
    stop
    ;;

reload)
    reload
    ;;

restart)
    restart
    ;;

condrestart)
    condrestart
    ;;

status)
    rhstatus
    ;;

probe)
    exit 0
    ;;

*)
    echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}"
    exit 1
esac

exit $?

########################################End############################
<?xml version="1.0" ?>
<cib admin_epoch="0" epoch="0" num_updates="0">
	<configuration>
		<crm_config>
			<cluster_property_set id="cib-bootstrap-options">
				<attributes>
					<nvpair id="cib-bootstrap-options-symmetric-cluster" name="symmetric-cluster" value="true"/>
					<nvpair id="cib-bootstrap-options-no-quorum-policy" name="no-quorum-policy" value="stop"/>
					<nvpair id="cib-bootstrap-options-default-resource-stickiness" name="default-resource-stickiness" value="0"/>
					<nvpair id="cib-bootstrap-options-default-resource-failure-stickiness" name="default-resource-failure-stickiness" value="0"/>
					<nvpair id="cib-bootstrap-options-stonith-enabled" name="stonith-enabled" value="false"/>
					<nvpair id="cib-bootstrap-options-stonith-action" name="stonith-action" value="reboot"/>
					<nvpair id="cib-bootstrap-options-stop-orphan-resources" name="stop-orphan-resources" value="true"/>
					<nvpair id="cib-bootstrap-options-stop-orphan-actions" name="stop-orphan-actions" value="true"/>
					<nvpair id="cib-bootstrap-options-remove-after-stop" name="remove-after-stop" value="false"/>
					<nvpair id="cib-bootstrap-options-short-resource-names" name="short-resource-names" value="true"/>
					<nvpair id="cib-bootstrap-options-transition-idle-timeout" name="transition-idle-timeout" value="5min"/>
					<nvpair id="cib-bootstrap-options-default-action-timeout" name="default-action-timeout" value="15s"/>
					<nvpair id="cib-bootstrap-options-is-managed-default" name="is-managed-default" value="true"/>
				</attributes>
			</cluster_property_set>
		</crm_config>
		<nodes/>
		<resources>
			<group id="group_1">
				<primitive class="ocf" id="IPaddr_172_16_1_100" provider="heartbeat" type="IPaddr">
					<operations>
						<op id="IPaddr_172_16_1_100_mon" interval="5s" name="monitor" timeout="5s"/>
					</operations>
					<instance_attributes id="IPaddr_172_16_1_100_inst_attr">
						<attributes>
							<nvpair id="IPaddr_172_16_1_100_attr_0" name="ip" value="172.16.1.100"/>
						</attributes>
					</instance_attributes>
				</primitive>
				<primitive class="heartbeat" id="squid_2" provider="heartbeat" type="squid">
					<operations>
						<op id="squid_2_mon" interval="120s" name="monitor" timeout="60s"/>
					</operations>
				</primitive>
			</group>
		</resources>
		<constraints>
			<rsc_location id="rsc_location_group_1" rsc="group_1">
				<rule id="prefered_location_group_1" score="100">
					<expression attribute="#uname" id="prefered_location_group_1_expr" operation="eq" value="test1.kovaiteam.com"/>
				</rule>
			</rsc_location>
		</constraints>
	</configuration>
	<status/>
</cib>
_______________________________________________
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