Rocky Linux安装部署Node_exporter(Prometheus)

一、node_exporter的简介
Node Exporter是一个用于监控主机指标的软件插件。它收集和暴露系统级指标,如CPU、内存、磁盘、网络等信息,供Prometheus监控和报警。Node Exporter可以帮助用户了解主机的性能和健康状态。

二、prometheus监控体系
在这里插入图片描述

三、Rocky Linux系统安装
链接:VMware Workstation 下载安装(含秘钥)
链接:VMware Workstation 创建虚拟机
链接:Rocky_Linux 下载安装
链接:Rocky_Linux 网卡静态配置
链接:MobaXterm 下载安装

四、Rocky Linux安装部署Node_exporter
1、官网下载地址
链接:https://prometheus.io/download/
在这里插入图片描述

2、筛选“linux",“amd64”
在这里插入图片描述

3、向下拖动至“node_exporter”,点击下载“最新安装包”
在这里插入图片描述

3、上传至root目录下
教程链接:SFTP文件上传/下载

4、查看目录/root/下的文件,确认是否已上传

[root@localhost ~]# ll /root/

教程链接:Rocky Linux 运维工具 ls
在这里插入图片描述

5、解压/root/目录下的node_exporter至/opt/目录

[root@localhost ~]# tar zxvf /root/node_exporter-1.7.0.linux-amd64.tar.gz -C /opt/

教程链接:Rocky Linux 文件管理工具 tar
在这里插入图片描述

6、查看/opt/目录下的文件

[root@localhost ~]# ll /opt/

教程链接:Rocky Linux 运维工具 ls
在这里插入图片描述
7、重命名node_exporter

[root@localhost ~]# mv /opt/node_exporter-1.7.0.linux-amd64/ /opt/node_exporter

教程链接:Rocky Linux 运维工具 mv
在这里插入图片描述

8、查看/opt/下的文件

[root@localhost ~]# ll /opt/

教程链接:Rocky Linux 运维工具 ls
在这里插入图片描述
9、创建node_exporter服务

[root@localhost ~]# vi /etc/systemd/system/node_exporter.service
[Unit]
Description=node_exporter1
After=network.target

[Service]
Type=simple
ExecStart=/opt/node_exporter/node_exporter
--collector.ntp
--collector.mountstats
--collector.systemd
--collector.tcpstat
User=prometheus

ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure

[Install]
WantedBy=multi-user.target
[root@localhost ~]# cat /etc/systemd/system/node_exporter.service

教程链接:Rocky Linux 运维工具 vim
教程链接:Rocky Linux 运维工具 cat
在这里插入图片描述

10、目录授权

[root@localhost ~]# chown prometheus:root -R /opt/prometheus

教程链接:Rocky Linux 运维工具 chown
在这里插入图片描述

11、查看目录权限

[root@localhost ~]# ll /opt/

教程链接:Rocky Linux 运维工具 ls
在这里插入图片描述

12、加载服务

[root@localhost ~]# systemctl daemon-reload

教程链接:Rocky Linux 运维工具 systemctl
在这里插入图片描述

13、设置node_exporter服务开机启动

[root@localhost ~]# systemctl enable node_exporter.service

教程链接:Rocky Linux 运维工具 systemctl
在这里插入图片描述
14、启动node_exporter服务

[root@localhost ~]# systemctl start node_exporter.service

教程链接:Rocky Linux 运维工具 systemctl
在这里插入图片描述

15、查看node_exporter服务状态

[root@localhost ~]# systemctl status node_exporter.service

教程链接:Rocky Linux 运维工具 systemctl
在这里插入图片描述

16、防火墙放行端口9100

[root@localhost ~]# firewall-cmd --zone=public --add-port=9100/tcp --permanent

教程链接:Rocky Linux 运维工具 firewall-cmd
在这里插入图片描述

17、防火墙重新加载策略

[root@localhost ~]# firewall-cmd --reload

教程链接:Rocky Linux 运维工具 firewall-cmd
在这里插入图片描述

18、访问192.168.100.10:9100/metrics 显示有数据
在这里插入图片描述

19、配置文件添加监控点位

[root@localhost ~]# vi /opt/prometheus/prometheus.yml
  - job_name: 'nodes'
    static_configs:
    - targets: ['192.168.100.10:9100']

教程链接:Rocky Linux 运维工具 vim
在这里插入图片描述

20.重启prometheus,查看服务运行状态

[root@localhost ~]# systemctl restart prometheus.service
[root@localhost ~]# systemctl status prometheus.service

教程链接:Rocky Linux 运维工具 systemctl
在这里插入图片描述

21、重启node_exporter,查看服务运行状态

[root@localhost ~]# systemctl restart node_exporter.service
[root@localhost ~]# systemctl status node_exporter.service

教程链接:Rocky Linux 运维工具 systemctl
在这里插入图片描述

22、打开 http://192.168.110.10:9090,点击“Status”,点击“Target”
在这里插入图片描述
23、查看node_exporter运行状态
在这里插入图片描述
四、扩展
链接:Rocky Linux安装部署Prometheus

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值