欢迎光临
我们一直在努力

prometheus01-Prometheus安装

下载prometheus
https://prometheus.io/download/
tar xvfz prometheus-*.tar.gz
cd prometheus-*
mv prometheus-* /usr/local/prometheus

添加开机自启动
vim  /usr/lib/systemd/system/prometheus

[Unit]
Description=https://prometheus.io
 
[Service]
Restart=on-failure
ExecStart=/usr/local/prometheus/prometheus --config.file=/usr/local/prometheus/prometheus.yml
 
[Install]
WantedBy=multi-user.target

chmod +x  /usr/lib/systemd/system/prometheus
systemctl  start  prometheus
systemctl  enable  prometheus

浏览:

http://ip:9090

出现问题:时间不一致(如下类似)

Warning! Detected 457.83 seconds time difference between your browser and the server. Prometheus relies on accurate time and time drift might cause unexpected query results.

解决办法:

我自己吧服务器时间同步至  time1.aliyun.com

ntpdate time1.aliyun.com

然后把电脑的时间也同步至time1.aliyun.com  即可解决

l  global:全局配置

l  alerting:告警配置

l  rule_files:告警规则

l  scrape_configs:配置数据源,称为target,每个target用job_name命名。又分为静态配置和服务发现

赞(0)
【声明】:本博客不参与任何交易,也非中介,仅记录个人感兴趣的主机测评结果和优惠活动,内容均不作直接、间接、法定、约定的保证。访问本博客请务必遵守有关互联网的相关法律、规定与规则。一旦您访问本博客,即表示您已经知晓并接受了此声明通告。