首页 > 其他分享 >Prometheus联邦集群

Prometheus联邦集群

时间:2022-08-25 08:22:25浏览次数:48  
标签:node 10.0 exporter centos apps prometheus Prometheus 集群 联邦

10.0.0.3 Prometheus
10.0.0.5 Prometheus联邦
10.0.0.7 Prometheus联邦
10.0.0.2 node_exporter
10.0.0.9 node_exporter

10.0.0.3、10.0.0.5、10.0.0.7都安装prometheus

[root@VM-0-3-centos ~]# wget https://github.com/prometheus/prometheus/releases/download/v2.37.0/prometheus-2.37.0.linux-amd64.tar.gz -C /apps
[root@VM-0-3-centos ~]# tar xvf prometheus-2.37.0.linux-amd64.tar.gz
[root@VM-0-3-centos ~]# ln -sv /apps/prometheus-2.37.0.linux-amd64 /apps/prometheus
[root@VM-0-3-centos ~]# vim /etc/systemd/system/prometheus.service
[Unit]
Description=Prometheus Server
Documentation=https://prometheus.io/docs/introduction/overview/
After=network.target

[Service]
Restart=on-failure
WorkingDirectory=/apps/prometheus/
ExecStart=/apps/prometheus/prometheus   --config.file=/apps/prometheus/prometheus.yml --web.enable-lifecycle

[Install]
WantedBy=multi-user.target
[root@VM-0-3-centos ~]# systemctl restart prometheus
[root@VM-0-3-centos ~]# systemctl enable prometheus

10.0.0.2、10.0.0.9安装node_exporter

[root@VM-0-9-centos node_exporter]# wget https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-amd64.tar.gz -C /apps
[root@VM-0-9-centos node_exporter]# tar -xvf node_exporter-1.3.1.linux-amd64.tar.gz 
[root@VM-0-9-centos node_exporter]# ln -sv /apps/node_exporter-1.3.1.linux-amd64.tar.gz /apps/node_exporter
[root@VM-0-9-centos node_exporter]# vim /etc/systemd/system/node_exporter.service 
[Unit]
Description=node_exporter
Documentation=https://prometheus.io/docs/introduction/overview/
After=network.target

[Service]
Restart=on-failure
WorkingDirectory=/apps/node_exporter/
ExecStart=/apps/node_exporter/node_exporter

[Install]
WantedBy=multi-user.target
[root@VM-0-9-centos node_exporter]# systemctl restart node_exporter.service
[root@VM-0-9-centos node_exporter]# systemctl enable node_exporter.service

10.0.0.5、10.0.0.7配置prometheus.yml

vim /apps/prometheus/prometheus.yml 

- job_name: "prometheus-0.9"

    static_configs:
      - targets: ["10.0.0.9:9100"]
vim /apps/prometheus/prometheus.yml

- job_name: "prometheus-0.2"

    static_configs:
      - targets: ["10.0.0.2:9100"]
systemctl restart prometheus.service

 10.0.0.3配置prometheus.yml,添加联邦服务器地址

vim /apps/prometheus/prometheus.yml 

  - job_name: 'prometheus-federate-0.7'
    scrape_interval: 10s
    honor_labels: true
    metrics_path: '/federate'
    params:
      'match[]':
       - '{job="prometheus"}'
       - '{__name__=~"job:.*"}'
       - '{__name__=~"node.*"}'
    static_configs:
    - targets:
      - '10.0.0.5:9090'

  - job_name: 'prometheus-federate-0.5'
    scrape_interval: 10s
    honor_labels: true
    metrics_path: '/federate'
    params:
      'match[]':
       - '{job="prometheus"}'
       - '{__name__=~"job:.*"}'
       - '{__name__=~"node.*"}'
    static_configs:
    - targets:
      - '10.0.0.7:9090'
systemctl restart prometheus.service

查看有没有联邦集群监控到的node

标签:node,10.0,exporter,centos,apps,prometheus,Prometheus,集群,联邦
From: https://www.cnblogs.com/zyyang1993/p/16621158.html

相关文章

  • Prometheus使用远端存储VictoriaMetrics
    下载并配置[root@k8s-node2apps]#wgethttps://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v1.80.0/victoria-metrics-linux-amd64-v1.80.0.tar.gz......
  • Redis集群模式搭建
    Redis主要有三种集群方案:主从模式哨兵模式集群模式集群模式搭建Redis3.0版本之后才可用,推荐3主3从集群模式。1.启动6台Redis配置文件如下,redis_7002.conf...类......
  • EasyCVR集群服务器离线后,设备依然显示在线的问题优化
    关于EasyCVR的集群功能,我们在前期的文章中也分享过很多,感兴趣的用户可以翻阅我们往期的文章进行了解。作为一种高效的服务器协作方式,服务器集群在流媒体服务中运用也较多。......
  • 搭建hadoop高可用集群
    一、搭建高可用集群1.1zookeeper搭建1、上传安装包到master并解压tar-xvfzookeeper-3.4.6.tar.gz2、配置环境变量vim/etc/profileexportZOOKEEPER_HOME=/usr/......
  • Prometheus企业微信告警
    自己注册一个企业微信,进入管理控制台。在应用管理中点击创建应用创建机器人发送消息测试发送消息测试,我这里可以正常收到消息找到企业ID找到机器人的AgentId......
  • redis集群
    一:集群1.哨兵的问题在redis3.0以前的版本要实现集群一般是借助哨兵sentinel工具来监控master节点的状态,如果master节点异常,则会做主从切换,将某一台slave作为master,......
  • 知识蒸馏 孪生网络 联邦学习
    ......
  • prometheus监控redis-cluster集群
    信息prometheusv2.1.0redis_exporterv1.6.1rediscluster5.03mater3slaveprometheus.yml在prometheus.yml添加两个job,redis_exporter和redis_exporter_target......
  • 二、chaosblade实现k8s集群操作
    1、执行Kubernetes实验场景,需要提前部署ChaosBladeOperator,Helm安装包下载地址https://github.com/chaosblade-io/chaosblade-operator/releases。使用以下命令安装......
  • 社会集群
    https://www.acwing.com/problem/content/description/1599/#include<iostream>#include<cstring>#include<algorithm>#include<vector>usingnamespacestd;......