首页 > 其他分享 >Prometheus+Grafana搭建 (未完待续)

Prometheus+Grafana搭建 (未完待续)

时间:2022-10-25 18:13:42浏览次数:55  
标签:amd64 2.39 prometheus scrape Grafana 未完待续 Prometheus localhost

1.Prometheus介绍

prometheus是由谷歌研发的一款开源的监控软件,它通过安装在远程机器上的exporter,通过HTTP协议从远程的机器收集数据并存储在本地的时序数据库上

同时Prometheus后端用 golang语言开发,前端是 Grafana

2.Prometheus源码安装与启动配置

实验环境

192.168.0.223   Prometheus 服务端   centos 7.6

192.168.0.222   node_exporter 客户端  centos 7.6

下载Prometheus版本

[root@localhost ~]# wget https://mirrors.tuna.tsinghua.edu.cn/github-release/prometheus/prometheus/2.39.1%20_%202022-10-07/prometheus-2.39.1.linux-amd64.tar.gz

解压文件prometheus-2.39.1.linux-amd64.tar.gz     到/usr/local目录下

[root@localhost ~]# tar xf prometheus-2.39.1.linux-amd64.tar.gz -C /usr/local

prometheus-2.39.1.linux-amd64改名为prometheus

[root@localhost local]# mv prometheus-2.39.1.linux-amd64 prometheus

查看版本

[root@localhost prometheus]# ./prometheus --version

 

 prometheus.yml 配置

# my global config
global:
# 默认情况下,每15s拉取一次目标采样点数据。
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
# 每15秒评估一次规则。默认值为每1分钟。
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).

# Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets:
# - alertmanager:9093

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
# - "first_rules.yml"
# - "second_rules.yml"

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# job名称会增加到拉取到的所有采样点上,同时还有一个instance目标服务的host:port标签也会增加到采样点上
- job_name: 'prometheus'

# 覆盖global的采样点,拉取时间间隔5s
scrape_interval: 5s
static_configs:
- targets: ['localhost:9090']

服务启动

指定配置文件启动

[root@localhost prometheus]# ./prometheus --config.file=prometheus.yml

访问:http://192.168.0.223:909/

 

 

客户端安装node_exporter

 

标签:amd64,2.39,prometheus,scrape,Grafana,未完待续,Prometheus,localhost
From: https://www.cnblogs.com/QIzhu/p/16825803.html

相关文章

  • grafana Loki 轻量级日志收集系统
    部署dockerrun-dti-p3000:3000grafana/grafana:masterdockerrun-dti-p3100:3100--nameloki grafana/loki:2.4.1 dockerrun-dti--namepromtailgrafa......
  • prometheus 部署到一个容器里配置脚本
    目录prometheus部署到一个容器里配置脚本背景安装脚本Dockerfilestart.sh启动脚本restart.shapplication.conf启动向consul中注册的json配置cAdvisor_exporter.jsonmysql......
  • Prometheus监控Redis
    redis-exporter监控Redis一、单节点监控#启动,密码带特殊字符时需要用\进行转义dockerrun-dit-p9121:9121-eREDIS_ADDR=IP:6379-eREDIS_PASSWORD=password--na......
  • 网页通过iframe嵌入grafana
    进入grafana容器dockerexec-uroot-itgrafanash修改/usr/share/grafana/conf下的缺省配置文件defaults.ini我们添加参数:cfg:default.security.allow_embedding=tru......
  • Prometheus之PromQL进阶
    一Prometheus的聚合函数一般来说,单个指标的价值不大,监控场景中往往需要联合并可视化一组指标,这种联合机制即是指“聚合”操作,例如,将计算数、求和、平均值。分位数、标准差......
  • 使用Prometheus和Grafana监控Envoy Mesh
    环境说明宿主机地址为:192,.168.174.103envoy:FrontProxy,地址为172.31.10.2webserver01:第一个后端服务webserver01-sidecar:第一个后端服务的SidecarProxy,地址为172.31.10.......
  • Prometheus之Cadvisor实现pod资源监控
    一Cadvisor介绍GitHub地址:https://github.com/google/cadvisorcadvisor由谷歌开源,cadvisor不仅可以搜集一台机器上所有运行的容器信息,还提供基础查询界面和http接口,方便其......
  • Prometheus之Alertmanager介绍
    一告警功能概述Prometheus对指标的收集、存储同告警能力分属于PrometheusServer和Alertmanager连个独立的组件,前者仅负责基于告警规则生成告警通知,具体的告警操作则由后者......
  • Prometheus之blackbox_exporter使用帮助
    root@node-02:~#/usr/local/blackbox_exporter/blackbox_exporter--helpusage:blackbox_exporter[<flags>]Flags:-h,--help#显示上下文相关的帮助(也可以尝试-......
  • Prometheus之部署blackbox_exporter
    一blackboxexporter介绍GitHub地址:https://github.com/prometheus/blackbox_exporterblackbox_exporter是Prometheuse官方提供的一个exporter,可以通过HTTP、HTTPS、DNS、T......