-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconsumer_group_state.sh
More file actions
executable file
·35 lines (26 loc) · 982 Bytes
/
consumer_group_state.sh
File metadata and controls
executable file
·35 lines (26 loc) · 982 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
#########################################################
##
## Check consumer group connection
## author: Hochan Son
## Date: 06/11/2020
##
## Expected output is empty, stable.
## (empty: empty consumer group)
## (stable: maybe one or more memeber in consumer groups)
##
#########################################################
broker_bootstrap=""
zookeeper_boostrap=""
echo $broker_bootstrap
if [ -z $broker_bootstrap ]; then
read -p "please enter the broker bootstrap: " broker_bootstrap
fi
consumer_group_list=$(kafka-consumer-groups --bootstrap-server $broker_bootstrap --list)
echo $consumer_group_list
for cg in $consumer_group_list
do
printf "\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>checking on {$cg}<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n";
kafka-consumer-groups --bootstrap-server $broker_bootstrap --group $cg --describe --state
kafka-consumer-groups --bootstrap-server $broker_bootstrap --group $cg --describe --members
done