Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 02-21-2017 11:09 PM
Created 02-22-2017 12:33 AM
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:
/consumers/GROUPNAME/offsets/topic/TOPICNAME/PARTITIONID-0:OFFSET
Let's assume export the offsets for the consumer group named “testconsumergroup” to a file named “offsets”:
# kafka-run-class.sh kafka.tools.ExportZkOffsets --zkconnect mykafka.abc.com:2181/kafka-cluster --group testconsumergroup --output-file offsets
# cat offsets
/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
+++
If this helped, please vote/accept response.
Created 02-22-2017 12:33 AM
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:
/consumers/GROUPNAME/offsets/topic/TOPICNAME/PARTITIONID-0:OFFSET
Let's assume export the offsets for the consumer group named “testconsumergroup” to a file named “offsets”:
# kafka-run-class.sh kafka.tools.ExportZkOffsets --zkconnect mykafka.abc.com:2181/kafka-cluster --group testconsumergroup --output-file offsets
# cat offsets
/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
+++
If this helped, please vote/accept response.