cd [kafka 설치 위치]
#/bin/bash
bin/kafka-consumer-groups.sh —bootstrap-server localhost:9092 --list
#/bin/bash
bin/kafka-consumer-groups.sh —bootstrap-server localhost:9092 —describe —group [그룹명]
명령어 | 설명 |
---|---|
--to-datetime <String: datetime> | 특정 시간대의 offset으로 되돌린다. Format 'YYYY-MM-DDTHH:mm:SS.sss' |
--to-earliest | 처리할 수 있는 가장 처음 시간으로 되돌린다. |
--to-latest | 가장 최근의 offset으로 변경한다. |
--shift-by <Long: number-of offsets> | 현재 위치부터 설정한 n값에 따라 offset 위치를 변경한다. n값은 양수, 음수 모두 사용 가능하다. |
--from-file | CSV 파일에 설정되어 있는 각 offset 위치로 변경한다.(아마 그룹 전체를 변경할 때에 사용할 듯) |
--to-current | 현재 offset 위치로 변경한다. |
--by-duration | 현재 시간 기준으로 옵션에 작성한 시간 기준별로 offset을 변경한다. Format: 'PnDTnHnMnS' |
--to-offset | 설정한 offset위치로 변경한다. |
--to-current의 경우 명령어 실행 안 하면 어차피 현재 위치인데, 왜 사용하는지???
특정 토픽만 offset 변경할 경우 사용됨
#/bin/bash
bin/kafka-consumer-groups \
--bootstrap-server localhost:9092 \
--group [그룹명] \
--reset-offsets \
--to-earliest \
--topic [토픽명] \
--execute
특정 그룹에 대하여 전체 offset을 되돌릴 경우에 사용함.
#/bin/bash
bin/kafka-consumer-groups \
--bootstrap-server localhost:9092 \
--group [그룹명] \
--reset-offsets \
--to-earliest \
--all-topics \
--execute