我在hadoop 2.6.0上安装了hive 0.14。
设置主要涉及提取tar.bin文件。
我按照本指南进行设置。
http://www.ishaanguliani.com/content/hive-0140-setup-ubuntu
我使用命令行启动hiveserver2:
( $HIVE_HOME/bin/hiveserver2 &> hiveserver.log & )
现在,我想知道什么是适当的停止hiveserver2。我可以杀了它,但我怀疑它提供了一个优雅的退出。
答案 0 :(得分:2)
编写一个小的shell脚本来查找hiveserver2进程并将其停止。我使用下面的shell脚本来阻止hiveserver2和hive Metastore进程。希望这会有所帮助。
hive2_pid=`pgrep -f org.apache.hive.service.server.HiveServer2`
if [[ -n "$hive2_pid" ]]
then
echo "Found hivesevrer2 PID-- "$hive2_pid
kill $hive2_pid
# if process is still around, use kill -9
if ps -p $hive2_pid > /dev/null ; then
echo "Initial kill failed, killing with -9 "
kill -9 $hive2_pid
fi
echo "Hive server2 stopped successfully"
else
echo "Hiveserver2 process not found , HIveserver2 is not running !!!"
fi
meta_pid=`pgrep -f org.apache.hadoop.hive.metastore.HiveMetaStore`
if [[ -n "$meta_pid" ]]
then
echo "Found hivesevrer2 PID-- "$meta_pid
kill $meta_pid
# if process is still around, use kill -9
if ps -p $meta_pid > /dev/null ; then
echo "Initial kill failed, killing with -9 "
kill -9 $meta_pid
fi
echo "Hive metastore stopped successfully"
else
echo "Hive metastore process not found , Hive metastore is not running !!!"
fi
答案 1 :(得分:-1)