Kafka 的客户端和服务端在一个安装包里面了,只需要打开 http://kafka.apache.org/quickstart 页面,然后点击下载。
截屏2021-05-25 上午9.45.15.png
下载完成之后,把安装包上传到某一个服务器(或本地)。

解压

  1. tar -zxvf kafka_2.13-2.8.0.tgz

实践

1.获取 Offset

kafka.tools.GetOffsetShell is a standalone application that is used to get offsets of the partitions of a topic. GetOffsetShell can be executed using kafka-run-class shell script.

下面是获取 Topic test_data_119 的分区最新 offset

ip 已脱敏

  1. ./bin/kafka-run-class.sh kafka.tools.GetOffsetShell \
  2. --broker-list localhost:9092 \
  3. --topic test_data_119
  4. // topicName:partitionID:offset
  5. // test_data_119:0:64382876

参考