Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 925103 Details for
Bug 1128051
QPID-5975: HA extra/missing messages when running qpid-txtest2 in a loop with failover.
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
ha script to kill & wait for cluster
ha (text/plain), 2.28 KB, created by
Alan Conway
on 2014-08-08 07:37:21 UTC
(
hide
)
Description:
ha script to kill & wait for cluster
Filename:
MIME Type:
Creator:
Alan Conway
Created:
2014-08-08 07:37:21 UTC
Size:
2.28 KB
patch
obsolete
>#!/bin/bash ># ># HA commands for managing a cluster. ># > ># Configuration >VIRTUAL_IP=20.0.20.200 >NODES="20.0.10.33 20.0.10.34 20.0.10.35" >PRIMARY_SERVICE=qpidd-primary-service > >NODES_A=($NODES) >NODE0=${NODES_A[0]} >NODE_COUNT=${#NODES_A[@]} > ># Run ha_stat and compare the output to the content of file $1. ># If the same, return 1, if different replace $1 with the new status ># and return 0 >ha_status_change() { > stat1=$1 # File containing previous status > stat2=$(mktemp) > ha_stat &> $stat2 > RET=1 > if ! diff -q $stat1 $stat2 &> /dev/null; then > cp $stat2 $stat1 > RET=0 > fi > rm $stat2 > return $RET >} > >ha_stat() { > while getopts "cq" opt; do > case $opt in > c) ssh root@$NODE0 clustat; echo;; > ?) return 1;; > esac > done > shift $((OPTIND - 1)) > for node in $NODES; do > echo $node $(qpid-ha -b $node status) > done >} > >ha_wait() { > local TEST=true TIMEOUT=60 > local usage="ha wait [N] >Wait for at least N brokers to be in active or ready state. >If no N specified wait for all brokers. >-a : wait for an active broker >-p : print number of active brokers >-t TIMEOUT: give up after TIMEOUT seconds (default $TIMEOUT)" > while getopts "apt:" opt; do > case $opt in > a) TEST="grep -q active";; > p) PRINT=1;; > t) TIMEOUT=$OPTARG;; > ?) echo "$usage"; return 1;; > esac > done > shift $((OPTIND - 1)) > N=${1:-$NODE_COUNT} > stat=$(mktemp) > ha_stat &> $stat > date; cat 1>&2 $stat > start=$(date +%s) > until [ $(egrep '(active|ready)' $stat | wc -l) -ge $N ] && $TEST $stat; do > while ! ha_status_change $stat; do > sleep .01; > now=$(date +%s) > [ $((now-start)) -gt $TIMEOUT ] && { > cat 1>&2 $stat; > echo ha_wait timed out 1>&2; > return 1; > } > done > date; cat 1>&2 $stat > done > echo Waited $(($(date +%s) - start)) seconds. 1>&2 > test "$PRINT" && egrep '(active|ready)' $stat | wc -l # Print the number of ready nodes > rm $stat > return 0 >} > >ha_primary() { > set -o pipefail > ha stat | grep active | awk '{ print $1}' > set +o pipefail >} > >ha_kill() { > SIG=-9 > case $1 in > -*) SIG=$1; shift;; > esac > HOST=${1:-$(ha-primary)} || { echo "No primary"; return 1; } > echo Kill $HOST $(date) > ssh -lroot $HOST killall $SIG qpidd >} > ># Main >if [ $(basename $0) = ha ]; then > CMD=$1; shift > "ha_$CMD" "$@" >fi
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1128051
:
925103
|
931976
|
932450
|
932785