安裝node exporternode
建立Systemd服務mysql
#vim /etc/systemd/system/node_exporter.service
[Unit]
Description=mysql_exporter
After=network.target
[Service]
Type=simple
User=prometheus
ExecStart=/usr/local/prom/exporter/node_exporter_0170/node_exporter
Restart=on-failure
[Install]
WantedBy=multi-user.target
啓動node_exporterlinux
# systemctl start node_exporter
# systemctl status node_exporter
驗證git
curl http://localhost:9100/metrics
添加prometheus相關配置github
# vi prometheus280/prometheus.yml
##linux##
- job_name: 'node'
static_configs:
- targets: ['localhost:9100']
labels:
instance: lab1
重啓prometheus便可sql
grafana dashboardvim
https://grafana.com/dashboards/8919curl
須要重啓grafanaservice grafana-server restartgrafana-cli plugins install grafana-piechart-panel # 請確保安裝後能正常添加餅圖。
https://github.com/starsliao/Prometheusurl