Support Questions

Find answers, ask questions, and share your expertise

Hive metastore log files are not getting cleaned up automatically in CDP

avatar
Explorer

-rw-r--r--.  1 hive hive 209715489 Jan  20 23:21 hadoop-cmf-hive-HIVEMETASTORE-masternode3.phenoix.test.com.log.out.2021-01-20-5
-rw-r--r--.  1 hive hive 209715610 Jan  21 04:31 hadoop-cmf-hive-HIVEMETASTORE-masternode3.phenoix.test.com.log.out.2021-01-21-1
-rw-r--r--.  1 hive hive 209715215 Jan  21 09:38 hadoop-cmf-hive-HIVEMETASTORE-masternode3.phenoix.test.com.log.out.2021-01-21-2
-rw-r--r--.  1 hive hive 209715271 Jan  21 14:43 hadoop-cmf-hive-HIVEMETASTORE-masternode3.phenoix.test.com.log.out.2021-01-21-3
-rw-r--r--.  1 hive hive 209715387 Jan  21 19:50 hadoop-cmf-hive-HIVEMETASTORE-masternode3.phenoix.test.com.log.out.2021-01-21-4
-rw-r--r--.  1 hive hive 209715339 Jan  22 00:54 hadoop-cmf-hive-HIVEMETASTORE-masternode3.phenoix.test.com.log.out.2021-01-22-1
-rw-r--r--.  1 hive hive 209715439 Jan  22 05:55 hadoop-cmf-hive-HIVEMETASTORE-masternode3.phenoix.test.com.log.out.2021-01-22-2
-rw-r--r--.  1 hive hive 209715509 Jan  22 11:08 hadoop-cmf-hive-HIVEMETASTORE-masternode3.phenoix.test.com.log.out.2021-01-22-3
-rw-r--r--.  1 hive hive 209715418 Jan  22 18:08 hadoop-cmf-hive-HIVEMETASTORE-masternode3.phenoix.test.com.log.out.2021-01-22-4
-rw-r--r--.  1 hive hive 209715222 Jan  22 23:20 hadoop-cmf-hive-HIVEMETASTORE-masternode3.phenoix.test.com.log.out.2021-01-22-5
-rw-r--r--.  1 hive hive 209715221 Jan  23 04:14 hadoop-cmf-hive-HIVEMETASTORE-masternode3.phenoix.test.com.log.out.2021-01-23-1
-rw-r--r--.  1 hive hive 209715565 Jan  24 09:10 hadoop-cmf-hive-HIVEMETASTORE-masternode3.phenoix.test.com.log.out.2021-01-24-2
-rw-r--r--.  1 hive hive 209715318 Jan  24 14:34 hadoop-cmf-hive-HIVEMETASTORE-masternode3.phenoix.test.com.log.out.2021-01-24-3
-rw-r--r--.  1 hive hive 209715298 Jan  24 19:37 hadoop-cmf-hive-HIVEMETASTORE-masternode3.phenoix.test.com.log.out.2021-01-24-4
-rw-r--r--.  1 hive hive 209715216 Jan  26 01:07 hadoop-cmf-hive-HIVEMETASTORE-masternode3.phenoix.test.com.log.out.2021-01-26-1
-rw-r--r--.  1 hive hive 209715561 Jan  26 06:36 hadoop-cmf-hive-HIVEMETASTORE-masternode3.phenoix.test.com.log.out.2021-01-26-2

 

This is further occupying lot of disk space, could you please help?

1 ACCEPTED SOLUTION

avatar
Expert Contributor

Hey @saurabh707 

 

Could you please try the below:

 

Update hive log4j configs through CM 
Hive on Tez -> Configuration -> HiveServer2 Logging Advanced Configuration Snippet (Safety Valve)
Hive  -> Configuration -> Hive Metastore Server Logging Advanced Configuration Snippet (Safety Valve)

Add the following to config:

appender.DRFA.strategy.action.type=DELETE
appender.DRFA.strategy.action.basepath=${log.dir}
appender.DRFA.strategy.action.maxdepth=1
appender.DRFA.strategy.action.PathConditions.glob=${log.file}.*
appender.DRFA.strategy.action.PathConditions.type=IfFileName
appender.DRFA.strategy.action.PathConditions.nestedConditions.type=IfAccumulatedFileCount
appender.DRFA.strategy.action.PathConditions.nestedConditions.exceeds=10

 

Let me know if the above addresses it.

View solution in original post

2 REPLIES 2

avatar
Expert Contributor

Hey @saurabh707 

 

Could you please try the below:

 

Update hive log4j configs through CM 
Hive on Tez -> Configuration -> HiveServer2 Logging Advanced Configuration Snippet (Safety Valve)
Hive  -> Configuration -> Hive Metastore Server Logging Advanced Configuration Snippet (Safety Valve)

Add the following to config:

appender.DRFA.strategy.action.type=DELETE
appender.DRFA.strategy.action.basepath=${log.dir}
appender.DRFA.strategy.action.maxdepth=1
appender.DRFA.strategy.action.PathConditions.glob=${log.file}.*
appender.DRFA.strategy.action.PathConditions.type=IfFileName
appender.DRFA.strategy.action.PathConditions.nestedConditions.type=IfAccumulatedFileCount
appender.DRFA.strategy.action.PathConditions.nestedConditions.exceeds=10

 

Let me know if the above addresses it.

avatar
Explorer

Thank you for the help Tushar-san , 

understood, we can update log4j property