카이도스의 Tech Blog
ES-Cluster 구성 - 5(ElasticSearch_Exporter 구성 & Prometheus 연동) 본문
728x90
반응형
2024.03.02 - [Elasticsearch] - ES-Cluster 구성 - 1(공통)
2024.03.02 - [Elasticsearch] - ES-Cluster 구성 - 2(MasterNode, Kibana)
2024.03.02 - [Elasticsearch] - ES-Cluster 구성 - 3(DataNode)
2024.03.02 - [Elasticsearch] - ES-Cluster 구성 - 4(Fleet Server 설치)
- 공식 ES Exporter Github (https://github.com/prometheus-community/elasticsearch_exporter)
# Source 파일 다운로드 - Master 노드에만 설치 진행
wget https://github.com/prometheus-community/elasticsearch_exporter/releases/download/v1.7.0/elasticsearch_exporter-1.7.0.linux-amd64.tar.gz
tar -zxvf elasticsearch_exporter-1.7.0.linux-amd64.tar.gz && rm -rf elasticsearch_exporter-1.7.0.linux-amd64.tar.gz
cd elasticsearch_exporter-1.7.0.linux-amd64
sudo cp elasticsearch_exporter /usr/local/bin/
(계정 정보 : elastic/xgtestes!@)
# systemd 생성
sudo su -
cat <<EOT>> /etc/systemd/system/elasticsearch_exporter.service
[Unit]
Description=Prometheus elasticsearch_exporter
After=local-fs.target network-online.target network.target
Wants=local-fs.target network-online.target network.target
[Service]
User=root
Nice=10
ExecStart = /usr/local/bin/elasticsearch_exporter --collector.clustersettings --web.listen-address=0.0.0.0:9114 --es.uri="https://elastic:xgtestes!@@localhost:9200" --es.timeout=10s --es.all --es.indices --es.indices_settings --es.shards --es.ssl-skip-verify
ExecStop= /usr/bin/killall elasticsearch_exporter
[Install]
WantedBy=default.target
EOT
# 데몬 실행
sudo systemctl daemon-reload && sudo systemctl start elasticsearch_exporter
sudo systemctl enable elasticsearch_exporter
sudo systemctl status elasticsearch_exporter
# 포트 확인
sudo netstat -nltp | grep 9114
tcp6 0 0 :::9114 :::* LISTEN 3777/elasticsearch_
# 메트릭 확인
curl localhost:9114/metrics
....
elasticsearch_thread_pool_threads_count{cluster="xg-es",es_client_node="true",es_data_node="true",es_ingest_node="true",es_master_node="false",host="IP",name="es-data2",type="azure_event_loop"} 0
elasticsearch_thread_pool_threads_count{cluster="xg-es",es_client_node="true",es_data_node="true",es_ingest_node="true",es_master_node="false",host="IP",name="es-data2",type="ccr"} 0
elasticsearch_thread_pool_threads_count{cluster="xg-es",es_client_node="true",es_data_node="true",es_ingest_node="true",es_master_node="false",host="IP",name="es-data2",type="cluster_coordination"}1
....
- Prometheus 설정
# prometheus.yaml job 추가 설정
sudo vi /etc/prometheus/prometheus.yml
- job_name: xg-es
metrics_path: "/metrics"
static_configs:
- targets: ['IP:9114']
# 서비스 재기동
sudo systemctl restart prometheus.service
sudo systemctl status prometheus.service
# 메트릭 확인
브라우저 접속 : IP:9090
- Grafana 대시보드 : 13071, 13072, 13073, 13074
728x90
반응형
'Elasticsearch' 카테고리의 다른 글
ES-Cluster 구성 - 4(Fleet Server 설치) (0) | 2024.03.02 |
---|---|
ES-Cluster 구성 - 3(DataNode) (0) | 2024.03.02 |
ES-Cluster 구성 - 2(MasterNode, Kibana) (0) | 2024.03.02 |
ES-Cluster 구성 - 1(공통) (0) | 2024.03.02 |
Comments