使用prometheus监控带安全认证的elasticsearch

1.下载elasticsearch_exporter

wget 下载二进制包并解压、运行:

wget https://github.com/prometheus-community/elasticsearch_exporter/releases/download/v1.3.0/elasticsearch_exporter-1.3.0.linux-amd64.tar.gz

tar -xvf elasticsearch_exporter-1.3.0.linux-amd64.tar.gz

mv elasticsearch_exporter-1.3.0.linux-amd64/ elasticsearch_exporter

cd elasticsearch_exporter

2.运行elasticsearch_exporter:

nohup ./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://elastic:FtBMPT31rPiQ@192.168.2.40:9200 &

(uri中要写成自己es的用户和密码)

查看输出日志:

3.看指标信息:

web 访问

4.启动好后来prometheus添加配置 

编辑prometheus.yml

  - job_name: "es"

    static_configs:

      - targets: ["192.168.2.40:9114"]

      - targets: ["192.168.2.41:9114"]

      - targets: ["192.168.2.42:9114"]

5. 登录prometheus http://192.168.2.xx:9090/

6.配置完成后在Grafana官网中下载es的监控模板  Dashboards | Grafana Labs  下载es的模板

https://grafana.com/grafana/dashboards/14191-elasticsearch-overview/

7.添加Prometheus 数据源

8.选择 Prometheus

9.导入监控 Dashboard 模板 

10.查看指标信息是否有数据

 至此,配置完成!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
使用Prometheus监控Spark集群,需要进行以下步骤: 1. 安装Prometheus,可以从官网下载并安装。 2. 安装Spark exporter,这是一个用于将Spark指标导出到Prometheus的工具。可以从GitHub上下载并安装。 3. 配置Spark exporter,需要指定要监控的Spark集群地址和端口。可以在Spark的配置文件中添加以下配置: ``` spark.metrics.conf *.sink.prometheus.class org.apache.spark.metrics.sink.PrometheusSink ``` 4. 启动Prometheus和Spark exporter,可以使用以下命令: ``` ./prometheus --config.file=prometheus.yml ./spark-2.4.0-bin-hadoop2.7/bin/spark-submit --conf spark.metrics.conf=metrics.properties --class org.apache.spark.examples.SparkPi --master yarn --deploy-mode cluster --driver-memory 2g --executor-memory 2g --num-executors 2 --executor-cores 1 --conf spark.metrics.conf=metrics.properties --conf spark.metrics.namespace=spark org.apache.spark.examples.sparkpi 10 ``` 其中,--conf spark.metrics.namespace=spark 指定了要监控的Spark命名空间。 5. 在Prometheus中配置Spark指标,可以在prometheus.yml文件中添加以下配置: ``` - job_name: 'spark' scrape_interval: 5s static_configs: - targets: ['localhost:9090'] metrics_path: '/metrics/json' relabel_configs: - source_labels: [__name__] regex: '(.+)' target_label: __name__ ``` 其中,targets指定了Spark exporter的地址和端口。 6. 在Grafana中创建仪表盘,可以使用Prometheus数据源,并使用Spark指标创建图表。 以上就是使用Prometheus监控Spark的步骤。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值