Skip to content

Instantly share code, notes, and snippets.

Kafka 0.11.0.0 (Confluent 3.3.0) added support to manipulate offsets for a consumer group via cli kafka-consumer-groups command.

  1. List the topics to which the group is subscribed
kafka-consumer-groups --bootstrap-server <kafkahost:port> --group <group_id> --describe

Note the values under "CURRENT-OFFSET" and "LOG-END-OFFSET". "CURRENT-OFFSET" is the offset where this consumer group is currently at in each of the partitions.

  1. Reset the consumer offset for a topic (preview)
@qwadro
qwadro / kafka-rebalancing.md
Created October 2, 2022 13:25 — forked from sahilsk/kafka-rebalancing.md
Kafka-rebalancing

Lets say i want to rebalance my-sample-topic topic on my kafka cluster

Create topcis.json

{
  "version": 1,
  "topics": [
 { "topic": "my-sample-topic" 
@qwadro
qwadro / gist:153da415e42271ef1b6cde481eaed437
Created April 11, 2022 15:25
compile python 3.10.1 centos7
https://linuxstans.com/how-to-install-python-centos/
openssl
https://cloudwafer.com/blog/installing-openssl-on-centos-7/
@qwadro
qwadro / get_images.sh
Last active April 11, 2022 09:22
save docker images as separated files
for a in $(docker images | awk '{ print $1 "?" $2 }' | grep -v REPOSITORY )
do
name=$(echo $a | cut -d? -f1)
version=$(echo $a | cut -d? -f2)
shortname=${name##*/}
echo exporting docker image: $name with version $version
docker save $name:$version | gzip > "$shortname"_"$version".tar.gz
echo $shortname=$version >> ../versions.txt
done
/etc/bashrc:
# Tell the terminal about the working directory at each prompt.
if [ "$TERM_PROGRAM" == "Apple_Terminal" ] && [ -z "$INSIDE_EMACS" ] && [ -z "$MC_SID" ]; then
update_terminal_cwd() {
# Identify the directory using a "file:" scheme URL,
# including the host name to disambiguate local vs.
# remote connections. Percent-escape spaces.
local SEARCH=' '
local REPLACE='%20'