<?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: Is there a tool to export offsets? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Is-there-a-tool-to-export-offsets/m-p/117972#M55138</link>
    <description>&lt;P&gt;@&lt;A href="https://community.hortonworks.com/users/14466/coneal77.html"&gt;Connor O'Neal&lt;/A&gt;&lt;/P&gt;&lt;P&gt;There is no named script to export offsets, but we are able to use the kafka-run-class.sh 
script to execute the underlying Java class for the tool in the proper environment. 
Exporting offsets will produce a file that contains each topic partition for the group 
and it’s offsets in a defined format that the import tool can read. The file that is 
created will have one topic partition per line, with the 
following format:&lt;/P&gt;&lt;PRE&gt;/consumers/GROUPNAME/offsets/topic/TOPICNAME/PARTITIONID-0:OFFSET &lt;/PRE&gt;&lt;P&gt;Let's assume export the offsets for the consumer group named “testconsumergroup” to a file named 
“offsets”:&lt;/P&gt;&lt;P&gt;# kafka-run-class.sh kafka.tools.ExportZkOffsets --zkconnect mykafka.abc.com:2181/kafka-cluster --group testconsumergroup --output-file offsets &lt;/P&gt;&lt;P&gt;# cat offsets &lt;/P&gt;&lt;P&gt;/consumers/testconsumergroup/offsets/my-topic/0:8905
/consumers/testconsumergroup/offsets/my-topic/1:8915
/consumers/testconsumergroup/offsets/my-topic/2:9845
/consumers/testconsumergroup/offsets/my-topic/3:8072
/consumers/testconsumergroup/offsets/my-topic/4:8008
/consumers/testconsumergroup/offsets/my-topic/5:8319
/consumers/testconsumergroup/offsets/my-topic/6:8102
/consumers/testconsumergroup/offsets/my-topic/7:12739&lt;/P&gt;&lt;P&gt;+++&lt;/P&gt;&lt;P&gt;If this helped, please vote/accept response.&lt;/P&gt;</description>
    <pubDate>Wed, 22 Feb 2017 08:33:28 GMT</pubDate>
    <dc:creator>cstanca</dc:creator>
    <dc:date>2017-02-22T08:33:28Z</dc:date>
    <item>
      <title>Is there a tool to export offsets?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Is-there-a-tool-to-export-offsets/m-p/117971#M55137</link>
      <description />
      <pubDate>Wed, 22 Feb 2017 07:09:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Is-there-a-tool-to-export-offsets/m-p/117971#M55137</guid>
      <dc:creator>coneal77</dc:creator>
      <dc:date>2017-02-22T07:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a tool to export offsets?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Is-there-a-tool-to-export-offsets/m-p/117972#M55138</link>
      <description>&lt;P&gt;@&lt;A href="https://community.hortonworks.com/users/14466/coneal77.html"&gt;Connor O'Neal&lt;/A&gt;&lt;/P&gt;&lt;P&gt;There is no named script to export offsets, but we are able to use the kafka-run-class.sh 
script to execute the underlying Java class for the tool in the proper environment. 
Exporting offsets will produce a file that contains each topic partition for the group 
and it’s offsets in a defined format that the import tool can read. The file that is 
created will have one topic partition per line, with the 
following format:&lt;/P&gt;&lt;PRE&gt;/consumers/GROUPNAME/offsets/topic/TOPICNAME/PARTITIONID-0:OFFSET &lt;/PRE&gt;&lt;P&gt;Let's assume export the offsets for the consumer group named “testconsumergroup” to a file named 
“offsets”:&lt;/P&gt;&lt;P&gt;# kafka-run-class.sh kafka.tools.ExportZkOffsets --zkconnect mykafka.abc.com:2181/kafka-cluster --group testconsumergroup --output-file offsets &lt;/P&gt;&lt;P&gt;# cat offsets &lt;/P&gt;&lt;P&gt;/consumers/testconsumergroup/offsets/my-topic/0:8905
/consumers/testconsumergroup/offsets/my-topic/1:8915
/consumers/testconsumergroup/offsets/my-topic/2:9845
/consumers/testconsumergroup/offsets/my-topic/3:8072
/consumers/testconsumergroup/offsets/my-topic/4:8008
/consumers/testconsumergroup/offsets/my-topic/5:8319
/consumers/testconsumergroup/offsets/my-topic/6:8102
/consumers/testconsumergroup/offsets/my-topic/7:12739&lt;/P&gt;&lt;P&gt;+++&lt;/P&gt;&lt;P&gt;If this helped, please vote/accept response.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 08:33:28 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Is-there-a-tool-to-export-offsets/m-p/117972#M55138</guid>
      <dc:creator>cstanca</dc:creator>
      <dc:date>2017-02-22T08:33:28Z</dc:date>
    </item>
  </channel>
</rss>

