hiveserver2 发生gc以后导致远程jdbc连接hive会连接超时,解决办法
在hive-env.sh中修改HS2Heapsize的大小
在hive/bin/hive脚本里修改
# 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