Prometheus:docker run -d --name=prometheus -p 9090:9090 prom/prometheus
访问地址:http://IP:9090
/prometheus $ cat /etc/prometheus/prometheus.yml #prometheus配置文件位置 尝试监控一台Linux服务器,需要被监控机器上安装node_exporter 使用node_exporter-1.0.1.linux-amd64.tar.gz 下载地址https://github.com/prometheus/node_exporter [root@k8s-node2 ~]# tar zxvf node_exporter-1.0.1.linux-amd64.tar.gz [root@k8s-node2 ~]# cd node_exporter-1.0.1.linux-amd64 [root@k8s-node2 node_exporter-1.0.1.linux-amd64]# ./node_exporter #启动测试 端口9100 确定端口正常后在服务端配置文件添加被监控地址,一个分组多个节点
[root@k8s-master ~]# docker restart prometheus #docker 重启 Prometheus
#安装了node_exporter的linux服务器已经监控到了
#使用Grafana展示node_exporter数据指标
http://192.168.31.71:3000/
用户名/密码:admin/admin # 第一次需要重置密码
Dashboards | Grafana LabsBrowse a library of official and community-built dashboards.https://grafana.com/grafana/dashboards/?pg=hp&plcmt=lt-box-dashboards
仪表盘展示选择地址,输入仪表盘ID等待加载,可以输入node_exporter关键字来搜索监控linux的仪表盘id
这里我选择ID:9276
网卡流量这里显示没有数据,选择edit编辑变量为实际网卡名字,我的这次是ens33。



