Obsidian/Recognition/Programing/Kafka(AMQP)/Kafka ELK로 모니터링.md

60 lines
1.4 KiB
Markdown

- metricbeat 사용
https://www.elastic.co/kr/blog/how-to-monitor-containerized-kafka-with-elastic-observability
``` yml
-- 다운로드
https://www.elastic.co/kr/downloads/past-releases/metricbeat-7-11-1
-- MetricBeat 압축풀기
tar -zxvf metricbeat-8.12.1-linux-x86_64.tar.gz
cd ${설치경로}
-- system metric 기능 활성화
./metricbeat modules enable system
./metricbeat modules enable kafka
./filebeat modules enable kafka system
-- Setup (MetricBeat과 연결된 Kibana의 Dashboard를 초기화)
./metricbeat setup -e
./metricbeat setup -c metricbeat.yml
-- 서비스 실행
./metricbeat -e --strict.perms=false
./metricbeat -e -c metricbeat.yml
```
- jolokia 적용
https://dev.to/martinhynar/monitoring-kafka-brokers-using-jolokia-metricbeat-and-elasticsearch-5678
```shell
# 다운로드
https://jolokia.org/download.html
# docker-compose에 volumes추가
volumes:
- ./jolokia-agent-jvm-2.0.2-javaagent.jar:/home/appuser/jolokia.jar
KAFKA_JMX_OPTS: "-javaagent:/home/appuser/jolokia.jar=port=8771,host=10.200.31.6 -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
```
- ELK 연동
https://github.com/freepsw/kafka-metrics-monitoring/tree/master/kafka_monitoring_package
- AKHQ
/home/gmt/SACP-INSTALL/akhq/jdk-18/bin/java -Dmicronaut.config.files=akhq_config_simple.yml -jar akhq.jar