<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Hive log rotation issue on CDH 6 in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Hive-log-rotation-issue-on-CDH-6/m-p/354974#M237035</link>
    <description>&lt;P&gt;it should be like this,&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;appender.DRFA.filePattern=&lt;STRONG&gt;${log.dir}/${log.file}.%d{yyyy-MM-dd}.%i&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;and it will be working in CDH 6.2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Oct 2022 08:07:55 GMT</pubDate>
    <dc:creator>tencentemr</dc:creator>
    <dc:date>2022-10-17T08:07:55Z</dc:date>
    <item>
      <title>Hive log rotation issue on CDH 6</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-log-rotation-issue-on-CDH-6/m-p/311978#M224915</link>
      <description>&lt;P&gt;Hi community,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have found an issue on CDH 6 with hive log rotation. In this CDH version, hive log4j changes from rotation by size (configured by cloudera manager) to rotation by size and day (RFA to DRFA).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;ISSUE&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;This change results in:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Cloudera can not remove old logs (and the FS can be filled), property "&lt;SPAN&gt;&lt;STRONG&gt;Maximum Log File Backups&lt;/STRONG&gt;" does not work properly.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;&lt;U&gt;The rotated log name changed from index to date&lt;/U&gt;,&amp;nbsp;&lt;/SPAN&gt;If we produced more logs than "&lt;SPAN&gt;&lt;STRONG&gt;Max Log Size&lt;/STRONG&gt;", we only have one file per day, so we are overwriting&amp;nbsp;this file with the new produced logs, losing the old logs on same day, and we will have X logs per day, but probably losing logs every day (huge problem when resolving issues).&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm completely&amp;nbsp;sure that is a new issue, because hive log4j configuration changes on this version.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;SOLUTION&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The solution for me was changing the "&lt;STRONG&gt;appender.DRFA.rollingPolicy.FileNamePattern&lt;/STRONG&gt;" property through Cloudera Safety Valve in Hive Server 2,&amp;nbsp; "&lt;STRONG&gt;Logging Advanced Configuration Snippet&lt;/STRONG&gt;". Adding this new line:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;appender.DRFA.rollingPolicy.FileNamePattern=${hive.log.dir}/${hive.log.file}&lt;STRONG&gt;.%i&lt;/STRONG&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;After restarting Hiver Server 2, the log rotation&amp;nbsp;&lt;SPAN&gt;behaviour changes, with this change, I only have extrictly&amp;nbsp;"&lt;STRONG&gt;Maximum Log File Backups&lt;/STRONG&gt;" files with "&lt;SPAN&gt;&lt;STRONG&gt;Max Log Size&lt;/STRONG&gt;" size,&amp;nbsp;keeping away that the FS can be filled.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;&lt;SPAN&gt;DEBUGGING&lt;/SPAN&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2" color="#808080"&gt;&lt;EM&gt;&lt;FONT face="inherit"&gt;This actions are only for &lt;/FONT&gt;debugging&lt;FONT face="inherit"&gt;&amp;nbsp;&lt;/FONT&gt;proposal&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I recommend you to check if you are using this CDH version (in my case 6.0.1) and if you have this issue too, you can validate this&amp;nbsp;&lt;SPAN&gt;behaviour&amp;nbsp;&lt;/SPAN&gt;generating more logs changing "&lt;STRONG&gt;Debug Level&lt;/STRONG&gt;" to TRACE and reducing "&lt;SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;Max Log Size&lt;/STRONG&gt;&lt;FONT face="inherit"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;STRONG&gt;Maximum&lt;/STRONG&gt;&lt;FONT face="inherit"&gt;"&amp;nbsp;to 1MB and "&lt;/FONT&gt;&lt;STRONG&gt;Log File Backups&lt;/STRONG&gt;&lt;FONT face="inherit"&gt;" to 2 and run any query on hive.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;FONT face="inherit"&gt;If your new logs are not rotated properly (hive only keep 2 new logs), more &lt;/FONT&gt;probably&lt;FONT face="inherit"&gt;&amp;nbsp;you have the same issue.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On latest versions, Cloudera adds new properties on hive log4j, probably to avoid this issue, but it keeps rotation by day, so we can experiment the issue (point 2) too. I think that rotation by day pattern is not the best option, by index is more effective, even by day and hour (hour, minute and second).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Marc Casajus&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/10491"&gt;@salimhussain&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/25689"&gt;@na&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 12:32:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-log-rotation-issue-on-CDH-6/m-p/311978#M224915</guid>
      <dc:creator>marccasajus</dc:creator>
      <dc:date>2021-02-23T12:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: Hive log rotation issue on CDH 6</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-log-rotation-issue-on-CDH-6/m-p/312131#M224997</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/20152"&gt;@marccasajus&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;Yes, this has been documented internally as a BUG (OPSAPS-53043) and is currently not fixed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, it looks you have already applied the changes which would address this.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 08:51:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-log-rotation-issue-on-CDH-6/m-p/312131#M224997</guid>
      <dc:creator>tusharkathpal</dc:creator>
      <dc:date>2021-02-26T08:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: Hive log rotation issue on CDH 6</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-log-rotation-issue-on-CDH-6/m-p/313622#M225624</link>
      <description>&lt;P&gt;Update: this issue is fixed in&amp;nbsp;&lt;SPAN&gt;CM7.2.1&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Mar 2021 13:47:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-log-rotation-issue-on-CDH-6/m-p/313622#M225624</guid>
      <dc:creator>Bender</dc:creator>
      <dc:date>2021-03-23T13:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: Hive log rotation issue on CDH 6</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-log-rotation-issue-on-CDH-6/m-p/354958#M237031</link>
      <description>&lt;P&gt;seems not working in CDH 6.2, this solution will cause hive2 restart failed. with&amp;nbsp; &amp;lt;No type attribute provided for component rollingPolicy&amp;gt;&lt;/P&gt;&lt;P&gt;hive log4j config in cdh6.2&lt;/P&gt;&lt;P&gt;---------------------------&lt;/P&gt;&lt;P&gt;property.max.log.file.size=200MB&lt;BR /&gt;property.max.log.file.backup.index=10&lt;/P&gt;&lt;P&gt;appender.DRFA.type=RollingRandomAccessFile&lt;BR /&gt;appender.DRFA.name=DRFA&lt;BR /&gt;appender.DRFA.fileName=${log.dir}/${log.file}&lt;BR /&gt;appender.DRFA.filePattern=${log.dir}/${log.file}.%d{yyyy-MM-dd}&lt;BR /&gt;appender.DRFA.layout.typetternLayout&lt;BR /&gt;appender.DRFA.layout.pattern=%d{DEFAULT} %-5p %c: [%t]: %m%n&lt;BR /&gt;appender.DRFA.policies.type=Policies&lt;BR /&gt;appender.DRFA.policies.size.type=SizeBasedTriggeringPolicy&lt;BR /&gt;appender.DRFA.policies.size.size=${max.log.file.size}&lt;BR /&gt;appender.DRFA.strategy.type=DefaultRolloverStrategy&lt;BR /&gt;appender.DRFA.strategy.max=${max.log.file.backup.index}&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2022 04:10:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-log-rotation-issue-on-CDH-6/m-p/354958#M237031</guid>
      <dc:creator>tencentemr</dc:creator>
      <dc:date>2022-10-17T04:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: Hive log rotation issue on CDH 6</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-log-rotation-issue-on-CDH-6/m-p/354974#M237035</link>
      <description>&lt;P&gt;it should be like this,&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;appender.DRFA.filePattern=&lt;STRONG&gt;${log.dir}/${log.file}.%d{yyyy-MM-dd}.%i&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;and it will be working in CDH 6.2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2022 08:07:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-log-rotation-issue-on-CDH-6/m-p/354974#M237035</guid>
      <dc:creator>tencentemr</dc:creator>
      <dc:date>2022-10-17T08:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: Hive log rotation issue on CDH 6</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-log-rotation-issue-on-CDH-6/m-p/358356#M237812</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tencentemr_0-1669356095392.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/36319i10BCE846CEB6238F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tencentemr_0-1669356095392.png" alt="tencentemr_0-1669356095392.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Nov 2022 06:01:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-log-rotation-issue-on-CDH-6/m-p/358356#M237812</guid>
      <dc:creator>tencentemr</dc:creator>
      <dc:date>2022-11-25T06:01:44Z</dc:date>
    </item>
  </channel>
</rss>

