mach_down.in

来自「linux集群服务器软件代码包」· IN 代码 · 共 60 行

IN
60
字号
#!/bin/sh##	This script will only work for a two machine setup...#	More than that and you need to vote, or something...##prefix=@prefix@exec_prefix=@exec_prefix@. @sysconfdir@/ha.d/shellfuncs: Now running $0: $*mdown=`echo $1 | tr [A-Z] [a-z]`; # The name of the downed machine...#ha_log "info: DEBUG: $0 -- taking resources for $mdown"case $mdown in  $HA_CURHOST)	exit 0;;	# Oh No!  It's us!esaccase $HA_info in  *ping*)	exit 0;;esac##	In the case of nice_failback, we may know that we#	already own these resources, but we ignore that fact#	and take it over anyway, because getting that information#	to us would require another environment variable or something#	like that which would be a pain.#for groupkey in `$HA_BIN/ResourceManager listkeys $mdown`do  ha_log "info: Taking over resource group $groupkey"  $HA_BIN/ResourceManager takegroup $groupkeydone# Be nice_failback compliant :)# case 1 - part 2## This code triggers actions inside heartbeat, because we receive our own# resource messages as well as those sent by others...## This code shouldn't be executed if we aren't running nice_failback...##	The field info=mach_down tells heartbeat that the message is from us#	so it can consider the takeover complete.#case $HA_NICEFAILBACK in  [Yy]es)    ha_log "info: $0: nice_failback: foreign resources acquired"  	ha_clustermsg <<-!MSG	t=resource	rsc_hold=foreign	info=mach_down	!MSG    ;;esac# The CTS testing code needs to know when this is really done ;-)ha_log "info: mach_down takeover complete for node $mdown."

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?