SlideShare a Scribd company logo
Kafka monitoring using Prometheus and Grafana
구성도
Kafka Cluster
node exporter : 서버 자원(CPU, Memory, Disk) 지표 수집
jmx exporter : Kafka 구동과 관련된 jmx 지표 수집
개요
기동 순서 기동 대상 포트 기동 방법 역할
1. JMX exporter
모든 Broker
8088
Kafka 기동시 jar 파일
실행됨(agent)
Kafka의 JMX 정보 송신
2. Node exporter 9100 ./node_exporter 서버의 자원상황 송신
3. Prometheus
모니터링 서버
9090 ./prometheus 메트릭 수집
4. Grafana 3000
systemctl start
grafana-server.service 메트릭 시각화
1. JMX Exporter (1/5)
Prometheus와 연동하기 위한 일종의 Agent 파일
https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/
모든 Broker에 해당
1. JMX Exporter (2/5)
wget https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.17.2/jmx_prometheus_javaagent-0.17.2.jar
아래와 같이 JMX_Exporter 파일을 다운로드 한다.
모든 Broker에 해당
1. JMX Exporter (3/5)
https://github.com/prometheus/jmx_exporter/tree/main/example_configs
wget https://raw.githubusercontent.com/prometheus/jmx_exporter/main/example_configs/kafka-2_0_0.yml
아래와 같이 JMX_Exporter 파일 실행에 적용할 설정 파일을 다운로드 한다.(수집할 JMX를 정의한 설정 파일)
모든 Broker에 해당
1. JMX Exporter (4/5)
if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then
export KAFKA_HEAP_OPTS="-Xmx1G -Xms1G"
fi
if [ "x$KAFKA_OPTS" = "x" ]; then
export KAFKA_OPTS="-javaagent:/root/monitor/jmx_prometheus_javaagent-0.17.2.jar=8088:/root/monitor/kafka-2_0_0.yml"
fi
EXTRA_ARGS=${EXTRA_ARGS-'-name kafkaServer -loggc'}
카프카 재기동
kafka-server-stop.sh
kafka-server-start.sh -daemon $KAFKA/config/server.properties
$KAFKA/bin/kafka-server-start.sh 에서 아래 붉은색 추가(Kafka 기동시 JMX Exporter를 같이 시작하기 위함)
모든 Broker에 해당
Kafka 재기동 이후 Exporter 정상 여부 확인
curl localhost:8088
차후, Prometheus 서버 및 웹 화면에서 메트릭 전송을 위해 방화벽 개방
firewall-cmd --permanent --zone=public --add-port=8088/tcp
firewall-cmd --reload
firewall-cmd --list-ports
1. JMX Exporter (5/5)
모든 Broker에 해당
wget https://github.com/prometheus/node_exporter/releases/download/v1.4.0/node_exporter-1.4.0.linux-amd64.tar.gz
tar -xzf node_exporter-1.4.0.linux-amd64.tar.gz
firewall-cmd --permanent --zone=public --add-port=9100/tcp
firewall-cmd --reload
firewall-cmd --list-ports
./node_exporter (압축 해제한 디렉토리에서 쉘파일 실행)
2. Node Exporter
모든 Broker에 해당
https://prometheus.io/download/
(방화벽 해제)
(압축 해제)
wget https://github.com/prometheus/prometheus/releases/download/v2.40.3/prometheus-2.40.3.linux-amd64.tar.gz
tar -xzf prometheus-2.40.3.linux-amd64.tar.gz
vi prometheus.yml
모니터링할 서버에 설치 및 실행
# my global config
global:
scrape_interval: 10s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 10s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: "kafka"
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs:
- targets: ["master:8088","slave1:8088","slave2:8088"]
- job_name: "server status"
static_configs:
- targets: ["master:9100","slave1:9100","slave2:9100"]
3. Prometheus (1/4)
(압축 해제한 디렉토리에 있는 설정 파일 편집)
(JMX Exporter 접속 정보)
(Node Exporter 정보)
#포트 개방
firewall-cmd --permanent --zone=public --add-port=9090/tcp
firewall-cmd--reload
firewall-cmd --list-ports
#실행
./prometheus
모니터링할 서버에 설치 및 실행
3. Prometheus (2/4)
3. Prometheus (3/4)
웹 브라우저 접속하여 2개의 exporter에서
수집한 Metric 정상 수신 여부 확인
모니터링할 서버에 설치 및 실행
3. Prometheus (4/4)
모니터링할 서버에 설치 및 실행
https://grafana.com/grafana/download
4. Grafana (1/10)
모니터링할 서버에 설치 및 실행
wget https://dl.grafana.com/enterprise/release/grafana-enterprise-9.2.6-1.x86_64.rpm
yum install grafana-enterprise-9.2.6-1.x86_64.rpm
firewall-cmd --permanent --zone=public --add-port=3000/tcp
firewall-cmd --reload
firewall-cmd --list-ports
systemctl start grafana-server.service
4. Grafana (2/10)
모니터링할 서버에 설치 및 실행
(서비스 실행)
(서비스 등록 및 부팅시 자동 실행 : systemctl enable grafana-server.service)
서버 접속 예시 : http://192.168.56.30:3000/login
Email or username: admin
Password: admin
모니터링할 서버에 설치 및 실행
4. Grafana (3/10)
(Password Setting)
모니터링할 서버에 설치 및 실행
4. Grafana (4/10)
Click ↓
모니터링할 서버에 설치 및 실행
4. Grafana (5/10)
Click ↓
① Prometheus Server Endpoing ↓
② Click ↓
모니터링할 서버에 설치 및 실행
4. Grafana (6/10)
node_exporter 대시보드 설정
1860↓
Prometheus↓
모니터링할 서버에 설치 및 실행
4. Grafana (7/10)
결과 화면
모니터링할 서버에 설치 및 실행
4. Grafana (8/10)
jmx_exporter 대시보드 설정
11962↓
Prometheus↓
https://grafana.com/grafana/dashboards/11962-kafka-metrics/
모니터링할 서버에 설치 및 실행
4. Grafana (9/10)
[참고] 사용 가능한 Grafana Metrics 조회
모니터링할 서버에 설치 및 실행
4. Grafana (10/10)
결과 화면
https://grafana.com/grafana/dashboards/?search=kafka
[Tip] Grafana
[참고] 기타 유용한 Grafana Metrics
[Tip] Grafana
[참고] ID : 721
[Tip] Grafana
[참고] ID : 8582
[Tip] Grafana
[참고] ID : 8582
[Tip] Grafana
* 즐겨찾기 활용

