Prometheus 部署及使用node_exporter 采集客户端数据

Prometheus 部署及使用node_exporter 采集客户端数据

 

环境:

软件: prometheus-2.5.0 , node_exporter-1.0.1

客户端IP: 192.168.31.30,192.168.31.[40..42]

prometheus端IP: 192.168.31.250

 

一、部署Prometheus 服务端

1.1 二进制部署promethues

官网下载对于的包:https://prometheus.io/download/

Prometheus 部署及使用node_exporter 采集客户端数据

[root@prometheus ~]# wget https://github.com/prometheus/prometheus/releases/download/v2.5.0/prometheus-2.5.0.linux-amd64.tar.gz

[root@prometheus ~]# tar -xf prometheus-2.5.0.linux-amd64.tar.gz

[root@prometheus ~]# cd prometheus-2.5.0.linux-amd64/

[root@prometheus prometheus-2.5.0.linux-amd64]# cp prometheus promtool /usr/local/bin

[root@prometheus prometheus-2.5.0.linux-amd64]# prometheus –version //查看下prometheus 版本

[root@prometheus prometheus-2.5.0.linux-amd64]# mkdir /etc/prometheus //创建prometheus 配置文件目录

[root@prometheus prometheus-2.5.0.linux-amd64]# cp prometheus.yml /etc/prometheus/

 

1.2 为了方便管理,创建prometheus.service 文件,使用systemd 去管理

[root@prometheus ~]# vim /etc/systemd/system/prometheus.service

[Unit]

Description=Prometheus Monitoring System

Documentation=Prometheus Monitoring System


[Service]

ExecStart=/usr/local/bin/prometheus \

--config.file=/etc/prometheus/prometheus.yml \

--web.listen-address=:9090


[Install]

WantedBy=multi-user.target

[root@prometheus ~]# systemctl daemon-reload

[root@prometheus ~]# systemctl enable prometheus.service

[root@prometheus ~]# systemctl start prometheus.service

[root@prometheus ~]# ps -ef | grep prometheus

root 19302 1 0 11:38 ? 00:00:04 /usr/local/bin/prometheus –config.file=/etc/prometheus/prometheus.yml –web.listen-address=:9090

root 20532 16875 0 11:55 pts/1 00:00:00 grep –color=auto prometheus

1.3 打开浏览器访问 prometheus webUI界面

http://192.168.31.250:9090

 

Prometheus 部署及使用node_exporter 采集客户端数据

二、监控节点部署Node exporter

2.1 二进制部署promethues

官网下载 软件包 node_exporter ,https://prometheus.io/download/

Prometheus 部署及使用node_exporter 采集客户端数据

选择对应的版本进行下载