Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Community Articles

Find and share helpful community-sourced technical articles.
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!
Labels (1)
avatar
Expert Contributor

By default the GC logs are not enabled for Hive components. It is good to enable them to troubleshoot GC pauses on hiveserver2 instances.

---------------------------------

Hiveserver2 / Metastore:

---------------------------------

In Ambari navigate to the following path

Services -- > Hive -- > Configs -- > Advanced --> Advanced hive-env --> hive-env template

Add the following lines at the beginning,

if [[ "$SERVICE" == "hiveserver2" || "$SERVICE" == "metastore" ]]; then

HIVE_SERVERS_GC_LOG_OPTS="-Xloggc:{{hive_log_dir}}/gc.log-$SERVICE-`date +'%Y%m%d%H%M'` -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps"

export HADOOP_OPTS="$HADOOP_OPTS $HIVE_SERVERS_GC_LOG_OPTS"

fi

---------------------------------

Webhact :

---------------------------------

In Ambari navigate to the following path

Services -- > Hive -- > Configs -- > Advanced --> Advanced webhcat-env --> webhcat-env template

Add the following lines at the bottom,

WEBHACAT_GC_LOG_OPTS="-Xloggc:{{templeton_log_dir}}/gc.log-webhcat-`date +'%Y%m%d%H%M'` -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps"

export HADOOP_OPTS="$HADOOP_OPTS $WEBHACAT_GC_LOG_OPTS"

Save the changes in ambari and restart the hive services , it will enable the GC logs writing at the restart.

Thanks for the following articles. I changed the GC file name similar to namenode GC logs and kept all the GC variables in single parameter for simplicity.

https://community.hortonworks.com/content/supportkb/49404/how-to-setup-gc-log-for-hiveserver2.html

http://stackoverflow.com/questions/39888681/how-to-enable-gc-logging-for-apache-hiveserver2-metastor...

5,507 Views
Version history
Last update:
‎08-27-2020 12:26 PM
Updated by:
Contributors