Notice: 函数 WP_Scripts::localize 的调用方法不正确$l10n 参数必须是一个数组。若要将任意数据传递给脚本,请改用 wp_add_inline_script() 函数。 请查阅调试 WordPress来获取更多信息。 (这个消息是在 5.7.0 版本添加的。) in /data/www/appblog/wp-includes/functions.php on line 6131

CentOS下部署Prometheus

Prometheus介绍

Prometheus是一个开源的系统监控和报警的工具包,最初由SoundCloud发布。

官方网址:https://prometheus.io/
软件下载:https://prometheus.io/download/
GitHub:https://github.com/prometheus/prometheus
Github Release:https://github.com/prometheus/prometheus/releases/
Prometheus Exporters:https://prometheus.io/docs/instrumenting/exporters/

特点:

  • 多维数据模型(有metric名称和键值对确定的时间序列)
  • 灵活的查询语言
  • 不依赖分布式存储
  • 通过pull方式采集时间序列,通过http协议传输
  • 支持通过中介网关的push时间序列的方式
  • 监控数据通过服务或者静态配置来发现
  • 支持图表和dashboard等多种方式

组件:

  • Prometheus 主程序,主要是负责存储、抓取、聚合、查询方面
  • Alertmanager 程序,主要是负责实现报警功能
  • Pushgateway 程序,主要是实现接收由Client push过来的指标数据,在指定的时间间隔,由主程序来抓取
  • *_exporter 这类是不同系统已经实现了的集成

Prometheus部署

(1)安装及配置

# tar -zxf prometheus-2.11.1.linux-amd64.tar.gz -C /usr/local/
# mv /usr/local/prometheus-2.11.1.linux-amd64 /usr/local/prometheus
# cd /usr/local/prometheus
# vim prometheus.yml
scrape_interval: 15s   # 默认15秒到目标处抓取数据

(2)启动

nohup ./prometheus --config.file=prometheus.yml &
nohup ./prometheus --config.file=prometheus.yml --web.enable-lifecycle &
curl -s -XPOST localhost:9090/-/reload

(3)WEB页面访问:http://localhost:9090/ ,可以看到Prometheus的graph页面

上一篇 InfluxDB + Jmeter + Grafana
下一篇 Prometheus + Grafana 使用 Node Exporter 监控主机