tf.transpose 函数说明和用法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/raintungli/article/details/79139706
#!/bin/bash

# home for hive


readonly PROGDIR=$(readlink -m $(dirname $0))


HIVE_HOME=$PROGDIR/..
HIVE_STOP_WAIT_TIME=2

start() {
	PID=`ps -ef | grep org.apache.hadoop.hive.metastore.HiveMetaStore | grep -v 'grep' | awk '{print $2}'`
	if [ ! "$PID" = ""  ]; then	
		echo "Flume has been started. PID:$PID"
	else
		nohup $HIVE_HOME/bin/hive --hiveconf hive.root.logger=INFO,DRFA --hiveconf hive.log.dir=$HIVE_HOME/logs --hiveconf hive.log.file=hive.log --service metastore > $HIVE_HOME/logs/hive.out 2>&1 &
		sleep ${HIVE_STOP_WAIT_TIME}
		RUN=`ps -ef | grep org.apache.hadoop.hive.metastore.HiveMetaStore | grep -v 'grep'| wc -l`
		if [ $RUN != 1 ]; then
			echo "Hive process is not running"
		else
			echo "Hive is started."
		fi
	fi
}

stop() {
	PID=`ps -ef | grep org.apache.hadoop.hive.metastore.HiveMetaStore | grep -v 'grep' | awk '{print $2}'`
	if [ ! "$PID" = ""  ]; then	
		echo "Hive has been started. PID:$PID"
		kill -TERM ${PID} &>/dev/null
		
		sleep ${HIVE_STOP_WAIT_TIME}

		RUN=`ps -ef | grep org.apache.hadoop.hive.metastore.HiveMetaStore | grep -v 'grep'| wc -l`
		if [ $RUN != 0 ]; then
			kill -9 ${PID} &>/dev/null
		fi
		echo "Hive is stopped."
	else
		echo "Hive is not start."
	fi
}

restart() {
	stop
	sleep 1
	start
}


case $1 in
	start) start;;
	stop) stop;;
	restart) restart;;
	*) echo "usage: $0 start|stop|restart";;
esac
exit 0





阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页