一. 简介:
关于elasticsearch的简介和部署,可以参考单独的文章elasticsearch基础概念与集群部署-优快云博客,这里就不细说了。这里只讲讲如何在k8s中部署export并基于prometheus做es的指标采集。
二. 实现方式:
首先我们需要先部署exporter采集器,提供给prometheus调用 ,这里我们选择在k8s中部署,好处是: k8s有健康检测机制,不需要独立维护exporter的故障问题。这里采用deployment的方式:
apiVersion: apps/v1
kind: Deployment
metadata:
name: elastic-exporter
namespace: monitoring
spec:
replicas: 1
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
type: RollingUpdate
selector:
matchLabels:
app: elastic-exporter
template:
metadata:
labels:
app: elastic-exporter
spec:
containers:
- command:
- /bin/elasticsearch_exporter
- --es.uri=http://elastic:xxxx@10.0.36.1:9200 #这里采用了认证方式,如果没有认证,可直接配置url地址,即;http:/

最低0.47元/天 解锁文章
3496

被折叠的 条评论
为什么被折叠?



