hiveserver2 发生gc以后导致远程jdbc连接hive会连接超时,解决办法
在hive-env.sh中修改HS2Heapsize的大小,相当于设置-Xmx,最大内存
在hive/bin/hive脚本里修改 -Xms 相当于最小内存
# to initialize logging for all services
# export HADOOP_CLIENT_OPTS="$HADOOP_CLIENT_OPTS -Dlog4j.configurationFile=hive-log4j2.properties "
if [ x$SERVICE == x"metastore" ]; then
export HADOOP_CLIENT_OPTS="$HADOOP_CLIENT_OPTS -Dlog4j.configurationFile=hive-metastore-log4j2.properties "
#新加内容
elif [ x$SERVICE == x"hiveserver2" ]; then
export HADOOP_CLIENT_OPTS="$HADOOP_CLIENT_OPTS -Xms12g -Dlog4j.configurationFile=hive-log4j2.properties "
else
export HADOOP_CLIENT_OPTS="$HADOOP_CLIENT_OPTS -Dlog4j.configurationFile=hive-log4j2.properties "
fi
然后再重启hiveserver2
过程中,可以用ps -ef|grep ,和jinfo 来查看启动起来hiveserver2所占用的内存