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/hdfs/role/templates/daemonscript/keephdfsjournal.j2

48 lines
943 B
Plaintext
Raw Normal View History

#!/bin/bash
#
# netconsole This loads the netconsole module with the configured parameters.
#
# chkconfig:123456 40 60
# description: keephdfsjournal
source /etc/profile
PRO_NAME=keephdfsjournal
INS_DIR={{ deploy_dir }}
#版本
VERSION={{ hadoop_version }}
case $1 in
start)
journal=`ps -ef | grep dae-hdfsjournal.sh | grep -v grep | wc -l`
if [ $journal -lt 1 ];then
nohup $INS_DIR/$VERSION/sbin/dae-hdfsjournal.sh > /dev/null 2>&1 &
fi
;;
stop)
HAS_KEEP_SHELL=`ps -ef | grep dae-hdfsjournal.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/hadoop-daemon.sh stop journalnode > /dev/null
;;
status)
num=`ps -ef | grep JournalNode | grep -v grep | wc -l`
if [ "$num" -eq "1" ];then
echo "JournalNode进程已启动"
else
echo "JournalNode进程未启动"
fi
;;
* )
echo "use keephdfsjournal [start|stop|status]"
;;
esac