August more text challenge | new play strange upgrade, prize stacking get soft 🎁

How can didi open Source LogiKM one-stop Kafka monitoring and control platform be absent from daily operation and maintenance and troubleshooting

1. Delete the kafka-delete-records.sh message for the specified partition

Delete Messages for a partition of a specified topic. Delete messages at offset 1024

Configure the JSON file offset-json-file.json first

{"partitions":
[{"topic": "test1"."partition": 0."offset": 1024}]."version":1
}
Copy the code

On command

Sh –bootstrap-server 172.23.250.249:9090 –offset-json-file config/offset-json-file.json

Verify that the sent message is viewed through LogIKM

You can see here, configuration"offset": 1024Delete the message from the beginning to 1024 offset; You delete it from the front

2. View the Broker disk information kafka-log-dirs.sh

Example Query information about a specific topic disk --topic-list topic1,topic2

sh bin/kafka-log-dirs.sh –bootstrap-server xxxx:9090 –describe –topic-list test2

Example Query information about a specified Broker disk--broker-list 0 broker1,broker2

sh bin/kafka-log-dirs.sh –bootstrap-server xxxxx:9090 –describe –topic-list test2 –broker-list 0

For example, I have a Topic with 3 partitions and 3 replicas to find out the information log.dir configured on the logDir Broker

{
	"version": 1."brokers": [{
		"broker": 0."logDirs": [{
			"logDir": "/Users/xxxx/work/IdeaPj/ss/kafka/kafka-logs-0"."error": null."partitions": [{
				"partition": "test2-1"."size": 0."offsetLag": 0."isFuture": false
			}, {
				"partition": "test2-0"."size": 0."offsetLag": 0."isFuture": false
			}, {
				"partition": "test2-2"."size": 0."offsetLag": 0."isFuture": false}}]]}, {"broker": 1."logDirs": [{
			"logDir": "/Users/xxxx/work/IdeaPj/ss/kafka/kafka-logs-1"."error": null."partitions": [{
				"partition": "test2-1"."size": 0."offsetLag": 0."isFuture": false
			}, {
				"partition": "test2-0"."size": 0."offsetLag": 0."isFuture": false
			}, {
				"partition": "test2-2"."size": 0."offsetLag": 0."isFuture": false}}]]}, {"broker": 2."logDirs": [{
			"logDir": "/Users/xxxx/work/IdeaPj/ss/kafka/kafka-logs-2"."error": null."partitions": [{
				"partition": "test2-1"."size": 0."offsetLag": 0."isFuture": false
			}, {
				"partition": "test2-0"."size": 0."offsetLag": 0."isFuture": false
			}, {
				"partition": "test2-2"."size": 0."offsetLag": 0."isFuture": false}}]]}, {"broker": 3."logDirs": [{
			"logDir": "/Users/xxxx/work/IdeaPj/ss/kafka/kafka-logs-3"."error": null."partitions": []}]}Copy the code

If you find it difficult to query disk information by command, you can also passLogIKMTo view

More

Kafka column continues to be updated… (source code, principle, actual combat, operation and maintenance, video, interview video)


【 Kafka operation 】Kafka network most complete most detailed operation and maintenance command collection (boutique strongly recommended collection!! _ Shi Zhenzhen’s grocery store -CSDN blog

[Kafka actual] partition redistribution may appear problems and troubleshooting problems (production environment actual combat, dry goods!! Very dry!!!!!! Suggested collection)

【 Kafka exception 】 Kafka common exception handling solution (continuously updated! Suggested collection)

【 Kafka operation and Maintenance 】 Partition from allocation, data migration, copy expansion (with video)

Kafka source 】 【 ReassignPartitionsCommand source code analysis (duplicates of scalability, data migration, and redistribution, copy migration across the path

[Kafka] Go to…. for more