一、安装prometheus、Node_exporter、grafana
1、centos 监控主机上安装 Prometheus
1)下载
# wget https://github.com/prometheus/prometheus/releases/download/v2.5.0/prometheus-2.5.0.linux-amd64.tar.gz
# tar xf prometheus-2.5.0.linux-amd64.tar.gz
# cp prometheus-2.5.0.linux-amd64/{prometheus,promtool} /usr/local/bin/
# prometheus --version
# cd prometheus-2.5.0.linux-amd64
# cp prometheus.yml prometheus.yml.orig
# mkdir -p /etc/prometheus
# cp prometheus.yml /etc/prometheus/
2)使用promtool工具检验配置文件是否正确
# promtool check config /etc/prometheus/prometheus.yml
3)启动prometheus
# prometheus --config.file /etc/prometheus/prometheus.yml指定配置文件启动
2、在被监控服务器上安装 Node exporter
1)安装
# wget https://github.com/prometheus/node_exporter/releases/download/v0.16.0/node_exporter-0.16.0.linux-amd64.tar.gz
# tar xf node_exporter-*
# cp node_exporter-*/node_exporter /usr/local/bin/
# node_exporter --version
# node_exporter –help
2)使用需要在prometheus的配置文件中配置jop ,服务器才能发现服务,纤细配置在下面的文档
3)注意事项
如果数据没有更新,请注意,是否关闭了Node exporter
3、grafana 安装
1)安装
# wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.3.2-1.x86_64.rpm
# yum -y localinstall grafana-5.3.2-1.x86_64.rpm
2)使用service启动
service grafana-server start
```
访问:
默认运⾏在 3000端口
直接 ip:3000 即可