More Related Content

PDF
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
PPTX
Maria db 이중화구성_고민하기
PDF
[오픈소스컨설팅]Scouter 설치 및 사용가이드(JBoss)
PDF
ksqlDB로 실시간 데이터 변환 및 스트림 처리
DOCX
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
PDF
What is new in PostgreSQL 14?
PDF
[2018] MySQL 이중화 진화기
PDF
Introduction to Redux
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
Maria db 이중화구성_고민하기
[오픈소스컨설팅]Scouter 설치 및 사용가이드(JBoss)
ksqlDB로 실시간 데이터 변환 및 스트림 처리
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
What is new in PostgreSQL 14?
[2018] MySQL 이중화 진화기
Introduction to Redux

What's hot (20)

PDF
REST APIs with Spring
PPTX
React js programming concept
PDF
MariaDB 마이그레이션 - 네오클로바
PPTX
Maxscale 소개 1.1.1
PPTX
MaxScale이해와활용-2023.11
PPT
Hibernate architecture
PDF
Spring Security
PPTX
PPT
PPTX
Introduction to Storm
PPTX
MySQL8.0_performance_schema.pptx
PPS
Java Hibernate Programming with Architecture Diagram and Example
PPTX
Apache sqoop with an use case
PPTX
PDF
웹서버 부하테스트 실전 노하우
PDF
Nodejs vatsal shah
PPTX
Nginx Reverse Proxy with Kafka.pptx
PDF
Introduction to MongoDB
PDF
Tanel Poder - Scripts and Tools short
PDF
점진적인 레거시 웹 애플리케이션 개선 과정
REST APIs with Spring
React js programming concept
MariaDB 마이그레이션 - 네오클로바
Maxscale 소개 1.1.1
MaxScale이해와활용-2023.11
Hibernate architecture
Spring Security
Introduction to Storm
MySQL8.0_performance_schema.pptx
Java Hibernate Programming with Architecture Diagram and Example
Apache sqoop with an use case
웹서버 부하테스트 실전 노하우
Nodejs vatsal shah
Nginx Reverse Proxy with Kafka.pptx
Introduction to MongoDB
Tanel Poder - Scripts and Tools short
점진적인 레거시 웹 애플리케이션 개선 과정
Ad

Similar to Kafka monitoring using Prometheus and Grafana (20)

