grafana 설치 이후 loki 와 promtail 을 설치 하여 로그를 모니터링 하는 방법에 대해 알아 보겠습니다.
구성 설명
Promtail: 로그를 수집하고 필터링한 후 Loki로 전송하는 로그 수집기.
Loki: 로그 데이터를 저장하고 검색 쿼리를 처리하는 로그 데이터베이스.
Grafana: Loki로부터 데이터를 시각화하고 분석하는 대시보드 툴 입니다. .
설치
Loki 설치
loki 바이너리를 다운로드 받아 압축해제후 loki 설치 합니다.
#loki 다운로드
mkdir loki
cd loki
wget https://github.com/grafana/loki/releases/download/v2.9.8/loki-linux-amd64.zip
unzip loki-linux-amd64.zip
#loki 환경설정 파일 다운로드
wget https://raw.githubusercontent.com/grafana/loki/main/cmd/loki/loki-local-config.yaml
이번 글은 Rocky 9.4 환경에서 Zabbix 6.0 설치 하는 방법에 대해 소개합니다.
환경구성
Zabbix Server 설치
Rocky Linux release 9.4 (Blue Onyx)
PostgreSQL 15.7
# zabbix_server --version zabbix_server: /usr/pgsql-14/lib/libpq.so.5: no version information available (required by zabbix_server) zabbix_server (Zabbix) 6.0.30 Revision 680df722d6b 21 May 2024, compilation time: May 21 2024 00:00:00
Copyright (C) 2024 Zabbix SIA License GPLv2+: GNU GPL version 2 or later <https://www.gnu.org/licenses/>. This is free software: you are free to change and redistribute it according to the license. There is NO WARRANTY, to the extent permitted by law.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/).
Compiled with OpenSSL 3.0.7 1 Nov 2022 Running with OpenSSL 3.0.7 1 Nov 2022
Zabbix Agent 설치
Red Hat Enterprise Linux release 9.2 (Plow)
Red Hat Enterprise Linux release 8.7 (Ootpa)
Rocky Linux release 8.9 (Green Obsidian)
CentOS Linux release 7.9.2009 (Core)
Zabbix 설치
Zabbix 버전은 6.0 LTS 버전 + PostgreSQL 15 버전을설치하여 진행 합니다.
Zabbix 서버 설치
Rocky Linux release 9.4 에Zabbix 6.0 LTS 버전을 설치 합니다.
# vi /etc/yum.repos.d/epel.repo [epel] name=Extra Packages for Enterprise Linux $releasever - $basearch # It is much more secure to use the metalink, but if you wish to use a local mirror # place its address here. #baseurl=https://download.example/pub/epel/$releasever/Everything/$basearch/ metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-$releasever&arch=$basearch&infra=$infra&content=$contentdir enabled=1 gpgcheck=1 countme=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-$releasever excludepkgs=zabbix*
zabbix repository 설치
rpm -Uvh https://repo.zabbix.com/zabbix/6.0/rhel/9/x86_64/zabbix-release-6.0-4.el9.noarch.rpm
dnf clean all
아래와 같은 에러 가 발생할경우 zabbix 에서 postgresql 에 접속이 실패할경우 아래 두파일의 설정을 재 확인합니다.
/var/lib/pgsql/15/data/postgresql.conf
vi /var/lib/pgsql/15/data/pg_hba.conf
connection to database 'zabbix' failed: [0] connection to server at "localhost" (::1), port 5432 failed: 치명적오류: 사용자 "zabbix"의 password 인증을 실패했습니다
617085:20240530:201041.783 Starting Zabbix Server. Zabbix 6.0.30 (revision 680df722d6b). 617085:20240530:201041.783 ****** Enabled features ****** 617085:20240530:201041.783 SNMP monitoring: YES 617085:20240530:201041.783 IPMI monitoring: YES 617085:20240530:201041.783 Web monitoring: YES 617085:20240530:201041.783 VMware monitoring: YES 617085:20240530:201041.783 SMTP authentication: YES 617085:20240530:201041.783 ODBC: YES 617085:20240530:201041.783 SSH support: YES 617085:20240530:201041.783 IPv6 support: YES 617085:20240530:201041.783 TLS support: YES 617085:20240530:201041.783 ****************************** 617085:20240530:201041.783 using configuration file: /etc/zabbix/zabbix_server.conf 617085:20240530:201042.064 [Z3001] connection to database 'zabbix' failed: [0] connection to server at "localhost" (::1), port 5432 failed: 치명적오류: 사용자 "zabbix"의 pa ssword 인증을 실패했습니다
617085:20240530:201042.064 database is down: reconnecting in 10 seconds 617085:20240530:201052.077 [Z3001] connection to database 'zabbix' failed: [0] connection to server at "localhost" (::1), port 5432 failed: 치명적오류: 사용자 "zabbix"의 pa ssword 인증을 실패했습니다
617085:20240530:201052.077 database is down: reconnecting in 10 seconds 617085:20240530:201102.089 [Z3001] connection to database 'zabbix' failed: [0] connection to server at "localhost" (::1), port 5432 failed: 치명적오류: 사용자 "zabbix"의 pa ssword 인증을 실패했습니다
유저 그룹 명을 작성 하고 권한을 선택하하고 추가 버튼을 누르면 신규 생성한 유저 그룹에 부여된 권한을 확인할수 있습니다.
좌측 관리 매뉴를 클릭해서 유저를 작성 합니다.
Zabbix 5.0 VS Zabbix 6.0
Zabbix 6.0은 5.0 버전에 비해 성능, 보안, 사용자 인터페이스, 모니터링 기능, 자동화 및 통합 기능 등 여러 면에서 향상되었습니다. 특히, 대규모 환경에서의 성능 최적화, 클라우드 및 컨테이너 모니터링 강화, 사용자 인터페이스 개선, 보안 기능 향상 등이 주요한 차이점입니다. 이러한 개선 사항을 통해 Zabbix는 더욱 강력하고 유연한 네트워크 모니터링 솔루션이 되었습니다.
설치후 크게 변한 부분은 관리 매뉴 처럼 보입니다.
그리고 5.0 에서는 disk 사용하기 위해서는 템플릿을 사용 했었는데
이제는 템플릿을 따로 등록 하지 않아도 기본적으로 확인가능한 지표들이 더 많아 진것 같습니다.
결론은 Zabbix 6.0 이 5.0 보다 모니터링할 지표가 더 많이 추가 되고 사용성이 개선되었다 인것 같습니다.
Grafana는 오픈 소스 데이터 시각화 및 모니터링 도구입니다. 주로 다양한 데이터 소스로부터 수집된 데이터를 시각적으로 표현하고 모니터링하는 데 하는 하는 툴입니다. Grafana를 설치 한후 대시보드를 만들어 다양한 형식의 차트, 그래프, 지표 등을 통해 데이터를 시각화할 수 있습니다.
Total size: 420 M Installed size: 420 M Downloading packages: Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : grafana-enterprise-10.4.2-1.x86_64 1/1 ### NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd sudo /bin/systemctl daemon-reload sudo /bin/systemctl enable grafana-server.service ### You can start grafana-server by executing sudo /bin/systemctl start grafana-server.service POSTTRANS: Running script Verifying : grafana-enterprise-10.4.2-1.x86_64 1/1