How To Enable Metastore(MYSQL) Debugging in Hive

Blog Post created by prakhar Employee on Dec 5, 2016

Sometimes when you suspect there is some issue with Hive metastore for eg. getting data nucleus messages in error logs, or issues related to locks you must require metastore logs to drill down to the issue.


Below are the steps to enable Metastore Debugging


1. Add below entry to /etc/my.cnf under [mysqld] section:



          If file was not there you can create it as given below

                  touch /var/log/mysql.general.log
                  chown mysql.mysql /var/log/mysql.general.log


2.Restart the mysql server


          /etc/init.d/mysqld restart


3. Enable hive debugging.


Create the log4j property file if its not there using the template:

$ mv /opt/mapr/hive/hive-0.12/conf/ /opt/mapr/hive/hive-0.12/conf/


4.Add below entries to /opt/mapr/hive/hive-0.12/conf/




5.Restart hive hivemeta service.


$ maprcli node services -name hivemeta -action restart -nodes `hostname`


6. Logs will be created at  /var/log/mysql.general.log