机器 : 172.27.143.155 [grafana+Prometheus]
一, Prometheus 安装:
- ,wget
- ,tar -zxvf prometheus-2.8.1.Linux-amd64.tar.gz -C /usr/local/
- ,cd /usr/local
- ,mv prometheus-2.8.1.Linux-amd64/ prometheus
- ,cd prometheus/
6, 查看版本
./prometheus --version
7, 修改配置文件
prometheus.YAML
8, 完成之后做成 service 服务
- VIM /lib/systemd/system/prometheus.service
- [Unit]
- Description=Prometheus
- Documentation= https://prometheus.io/
- After=network.target
- [Service]
- Type=simple
- User=root
- ExecStart=/usr/local/prometheus/prometheus --config.file=/usr/local/prometheus/prometheus.YAML --storage.tsdb.path=/home/software/prometheus-data
- Restart=on-failure
- [Install]
- WantedBy=multi-user.target
然后启动就可以了
然后验证
- systemctl start prometheus
- http://172.27.143.155:9090/targets
二, 安装 grafana
- 1, https://grafana.com/grafana/download
- 2,wget
- 3,tar -zxvf grafana-6.5.2.Linux-amd64.tar.gz
- 4,mv grafana-6.5.2 /usr/local/grafana
- 5,cd /usr/local/grafana/bin
- 6,nohup ./grafana-server &
- http://172.27.143.155:3000/
账号和密码默认都是 admin
7, 配置数据源, 这里时 Prometheus
8, 导入模板 ID 号时 193
9, 完成之后可以查看效果
来源: http://www.bubuko.com/infodetail-3355274.html