PDF
Kafka slideshare
PDF
KAFKA 3.1.0.pdf
PDF
[오픈소스컨설팅]Nginx jboss 연동가이드__v1
PDF
[오픈소스컨설팅]Nginx 1.2.7 설치가이드__v1
PDF
[오픈소스컨설팅] 아파치톰캣 운영가이드 v1.3
PDF
JCO 11th 클라우드 환경에서 Java EE 운영 환경 구축하기
PPTX
Nginx Https 적용하기.pptx
PDF
Blockchain 4th dapp programming
PDF
Build the OpenStack Cloud with Neutron Networing, IceHouse
PDF
Monitoring System for DevOps - Case of MelOn
PDF
Custom DevOps Monitoring System in MelOn (with InfluxDB + Telegraf + Grafana)
PPTX
Hadoop security DeView 2014
PPTX
Hadoopcluster install in_centos_virtualbox
DOCX
PCF Installation Guide
PDF
20141029 하둡2.5와 hive설치 및 예제
PDF
Hyperledger fabric practice(pdf)
PDF
[오픈소스컨설팅]Tomcat6&7 How To
PDF
톰캣 운영 노하우
PDF
Jenkins와 Gitlab으로 쉽고 빠르게 구축하는 협업시스템
PDF
Nginx basic configurations
Kafka slideshare
KAFKA 3.1.0.pdf
[오픈소스컨설팅]Nginx jboss 연동가이드__v1
[오픈소스컨설팅]Nginx 1.2.7 설치가이드__v1
[오픈소스컨설팅] 아파치톰캣 운영가이드 v1.3
JCO 11th 클라우드 환경에서 Java EE 운영 환경 구축하기
Nginx Https 적용하기.pptx
Blockchain 4th dapp programming
Build the OpenStack Cloud with Neutron Networing, IceHouse
Monitoring System for DevOps - Case of MelOn
Custom DevOps Monitoring System in MelOn (with InfluxDB + Telegraf + Grafana)
Hadoop security DeView 2014
Hadoopcluster install in_centos_virtualbox
PCF Installation Guide
20141029 하둡2.5와 hive설치 및 예제
Hyperledger fabric practice(pdf)
[오픈소스컨설팅]Tomcat6&7 How To
톰캣 운영 노하우
Jenkins와 Gitlab으로 쉽고 빠르게 구축하는 협업시스템
Nginx basic configurations
Ad

More from wonyong hwang (20)

PPTX
Kubernetes BateMetal Installation and Practice
PDF
이더리움 기반 DApp 개발과 스마트 계약 실습 (ERC20,ERC721,ERC1155,ERC1400)
PPTX
Ethereum Smart Contract Static Analyzer (Solidity Vulnerability Analyzer)
PPTX
Deploy Hyperledger Besu using Kubernetes
PPTX
kubernetes baremetal installation and practice
PPTX
Hyperledger Besu 빨리 따라하기 (Private Networks)
PPTX
Hyperledger Explorer.pptx
PPTX
하이퍼레저 페이지 단위 블록 조회
PPTX
토큰 증권 개요.pptx
PPTX
Vue.js 기초 실습.pptx
PPTX
Deploying Hyperledger Fabric on Kubernetes.pptx
PPTX
k8s practice 2023.pptx
PDF
HyperLedger Fabric V2.5.pdf
PPTX
Ngrok을 이용한 Nginx Https 적용하기.pptx
PPTX
Kafka JDBC Connect Guide(Postgres Sink).pptx
PPTX
Kafka Rest.pptx
PDF
주가 정보 다루기.pdf
PDF
App development with quasar (pdf)
PDF
kubernetes practice
PDF
Hyperledger Fabric practice (v2.0)
Kubernetes BateMetal Installation and Practice
이더리움 기반 DApp 개발과 스마트 계약 실습 (ERC20,ERC721,ERC1155,ERC1400)
Ethereum Smart Contract Static Analyzer (Solidity Vulnerability Analyzer)
Deploy Hyperledger Besu using Kubernetes
kubernetes baremetal installation and practice
Hyperledger Besu 빨리 따라하기 (Private Networks)
Hyperledger Explorer.pptx
하이퍼레저 페이지 단위 블록 조회
토큰 증권 개요.pptx
Vue.js 기초 실습.pptx
Deploying Hyperledger Fabric on Kubernetes.pptx
k8s practice 2023.pptx
HyperLedger Fabric V2.5.pdf
Ngrok을 이용한 Nginx Https 적용하기.pptx
Kafka JDBC Connect Guide(Postgres Sink).pptx
Kafka Rest.pptx
주가 정보 다루기.pdf
App development with quasar (pdf)
kubernetes practice
Hyperledger Fabric practice (v2.0)

Kafka monitoring using Prometheus and Grafana

Editor's Notes

  • #16: 그라파나 자동 실행 : systemctl enable grafana-server.service