본문 바로가기

Programming/[kafka]

[kafka] Burrow 설치 및 설정

1. Burrow란?

Burrow는 카프카의 모니터링 툴로 Consumer의 LAG을 모니터링할 때 주로 사용된다. 모든 Consumer의 커밋 오프셋을 모니터링한다. 또한 필요할 때 Consumer의 상태를 계산한다. HTTP 엔드포인트를 통해 상태를 요청할 수 있으며, 다른 카프카 클러스터의 정보를 제공받을 수 있다. 이메일이나 HTTP 호출을 통해 다른 서비스로 상태를 보낼 수 있는 구성 가능한 알람 기능도 있다.

2. Burrow의 특징

  • NO THRESHOLDS! : Groups are evaluated over a sliding window.
  • 여러 카프카 클러스터 지원
  • 커밋된 오프셋을 사용하여 모든 Consumer를 자동으로 모니터링
  • Zookeeper 커밋 오프셋 지원
  • Storm 커밋 오프셋 지원
  • Consumer 그룹 상태 및 브로커 정보 제공을 위한 HTTP 엔드포인트 제공
  • 경고 이메일 전송 기능 지원
  • 다른 시스템에 경고를 보내가 위한 HTTP 클라이언트 지원

3. Golang 설치

- https://s262701-id.tistory.com/130 포스팅 참조

 

4. burrow 설치

- URL : https://github.com/linkedin/Burrow

 

GitHub - linkedin/Burrow: Kafka Consumer Lag Checking

Kafka Consumer Lag Checking. Contribute to linkedin/Burrow development by creating an account on GitHub.

github.com

별도의 release가 없으므로 위 링크에서 코드 다운로드

 

CMD를 실행시켜

 

다운로드한 디렉토리로 이동 후 다음 명령 실행

 

go mod tidy

 

다운로드 완료 후 아래의 명령어 실행

go install

정상적으로 install이 되면

 

%GOPATH%\bin 디렉토리에 Burrow.exe가 생성 됨

 

5. Burrow 환경설정

 

D:\burrow\config에 들어가면

 

burrow.toml이라는 burrow 설정 파일이 존재

 

위의 Burrow.exe 파일을 burrow.toml 파일이 있는 폴더에 옮겨줌

 

참고 URL - https://gunju-ko.github.io/kafka/2018/06/06/Burrow.html

 

#burrow.toml 파일

[general]
pidfile="burrow.pid"
stdout-logfile="burrow.out"
access-control-allow-origin="*"

[logging]
filename="logs/burrow.log"
level="info"
maxsize=100
maxbackups=30
maxage=10
use-localtime=false
use-compression=true

[zookeeper]
#servers=[ "zkhost01.example.com:2181", "zkhost02.example.com:2181", "zkhost03.example.com:2181" ]
servers=[ "localhost:2181" ] #자신의 주키퍼 서버
timeout=6
root-path="/burrow"

[client-profile.test]
client-id="burrow-test"
kafka-version="0.10.0"

[cluster.local]
class-name="kafka"
#servers=[ "kafka01.example.com:10251", "kafka02.example.com:10251", "kafka03.example.com:10251" ]
servers=[ "localhost:9092" ] #자신의 카프카 서버
client-profile="test"
topic-refresh=120
offset-refresh=30
groups-reaper-refresh=0

[consumer.local]
class-name="kafka"
cluster="local"
#servers=[ "kafka01.example.com:10251", "kafka02.example.com:10251", "kafka03.example.com:10251" ]
servers=[ "localhost:9092" ] #카프카 서버에 맞춰 변경
client-profile="test"
group-denylist="^(console-consumer-|python-kafka-consumer-|quick-).*$"
group-allowlist=""

[consumer.local_zk]
class-name="kafka_zk"
cluster="local"
#servers=[ "zk01.example.com:2181", "zk02.example.com:2181", "zk03.example.com:2181" ]
servers=[ "localhost:2181" ] #주키퍼 서버에 맞춰 변경
zookeeper-path="/kafka-cluster"
zookeeper-timeout=30
group-denylist="^(console-consumer-|python-kafka-consumer-|quick-).*$"
group-allowlist=""

[httpserver.default]
address=":8000"

[storage.default]
class-name="inmemory"
workers=20
intervals=15
expire-group=604800
min-distance=1

[notifier.default]
class-name="http"
url-open="http://someservice.example.com:1467/v1/event"
url-close="http://someservice.example.com:1467/v1/event"  # 꼭 추가해줘야 함

interval=60
timeout=5
keepalive=30
extras={ api_key="REDACTED", app="burrow", tier="STG", fabric="mydc" }
template-open="default-http-post.tmpl" # 해당 파일 위치에 맞게 경로 변경
template-close="default-http-delete.tmpl" # 해당 파일 위치에 맞게 경로 변경
method-close="DELETE"
send-close=true
threshold=1

 

6. Burrow 실행 확인

CMD를 실행 시켜 burrow.toml 파일이 있는 경로 변경 후 아래의 명령어 실행

Burrow --config-dir=/burrow/config

위의 화면과 같이 실행된 후

 

브라우저에서 http://localhost:8000/burrow/admin 으로 접속

 

GOOD이라 표시 되면 정상적으로 실행된 것

'Programming > [kafka]' 카테고리의 다른 글

[kafka] CMAK 설치 및 연동  (0) 2022.02.14
[kafka] kafka 모니터링 및 대시보드  (0) 2022.01.27
[kafka] 환경 구축 및 예제  (0) 2022.01.26
[kafka] Apache kafka  (0) 2022.01.24