系统性能监控
1 监控系统
下载网站:
https://prometheus.io/download/
1.1 node explorer 安装
wget https://github.com/prometheus/node_exporter/releases/download/v1.2.2/node_exporter-1.2.2.linux-amd64.tar.gz
tar -xzf node_exporter-1.2.2.linux-amd64.tar.gz
cd node_exporter-1.2.2.linux-amd64/
./node_exporter
firewall-cmd --permanent --zone=public --add-port=9100/tcp
firewall-cmd --reload
访问:http://192.168.124.148:9100/
1.2 Prometheus 直接运行exe
Prometheus.exe --web.listen-address="0.0.0.0:9091"
如果node_exporter服务器ip变了,要改prometheus.yml中
# 采集node exporter监控数据
- job_name: 'node'
static_configs:
- targets: ['192.168.124.148:9100']
1.3 grafana
安装后访问:
http://localhost:3000
admin/admin1 默认
1.3.1 配置数据源
点击Configuration -> Data Sources -> Add data source 选择Prometheus
然后配置URL:http://prometheus:9091
修改抓取时间,查询超时时间等参数,设置完成后点击Save & Test
1.3.2 配置Dashboard
接下来配置Dashboard,在https://grafana.com/grafana/dashboards 中搜索选择别人开发好的面板,推荐https://grafana.com/grafana/dashboards/8919
点击Dashboards -> Manage -> Import,输入选择的dashboard地址,点击load,选择prometheus数据源,配置完成后点击Import。
参考
https://cloud.tencent.com/developer/article/1808172
https://www.cnblogs.com/hiyong/p/14587293.html

浙公网安备 33010602011771号