merge files from the blockchain infra repo (#59)

This commit is contained in:
autistic-symposium-helper 2024-11-17 17:03:20 -08:00 committed by GitHub
parent 23f56ef195
commit 2a6449bb85
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
346 changed files with 29097 additions and 132 deletions

View file

@ -0,0 +1,52 @@
## Kafka Topics Cheatsheet
#### Create a temporary interactive container
```
kubectl exec -it -n <ns> kafka-tools -- bash
```
### List consumer groups
```
kafka-consumer-groups --bootstrap-server "$KAFKA_BOOTSTRAP_SERVERS" --list
```
### Inspect a consumer group
```
kafka-consumer-groups --bootstrap-server "$KAFKA_BOOTSTRAP_SERVERS" --describe --group GROUP
```
### Remove Lag - Reset a consumer group to latest
Reset offsets to latest (speeds up reset in Grafana):
```
kafka-consumer-groups --bootstrap-server "$KAFKA_BOOTSTRAP_SERVERS" --group GROUP \
--reset-offsets --topic TOPIC --to-earliest --dry-run
```
### Delete a Consumer Group
Reset offsets to latest (speeds up reset in Grafana):
```
kafka-consumer-groups --bootstrap-server "$KAFKA_BOOTSTRAP_SERVERS" --group GROUP \
--reset-offsets --topic TOPIC --to-earliest --dry-run
```
### Delete group.
```
kafka-consumer-groups --bootstrap-server "$KAFKA_BOOTSTRAP_SERVERS" --group GROUP --delete
Shift consumer back 10k
```
### Specify the partition to shift, else all will be shifted
```
kafka-consumer-groups --bootstrap-server "$KAFKA_BOOTSTRAP_SERVERS" --group GROUP \
--topic TOPIC:0 --reset-offsets --shift-by -10000
```