hiveServer2和metaStore启动脚本
参数为:start、stop、restart、status
start:启动 metastore 和 hiveserver2 服务
stop:关闭 metastore 和 hiveserver2 服务
restart:重启 metastore 和 hiveserver2 服务
status:查看 metastore 和 hiveserver2 服务状态
#!/bin/bash
HIVE_LOG_DIR=$HIVE_HOME/logs
mkdir -p $HIVE_LOG_DIR
#检查进程是否运行正常,参数1为进程名,参数2为进程端口
function check_process()
{
pid=$(ps -ef 2>/dev/null | grep -v grep | grep -i $1 | awk '{print $2}')
ppid=$