This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
galaxy-deployment-ansible-d…/Apache Hadoop/2.7.1/yarn/role/templates/daemonscript/keepyarnmaster.j2

41 lines
816 B
Plaintext
Raw Normal View History

#!/bin/bash
#
# netconsole This loads the netconsole module with the configured parameters.
#
# chkconfig:123456 40 60
# description: keepyarnmaster
source /etc/profile
PRO_NAME=keepyarnmaster
INS_DIR={{ deploy_dir }}
#版本
VERSION={{ hadoop_version }}
case $1 in
start)
master=`ps -ef | grep "dae-yarnmaster.sh" | grep -v grep | wc -l`
if [ $master -lt 1 ];then
nohup $INS_DIR/$VERSION/sbin/dae-yarnmaster.sh > /dev/null 2>&1 &
fi
;;
stop)
HAS_KEEP_SHELL=`ps -ef | grep "dae-yarnmaster.sh" | grep -v grep | awk '{print $2}'`
if [ $HAS_KEEP_SHELL ];then
echo "守护进程PID$HAS_KEEP_SHELL"
kill -9 $HAS_KEEP_SHELL
fi
sh $INS_DIR/$VERSION/sbin/yarn-daemon.sh stop resourcemanager > /dev/null
;;
status)
yarn rmadmin -getServiceState rsm1
;;
* )
echo "use keepyarnmaster [start|stop|status]"
;;
esac