Kafka 的客户端和服务端在一个安装包里面了,只需要打开 http://kafka.apache.org/quickstart 页面,然后点击下载。
下载完成之后,把安装包上传到某一个服务器(或本地)。
解压
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 已脱敏
./bin/kafka-run-class.sh kafka.tools.GetOffsetShell \--broker-list localhost:9092 \--topic test_data_119// topicName:partitionID:offset// test_data_119:0:64382876
