)
一、什么是Prometheus所谓的Prometheus是一款开源的监控系统可以监控主流的中间件操作系系统硬件设备网络设备等。相比于zabbix而言Prometheus强项是对容器的监控微服务的监控更加方便。Prometheus作为CNCF第二个毕业项目也是采用了GO语言编写。官网地址:https://prometheus.io/官方架构图:https://prometheus.io/docs/introduction/overview/github地址:https://github.com/prometheus/prometheusPrometheus架构图二、部署Prometheus1.二进制部署1 下载软件包wget https://github.com/prometheus/prometheus/releases/download/v3.5.0/prometheus-3.5.0.linux-amd64.tar.gz2 解压软件包[rootpromethues-server31 ~]# tar xf prometheus-3.5.0.linux-amd64.tar.gz -C /usr/local/ [rootpromethues-server31 ~]# [rootpromethues-server31 ~]# ll /usr/local/prometheus-3.5.0.linux-amd64/ total 302936 drwxr-xr-x 2 1001 fwupd-refresh 4096 Jul 15 00:38 ./ drwxr-xr-x 11 root root 4096 Aug 4 09:07 ../ -rw-r--r-- 1 1001 fwupd-refresh 11357 Jul 15 00:36 LICENSE -rw-r--r-- 1 1001 fwupd-refresh 3773 Jul 15 00:36 NOTICE -rwxr-xr-x 1 1001 fwupd-refresh 159425376 Jul 15 00:17 prometheus* -rw-r--r-- 1 1001 fwupd-refresh 1093 Jul 15 00:36 prometheus.yml -rwxr-xr-x 1 1001 fwupd-refresh 150746286 Jul 15 00:17 promtool* [rootpromethues-server31 ~]#3 运行Prometheus[rootpromethues-server31 ~]# cd /usr/local/prometheus-3.5.0.linux-amd64/ [rootpromethues-server31 prometheus-3.5.0.linux-amd64]# ./prometheus4. 访问Prometheus的webUihttp://10.0.0.31:90905 卸载服务[rootpromethues-server31 ~]# rm -rf /usr/local/prometheus-3.5.0.linux-amd64/ [rootpromethues-server31 ~]#2.一键部署脚本部署我把部署过程写成了脚本可以一键部署感兴趣的小伙伴可以评论区留言使用脚本一键运行[rootprometheus-server31 ~]# ./install-prometheus-server.sh i三、部署node-exporter环境1.二进制部署1.下载软件包[rootnode-exporter41 ~]# wget https://github.com/prometheus/node_exporter/releases/download/v1.9.1/node_exporter-1.9.1.linux-amd64.tar.gz2.解压软件包[rootnode-exporter41 ~]# tar xf node_exporter-1.9.1.linux-amd64.tar.gz -C /usr/local/ [rootnode-exporter41 ~]#3.运行node-exporter[rootnode-exporter41 ~]# cd /usr/local/node_exporter-1.9.1.linux-amd64/ [rootnode-exporter41 node_exporter-1.9.1.linux-amd64]# [rootnode-exporter41 node_exporter-1.9.1.linux-amd64]# ll total 21708 drwxr-xr-x 2 1001 1002 4096 Apr 1 23:23 ./ drwxr-xr-x 11 root root 4096 May 12 09:13 ../ -rw-r--r-- 1 1001 1002 11357 Apr 1 23:23 LICENSE -rwxr-xr-x 1 1001 1002 22204245 Apr 1 23:19 node_exporter* -rw-r--r-- 1 1001 1002 463 Apr 1 23:23 NOTICE [rootnode-exporter41 node_exporter-1.9.1.linux-amd64]# [rootnode-exporter41 node_exporter-1.9.1.linux-amd64]# ./node_exporter4.访问node-exporter的WebUI[rootpromethues-server31 ~]# curl -s http://10.0.0.41:9100/metrics | wc -l 1116 [rootpromethues-server31 ~]#5.卸载二进制部署的node-exporter[rootnode-exporter41 ~]# rm -rf /usr/local/node_exporter-1.9.1.linux-amd64/ [rootnode-exporter41 ~]#2.一键部署脚本部署和上面一样这里我也把部署过程写成了脚本感兴趣的小伙伴可以评论区留言呦1.安装node-exporter[rootnode-exporter41 ~]# ./install-node-exporter.sh i [rootnode-exporter41 ~]#2.访问WebUIhttp://10.0.0.41:9100/metrics到这里Prometheus的server部署和node-export部署就完毕了。好的这就结束啦后续会陆续更新Prometheus监控系统的其他内容感兴趣加个关注。