#!/bin/bash
#启动时,日志输出到~/log下
#hiveserver2的位置修改
if [ $# -lt 1 ]
then
echo "No Args Input..."
exit ;
fi
case $1 in
"start")
echo " =================== 开启hiveserver2 ==================="
ssh chen "nohup sh /opt/module/hive/bin/hiveserver2 > /home/hadoop/log/hiveserver2.log 2>&1 &"
;;
"stop")
echo " =================== 关闭 hiveserver2 ==================="
ssh chen "ps -ef | grep 'hiverserver2' | grep -v grep |awk '{print $2}' | xargs kill -9"
;;
*)
echo "Input Args Error..."
;;
esac



