<?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: how to set permanent kafka retention bytes on different topics in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/how-to-set-permanent-kafka-retention-bytes-on-different/m-p/300424#M220220</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/59349"&gt;@mike_bronson7&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;log.retention.bytes&lt;/FONT&gt; is a size-based retention policy for logs, i.e the allowed size of the topic. Segments are pruned from the log as long as the remaining segments don't drop below log.retention.bytes.&lt;/P&gt;&lt;P&gt;You can also specify retention parameters at the topic level&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;To specify a retention time period per topic, use the following command.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;kafka-configs.sh --zookeeper [ZooKeeperConnectionString] --alter --entity-type topics --entity-name [TopicName] --add-config retention.ms=[DesiredRetentionTimePeriod]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;To specify a retention log size per topic, use the following command.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;kafka-configs.sh --zookeeper [ZooKeeperConnectionString] --alter --entity-type topics --entity-name [TopicName] --add-config retention.bytes=[DesiredRetentionLogSize]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;That should resolve your problem&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Happy hadooping&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 26 Jul 2020 18:40:52 GMT</pubDate>
    <dc:creator>Shelton</dc:creator>
    <dc:date>2020-07-26T18:40:52Z</dc:date>
    <item>
      <title>how to set permanent kafka retention bytes on different topics</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-set-permanent-kafka-retention-bytes-on-different/m-p/300279#M220122</link>
      <description>&lt;P&gt;we set `retention bytes` value - `104857600` for topic - `topic_test`&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;[root@confluent01 ~]# kafka-topics --zookeeper localhost:2181 --alter --topic topic_test --config retention.bytes=104857600&lt;BR /&gt;WARNING: Altering topic configuration from this script has been deprecated and may be removed in future releases.&lt;BR /&gt;Going forward, please use kafka-configs.sh for this functionality&lt;BR /&gt;Updated config for topic "topic_test".&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Now we verify the `retention bytes` from the zookeeper:&lt;BR /&gt;&lt;BR /&gt;[root@confluent01 ~]# zookeeper-shell confluent01:2181 get /config/topics/topic_test&lt;BR /&gt;Connecting to confluent1:2181&lt;BR /&gt;{"version":1,"config":{"retention.bytes":"104857600"}}&lt;BR /&gt;cZxid = 0xb30a00000038&lt;BR /&gt;&lt;BR /&gt;WATCHER::&lt;BR /&gt;&lt;BR /&gt;WatchedEvent state:SyncConnected type:None path:null&lt;BR /&gt;ctime = Mon Jun 29 11:42:30 GMT 2020&lt;BR /&gt;mZxid = 0xb31100008978&lt;BR /&gt;mtime = Wed Jul 22 19:22:20 GMT 2020&lt;BR /&gt;pZxid = 0xb30a00000038&lt;BR /&gt;cversion = 0&lt;BR /&gt;dataVersion = 7&lt;BR /&gt;aclVersion = 0&lt;BR /&gt;ephemeralOwner = 0x0&lt;BR /&gt;dataLength = 54&lt;BR /&gt;numChildren = 0&lt;/P&gt;&lt;P&gt;now we performed `reboot` to the kafka confluent01 machine&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;after machines started and kafka service start successfully , we checked again the `retention-bytes` from zookeeper:&lt;/P&gt;&lt;P&gt;but now ( after machine reboot ) we can see that the `retention bytes` isn't configured in zookeeper&lt;/P&gt;&lt;P&gt;[root@confluent01 ~]#zookeeper-shell confluent01:2181 get /config/topics/topic_test&lt;BR /&gt;Connecting to confluent1:2181&lt;BR /&gt;&lt;BR /&gt;WATCHER::&lt;BR /&gt;&lt;BR /&gt;WatchedEvent state:SyncConnected type:None path:null  no retention bytes value&lt;BR /&gt;&lt;BR /&gt;{"version":1,"config":{}}&lt;BR /&gt;cZxid = 0xb30a00000038&lt;BR /&gt;ctime = Mon Jun 29 11:42:30 GMT 2020&lt;BR /&gt;mZxid = 0xb3110000779b&lt;BR /&gt;mtime = Wed Jul 22 14:09:19 GMT 2020&lt;BR /&gt;pZxid = 0xb30a00000038&lt;BR /&gt;cversion = 0&lt;BR /&gt;dataVersion = 2&lt;BR /&gt;aclVersion = 0&lt;BR /&gt;ephemeralOwner = 0x0&lt;BR /&gt;dataLength = 25&lt;BR /&gt;numChildren = 0&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;**the question is** - how to remain the `retention bytes` even after restart of kafka machine ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;***NOTE - we not want to use the retention bytes from `server.properties`&lt;BR /&gt;because we set different retention bytes to each topic***&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 22:25:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-set-permanent-kafka-retention-bytes-on-different/m-p/300279#M220122</guid>
      <dc:creator>mike_bronson7</dc:creator>
      <dc:date>2020-07-22T22:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: how to set permanent kafka retention bytes on different topics</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-set-permanent-kafka-retention-bytes-on-different/m-p/300424#M220220</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/59349"&gt;@mike_bronson7&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;log.retention.bytes&lt;/FONT&gt; is a size-based retention policy for logs, i.e the allowed size of the topic. Segments are pruned from the log as long as the remaining segments don't drop below log.retention.bytes.&lt;/P&gt;&lt;P&gt;You can also specify retention parameters at the topic level&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;To specify a retention time period per topic, use the following command.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;kafka-configs.sh --zookeeper [ZooKeeperConnectionString] --alter --entity-type topics --entity-name [TopicName] --add-config retention.ms=[DesiredRetentionTimePeriod]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;To specify a retention log size per topic, use the following command.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;kafka-configs.sh --zookeeper [ZooKeeperConnectionString] --alter --entity-type topics --entity-name [TopicName] --add-config retention.bytes=[DesiredRetentionLogSize]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;That should resolve your problem&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Happy hadooping&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jul 2020 18:40:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-set-permanent-kafka-retention-bytes-on-different/m-p/300424#M220220</guid>
      <dc:creator>Shelton</dc:creator>
      <dc:date>2020-07-26T18:40:52Z</dc:date>
    </item>
  </channel>
</rss>

