Prometheus监控服务器

【●】Prometheus监控服务器
1.监控简介
●Prometheus是由SoundCloud开源的监控报警解决方案。
— 采用Go语言开发
— Prometheus存储的是时序数据(时序数据库)
— 数据带时间标签
— 如<metric name> {< | abe | name>=<|abe| value>, . . .}
— Prometheus主要用在监控容器数据,也可以监控常规主机
— Prometheus重视高利用,如果您需要100%准确性、那么该软件不适合,因为他收集的数据可能不会足够详细和完整。

案例一 : Prometheus监控服务器
步骤一:安装监控软件(192.168.4.10主机操作)
1)安装软件(软件包在第二阶段素材prometheus_soft.tar.gz中有提供,需要提前将软件拷贝到虚拟机,解压即可使用)。
[root@prometheus ~]# tar -xf prometheus_soft.tar.gz
[root@prometheus ~]# cd prometheus_soft
[root@prometheus prometheus_soft]# tar -xf prometheus-2.17.2.linux-386.tar.gz
[root@prometheus prometheus_soft]# ls
[root@prometheus prometheus_soft]# mv prometheus-2.17.2.linux-386 /usr/local/prometheus
[root@prometheus prometheus_soft]# ls /usr/local/prometheus/

2)修改prometheus配置文件。
[root@prometheus ~]# vim /usr/local/prometheus/prometheus.yml
static_configs:
    - targets: ['192.168.4.10:9090']                      #修改最后一行,将IP地址改为本机IP
[root@prometheus ~]# /usr/local/prometheus/promtool check config \
/usr/local/prometheus/prometheus.yml           #检查配置配置文件是否有语法错误

3)编写服务service文件,使用systemd管理服务。
[root@prometheus ~]# vim /usr/lib/systemd/system/prometheus.service
[Unit]
Description=Prometheus Monitoring System
After=network.target
[Service]
ExecStart=/usr/local/prometheus/prometheus \
  --config.file=/usr/local/prometheus/prometheus.yml \
  --storage.tsdb.path=/usr/local/prometheus/data/
[Install]

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值