티끌모아 태산
Metricbeat 설치 본문
내 경우에는 Elasticsearch와 Kibana는 다른 서버에 이미 설치되어있으므로 이것의 설치는 생략한다.
tar.gz파일을 받아서 푸는 방법도 있지만 yum명령어를 사용하는게 나중에 관리하는게 편할 것 같다.
Metricbeat 공식문서를 참고해서 해도된다.
https://www.elastic.co/guide/en/beats/metricbeat/current/setup-repositories.html
Repositories for APT and YUM | Metricbeat Reference [8.10] | Elastic
To add the Elastic repository, make sure that you use the echo method shown in the example. Do not use add-apt-repository because it will add a deb-src entry, but we do not provide a source package. If you have added the deb-src entry by mistake, you will
www.elastic.co
아래는 위 문서를 정리한 내용이다. (CentOS 환경)
1. 먼저 GPG-KEY를 다운받는다.
(Elasticsearch가 필요없다고해서 안해도 되는 것이 아니다.)
sudo rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
GPG-KEY의 설명은 아래와 같다. 대충 무결성을 방지하고 보안을 위한 KEY같은 것이라고 이해하면 될것같다.
Elasticsearch 패키지가 정식으로 서명되었음을 확인하기 위한 공개 키입니다. 패키지 서명은 소스가 신뢰할 수 있고 변경되지 않았음을 확인하는 데 사용됩니다. 즉, 패키지가 Elastic 사에서 제공한 것임을 검증하고, 중간자 공격(MITM)을 방지하기 위한 보안 조치 중 하나입니다.
Elasticsearch 패키지를 설치할 때 GPG-Key를 사용하면 패키지의 무결성을 보장할 수 있습니다. Elastic 사의 GPG-Key를 시스템에 추가하면 Elasticsearch 패키지가 해당 키로 서명된 것임을 확인할 수 있습니다.
2. /etc/yum.repos.d/ 경로에 elastic.repo 파일을 생성해서 아래 내용을 입력한다.
sudo vi /etc/yum.repos.d/elastic.repo
[elasticsearch]
name=Elasticsearch repository for 8.x packages
baseurl=https://artifacts.elastic.co/packages/8.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
3. 메트릭빗을 설치한다. 최신버전을 받고싶으면 뒤의 버전 정보를 빼버리면 된다.
sudo yum install metricbeat-8.7.1
4. 설치됐는지 확인한다
sudo systemctl status metricbeat
아래와 같이 나오면 성공.
● metricbeat.service - Metricbeat is a lightweight shipper for metrics.
Loaded: loaded (/usr/lib/systemd/system/metricbeat.service; disabled; vendor preset: disabled)
Active: inactive (dead)
Docs: https://www.elastic.co/beats/metricbeat
5. 설치된 Metricbeat의 버전을 확인해보자
metricbeat --version
혹시 GLIBC 날 수도 있다. 그럴 땐 아래 나의 글을 참고하길 바란다
https://wonseok.tistory.com/35
Metricbeat 실행 오류 발생 (GLIBC 2.12)
메트릭빗 실행시 아래와 같은 오류 발생 /usr/share/metricbeat/bin/metricbeat: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /usr/share/metricbeat/bin/metricbeat) GLIBC를 못찾는다고 한다. GLIBC는 간략하게 설명하
wonseok.tistory.com
다음엔 Metricbeat에서 Logstash로 시스템 메트릭을 전송하고,
Logstash에서 Elastic Search로 시스템 메트릭을 넣는 방법에 대해 포스팅하겠다.
https://wonseok.tistory.com/37
Metricbeat을 이용해 시스템 메트릭 수집 (with Logstash)
Metricbeat 설치가 안되어있다면 아래 링크를 참고하길 바란다. https://wonseok.tistory.com/36 Metricbeat 설치 내 경우에는 Elasticsearch와 Kibana는 다른 서버에 이미 설치되어있으므로 이것의 설치는 생략한다.
wonseok.tistory.com
'환경 > Metricbeats' 카테고리의 다른 글
Metricbeat을 이용해 시스템 메트릭 수집 (with Logstash) (0) | 2023.09.22 |
---|---|
Metricbeat 실행 오류 발생 (GLIBC 2.12) (0) | 2023.09.22 |