前言 选择grafana作为监控是因为它展示出来很漂亮,而且可下载到前人使用过的配置文件,能够快速的搭建起监控系统;选择elasticsearch_exporter是因为它与ES集群是分开独立的,不需要对原有的ES集群(可能有很多个)做任何修改,不需要重启,只要能访问es集群即可,非常方便 。
1.安装elasticsearch_exporter 1.1 下载链接:elasticsearch_exporter 下载版本:elasticsearch_exporter-1.1.0.linux-amd64.tar.gz
1.2 安装启动 安装go:yum -y install golang
上传elasticsearch_exporter-1.1.0.linux-amd64.tar.gz文件到/usr/local/目录,解压:
tar -xvf elasticsearch_exporter-1.1.0.linux-amd64.tar.gzcd elasticsearch_exporter-1.1.0.linux-amd64/ 只要设置不同的-web.listen-address监听端口,可启动多个实例,分别监控不同的ES集群:
# es集群1:10.xxx.xxx.10:9200nohup ./elasticsearch_exporter --es.all --es.indices --es.cluster_settings --es.indices_settings --es.shards --es.snapshots --es.timeout=10s --web.listen-address=":9114" --web.telemetry-path="/metrics" --es.uri http://10.xxx.xxx.10:9200 es集群2:10.xxx.xxx.11:9200nohup ./elasticsearch_exporter --es.all --es.indices --es.cluster_settings --es.indices_settings --es.shards --es.snapshots --es.timeout=10s --web.listen-address=":9115" --web.telemetry-path="/metrics" --es.uri http://10.xxx.xxx.11:9200 & 可通过命令:tailf nohup.out 查看日志 。
启动成功后,可以访问curl “http://127.0.0.1:9114/metrics”,看抓取的指标信息
elasticsearch_breakers_estimated_size_bytes{breaker="fielddata",cluster="es-test",es_client_node="true",es_data_node="true",es_ingest_node="true",es_master_node="true",host="10.xxx.xxx.xxx",name="test_es04"} 0elasticsearch_breakers_estimated_size_bytes{breaker="in_flight_requests",cluster="es-test",es_client_node="true",es_data_node="true",es_ingest_node="true",es_master_node="true",host="10.xxx.xxx.xxx",name="test_es05"} 489 2.Prometheus 2.1下载 prometheus, 下载链接:https://prometheus.io/download/,下载prometheus-2.16.0.linux-amd64.tar.gz,并上传到/usr/local/解压
2.2修改prometheus组件的prometheus.yml加入elasticsearch节点: # A scrape configuration containing exactly one endpoint to scrape:# Here it's Prometheus itself.scrape_configs:# The job name is added as a label `job= 启动:./prometheus
可通过命令查看:curl “http://localhost:9090/status”
3.Grafana 3.1下载仪表盘配置 下载链接:https://grafana.com/grafana/dashboards/2322
这里的配置还是比较全面的,可以直接使用 。
3.2 导入仪表盘 【Elasticsearch集群监控:elasticsearch】
3.3 查看仪表盘
这里有具体监控的指标解释:Metrics
- 春季老年人吃什么养肝?土豆、米饭换着吃
- 三八妇女节节日祝福分享 三八妇女节节日语录
- 老人谨慎!选好你的“第三只脚”
- 校方进行了深刻的反思 青岛一大学生坠亡校方整改校规
- 脸皮厚的人长寿!有这特征的老人最长寿
- 长寿秘诀:记住这10大妙招 100%增寿
- 春季老年人心血管病高发 3条保命要诀
- 眼睛花不花要看四十八 老年人怎样延缓老花眼
- 香槟然能防治老年痴呆症? 一天三杯它人到90不痴呆
- 老人手抖的原因 为什么老人手会抖
