<?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: what is the safe and best way to delete the kafka topic folders in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/what-is-the-safe-and-best-way-to-delete-the-kafka-topic/m-p/214637#M72043</link>
    <description>&lt;P&gt;another thing the topics are exist under /brokers/topics/* and not under /consumers/..../.. so in this case I gues we need to remove the topic as rmr /brokers/topics/hgpo.llo.prmt.processed , can you confirm this please &lt;/P&gt;</description>
    <pubDate>Sun, 03 Dec 2017 01:32:37 GMT</pubDate>
    <dc:creator>mike_bronson7</dc:creator>
    <dc:date>2017-12-03T01:32:37Z</dc:date>
    <item>
      <title>what is the safe and best way to delete the kafka topic folders</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/what-is-the-safe-and-best-way-to-delete-the-kafka-topic/m-p/214626#M72032</link>
      <description>&lt;P&gt;on all our kafka machines ( production machines ) , we see that: ( no free space )&lt;/P&gt;&lt;PRE&gt;df -h /var/kafka 

Filesystem      Size  Used Avail Use% Mounted on

/dev/sdb         11T   11T  2.3M 100% /var/kafka&lt;/PRE&gt;&lt;P&gt;and under &lt;STRONG&gt;/var/kafka/kafka-logs&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;we see all topic folders (huge size) as example:&lt;/P&gt;&lt;PRE&gt;117G hgpo.llo.prmt.processed-28 
117G hgpo.llo.prmt.processed-29 
117G hgpo.llo.prmt.processed-3 
117G hgpo.llo.prmt.processed-30 
117G hgpo.llo.prmt.processed-31 
117G hgpo.llo.prmt.processed-32&lt;/PRE&gt;&lt;P&gt;what is the best approach to delete the topic/s from the folder &lt;STRONG&gt;/&lt;/STRONG&gt;&lt;STRONG&gt;var/kafka/kafka-logs&lt;/STRONG&gt; ,&lt;/P&gt;&lt;P&gt; and what are the exactly steps to do so , as stop service before deletion etc .&lt;/P&gt;&lt;P&gt;second important question:&lt;/P&gt;&lt;P&gt;what is the mechanizem that suppose to delete automatically the topics ?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 22:29:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/what-is-the-safe-and-best-way-to-delete-the-kafka-topic/m-p/214626#M72032</guid>
      <dc:creator>mike_bronson7</dc:creator>
      <dc:date>2017-11-30T22:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: what is the safe and best way to delete the kafka topic folders</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/what-is-the-safe-and-best-way-to-delete-the-kafka-topic/m-p/214627#M72033</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/26229/uribarih.html" nodeid="26229"&gt;@Michael Bronson&lt;/A&gt;&lt;P&gt;Below is the process you can follow to delete the kafka topic and the corresponding  directory (i.e. /var/log/kafka-logs)&lt;/P&gt;&lt;P&gt;1) Make sure to set the message retention time of a topic to 1000ms (1s) to stop the inflow --&amp;gt; using &lt;STRONG&gt;retention.ms &lt;/STRONG&gt;(it does take some time to delete all logs to free up log segments&lt;/P&gt;&lt;P&gt;2) Once it free up the space then we can delete the topic &lt;STRONG&gt;Note: to delete a kafka topic we need to set &lt;/STRONG&gt;&lt;STRONG&gt;&lt;EM&gt;delete.topic.enable=true &lt;/EM&gt;it requires kafka service to be restarted, &lt;/STRONG&gt;which is disabled by default&lt;/P&gt;&lt;P&gt;3) Now we can delete the kafka topic using:&lt;/P&gt;&lt;PRE&gt; /usr/hdp/current/kafka-broker/bin/kafka-topics.sh --delete  --zookeeper &amp;lt;zk-ensemble&amp;gt;:2181  --topic &amp;lt;kafka-topic-name&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;4) once done now we need to delete the corresponding consumer offset from ZooKeeper using:&lt;/P&gt;&lt;PRE&gt;/usr/hdp/current/zookeeper-client/bin/zkCli.sh -server &amp;lt;zk-ensemble&amp;gt;:2181

[zk: &amp;lt;zk-ensemble&amp;gt;:2181(CONNECTED) 1] 

rmr /consumers/&amp;lt;consumer-of-topic&amp;gt;/offsets/&amp;lt;kafka-topic-to-delete&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;5) Now we can remove the corresponding topic directory from all the broker nodes&lt;/P&gt;&lt;P&gt;6) with this we can complete the process of the deleting the topic and the corresponding folders&lt;/P&gt;&lt;P&gt;can you please give more in relation second question &lt;STRONG&gt;what is the mechanizem that suppose to delete automatically the topics ?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Venkat&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 23:47:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/what-is-the-safe-and-best-way-to-delete-the-kafka-topic/m-p/214627#M72033</guid>
      <dc:creator>dheer_vijji_rag</dc:creator>
      <dc:date>2017-11-30T23:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: what is the safe and best way to delete the kafka topic folders</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/what-is-the-safe-and-best-way-to-delete-the-kafka-topic/m-p/214628#M72034</link>
      <description>&lt;P&gt;what is the - consumer-of-topic ? ( how to find it ? )  , for example if the topic name is - hgpo.llo.prmt.processed-32 , then what is the consumer-of-topic ?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2017 00:10:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/what-is-the-safe-and-best-way-to-delete-the-kafka-topic/m-p/214628#M72034</guid>
      <dc:creator>mike_bronson7</dc:creator>
      <dc:date>2017-12-01T00:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: what is the safe and best way to delete the kafka topic folders</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/what-is-the-safe-and-best-way-to-delete-the-kafka-topic/m-p/214629#M72035</link>
      <description>&lt;P&gt;can you give more details about the "1) Make sure to set the message retention time of a topic to 1000ms (1s) to stop the inflow --&amp;gt; using &lt;STRONG&gt;&lt;A href="http://retention.ms/"&gt;retention.ms&lt;/A&gt; &lt;/STRONG&gt;(it does take some time to delete all logs to free up log segments"  , can you please described it step by step ,   or maybe do you mean that I need to run the CLI as : ./bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic my-topic --config retention.ms=1000  ??&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2017 01:14:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/what-is-the-safe-and-best-way-to-delete-the-kafka-topic/m-p/214629#M72035</guid>
      <dc:creator>mike_bronson7</dc:creator>
      <dc:date>2017-12-01T01:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: what is the safe and best way to delete the kafka topic folders</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/what-is-the-safe-and-best-way-to-delete-the-kafka-topic/m-p/214630#M72036</link>
      <description>&lt;P&gt;&lt;STRONG&gt;about my question - what is the mechanizem that suppose to delete automatically the topics ? , I not sure about it but what I am asking is about auto deletion process that remove the topic from the folder , is it truely defined somewhwhere ?  ) &lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2017 01:20:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/what-is-the-safe-and-best-way-to-delete-the-kafka-topic/m-p/214630#M72036</guid>
      <dc:creator>mike_bronson7</dc:creator>
      <dc:date>2017-12-01T01:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: what is the safe and best way to delete the kafka topic folders</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/what-is-the-safe-and-best-way-to-delete-the-kafka-topic/m-p/214631#M72037</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/26229/uribarih.html" nodeid="26229"&gt;@Michael Bronson&lt;/A&gt; Topics are never automatically deleted. The logs are retained for a configured number of bytes (log.retention.bytes) or period of time (log.retention.{hours, minutes, ms}), then the log segments are purged or compacted, which is another Kafka setting (log.cleanup.policy). &lt;/P&gt;&lt;P&gt;All the configurations that you seek are defined in the &lt;A href="https://kafka.apache.org/documentation/#brokerconfigs"&gt;Kafka documentation&lt;/A&gt;, and you should really take these tunables into consideration when installing a production Kafka cluster. &lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2017 05:06:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/what-is-the-safe-and-best-way-to-delete-the-kafka-topic/m-p/214631#M72037</guid>
      <dc:creator>JordanMoore</dc:creator>
      <dc:date>2017-12-01T05:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: what is the safe and best way to delete the kafka topic folders</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/what-is-the-safe-and-best-way-to-delete-the-kafka-topic/m-p/214632#M72038</link>
      <description>&lt;P&gt;just one note , when I delete a topic we get - Topic &amp;lt;....&amp;gt; is marked for deletion.  , is it mean that it will take time until topic will be deleted ?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2017 05:36:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/what-is-the-safe-and-best-way-to-delete-the-kafka-topic/m-p/214632#M72038</guid>
      <dc:creator>mike_bronson7</dc:creator>
      <dc:date>2017-12-01T05:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: what is the safe and best way to delete the kafka topic folders</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/what-is-the-safe-and-best-way-to-delete-the-kafka-topic/m-p/214633#M72039</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/26229/uribarih.html" nodeid="26229"&gt;@Michael Bronson&lt;/A&gt;&lt;P&gt;1) To find the consumer-group related to a topic you can use the below script:&lt;/P&gt;&lt;PRE&gt;for i in `/usr/hdp/current/kafka-broker/bin/zookeeper-shell.sh hdpmaster:2181 ls /consumers 2&amp;gt;&amp;amp;1 | grep consumer | cut -d "[" -f2 | cut -d "]" -f1 | cut -d "," -f1` 
 do 
 /usr/hdp/current/kafka-broker/bin/zookeeper-shell.sh hdpmaster:2181 ls /consumers/$i/offsets 2&amp;gt;&amp;amp;1 | grep test  
if [ $? == 0 ]  
then
 echo $i
 fi  
done&lt;/PRE&gt;&lt;P&gt;2) Yes, setting the &lt;STRONG&gt;retention.ms&lt;/STRONG&gt; using ./bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic my-topic --config &lt;A href="http://retention.ms/"&gt;retention.ms&lt;/A&gt;=1000 &lt;/P&gt;&lt;P&gt;3) as  &lt;A rel="user" href="https://community.cloudera.com/users/29170/moorej.html" nodeid="29170"&gt;@Jordan Moore&lt;/A&gt; mentioned there is no automation to delete the topic which is in built to Kafka (we have to follow the process defined above)&lt;/P&gt;&lt;BLOCKQUOTE&gt;4) &lt;STRONG&gt;when I delete a topic we get - Topic &amp;lt;....&amp;gt; is marked for deletion. , is it mean that it will take time until topic will be deleted ?&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;Yes, it does take time to delete a topic and you can also this message if the &lt;STRONG&gt;delete.topic.enabl&lt;/STRONG&gt;e is set to false (it is the default setting) as given previously:&lt;STRONG&gt;Note: to delete a kafka topic we need to set &lt;/STRONG&gt;&lt;STRONG&gt;&lt;EM&gt;delete.topic.enable=true &lt;/EM&gt;it requires kafka service to be restarted&lt;/STRONG&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Fri, 01 Dec 2017 15:15:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/what-is-the-safe-and-best-way-to-delete-the-kafka-topic/m-p/214633#M72039</guid>
      <dc:creator>dheer_vijji_rag</dc:creator>
      <dc:date>2017-12-01T15:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: what is the safe and best way to delete the kafka topic folders</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/what-is-the-safe-and-best-way-to-delete-the-kafka-topic/m-p/214634#M72040</link>
      <description>&lt;P&gt;@&lt;A href="https://community.hortonworks.com/users/13950/dheervijjiraghu.html"&gt;Venkata &lt;/A&gt; thank you ,  I run the script with the topic-name (&lt;STRONG&gt;hgpo.llo.prmt.processed&lt;/STRONG&gt;) instead test  , and consumer-group not found , I mean no output from the script , is is possible ?&lt;/P&gt;&lt;P&gt; second as you know we get &lt;STRONG&gt;Topic mcapi.avro.pri.processed&lt;/STRONG&gt; is already marked for deletion after we run "delete kafka topic"  and we run it &lt;STRONG&gt;yesterday &lt;/STRONG&gt;- &lt;STRONG&gt;why it take so along time &lt;/STRONG&gt;?  ,  ( in my kafka - &lt;STRONG&gt;&lt;EM&gt;delete.topic.enable=true  is set by default)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;so in that case can we remove the topic under /var/kafka/kafka-logs by rm -rf "topic name " ?&lt;/P&gt;&lt;P&gt;as&lt;/P&gt;&lt;P&gt; rm -rf hgpo.llo.prmt.processed-28&lt;/P&gt;&lt;P&gt;rm -rf hgpo.llo.prmt.processed-29&lt;/P&gt;&lt;P&gt;and so on for all other topics&lt;/P&gt;&lt;OL&gt;
&lt;LI&gt;117G hgpo.llo.prmt.processed-3&lt;/LI&gt;&lt;LI&gt;117G hgpo.llo.prmt.processed-30&lt;/LI&gt;&lt;LI&gt;117G hgpo.llo.prmt.processed-31&lt;/LI&gt;&lt;LI&gt;117G hgpo.llo.prmt.processed-32&lt;/LI&gt;&lt;LI&gt;.&lt;/LI&gt;&lt;LI&gt;.&lt;/LI&gt;&lt;LI&gt;.&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Fri, 01 Dec 2017 16:31:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/what-is-the-safe-and-best-way-to-delete-the-kafka-topic/m-p/214634#M72040</guid>
      <dc:creator>mike_bronson7</dc:creator>
      <dc:date>2017-12-01T16:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: what is the safe and best way to delete the kafka topic folders</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/what-is-the-safe-and-best-way-to-delete-the-kafka-topic/m-p/214635#M72041</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/26229/uribarih.html" nodeid="26229"&gt;@Michael Bronson&lt;/A&gt;&lt;P&gt;As you have deleted the topic it looks like the consumer group is deleted, and you can remove the corresponding topic folders (from all nodes) and also the topic from zookeeper using the ZK CLI.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Dec 2017 13:15:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/what-is-the-safe-and-best-way-to-delete-the-kafka-topic/m-p/214635#M72041</guid>
      <dc:creator>dheer_vijji_rag</dc:creator>
      <dc:date>2017-12-02T13:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: what is the safe and best way to delete the kafka topic folders</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/what-is-the-safe-and-best-way-to-delete-the-kafka-topic/m-p/214636#M72042</link>
      <description>&lt;P&gt;just to be sure , so it will be safe to remove the topics  use rm-rf as ( rm -rf hgpo.llo.prmt.processed-28 . rm -rf hgpo.llo.prmt.processed-28 and so on on all nodes ) ?&lt;/P&gt;</description>
      <pubDate>Sun, 03 Dec 2017 00:13:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/what-is-the-safe-and-best-way-to-delete-the-kafka-topic/m-p/214636#M72042</guid>
      <dc:creator>mike_bronson7</dc:creator>
      <dc:date>2017-12-03T00:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: what is the safe and best way to delete the kafka topic folders</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/what-is-the-safe-and-best-way-to-delete-the-kafka-topic/m-p/214637#M72043</link>
      <description>&lt;P&gt;another thing the topics are exist under /brokers/topics/* and not under /consumers/..../.. so in this case I gues we need to remove the topic as rmr /brokers/topics/hgpo.llo.prmt.processed , can you confirm this please &lt;/P&gt;</description>
      <pubDate>Sun, 03 Dec 2017 01:32:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/what-is-the-safe-and-best-way-to-delete-the-kafka-topic/m-p/214637#M72043</guid>
      <dc:creator>mike_bronson7</dc:creator>
      <dc:date>2017-12-03T01:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: what is the safe and best way to delete the kafka topic folders</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/what-is-the-safe-and-best-way-to-delete-the-kafka-topic/m-p/214638#M72044</link>
      <description>&lt;P&gt;&lt;A href="https://community.hortonworks.com/users/26229/uribarih.html"&gt;@Michael Bronson&lt;/A&gt; , i changed the script, since , wasnt parsinf the consumer ( btw . grear script - thanks)&lt;/P&gt;&lt;P&gt;topico="entrada"&lt;BR /&gt;for i in `/usr/hdp/current/kafka-broker/bin/zookeeper-shell.sh sr-hadctl-xt01:2181 ls /consumers 2&amp;gt;&amp;amp;1 | grep consumer | cut -d "[" -f2 | cut -d "]" -f1 | tr ',' "\n"` &lt;BR /&gt; do &lt;BR /&gt; /usr/hdp/current/kafka-broker/bin/zookeeper-shell.sh sr-hadctl-xt01:2181 ls /consumers/$i/offsets 2&amp;gt;&amp;amp;1 | grep $topico  &lt;BR /&gt;if [ $? == 0 ]  &lt;BR /&gt;then&lt;BR /&gt; echo $i&lt;BR /&gt; fi  &lt;BR /&gt;done&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 23:49:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/what-is-the-safe-and-best-way-to-delete-the-kafka-topic/m-p/214638#M72044</guid>
      <dc:creator>MarceloSaiedOK</dc:creator>
      <dc:date>2018-01-30T23:49:12Z</dc:date>
    </item>
  </channel>
</rss>

