首页 > 其他 > 详细

prometheus+grafana监控K8S容器

时间:2019-12-29 01:15:57      阅读:438      评论:0      收藏:0      [点我收藏+]
机器 : 172.27.143.155 【grafana+Prometheus】

一、Prometheus安装:
1、wget https://github.com/prometheus/prometheus/releases/download/v2.8.1/prometheus-2.8.1.linux-amd64.tar.gz

2、tar -zxvf prometheus-2.8.1.linux-amd64.tar.gz -C /usr/local/

3、cd /usr/local
4、mv prometheus-2.8.1.linux-amd64/ prometheus
5、cd prometheus/
6、查看版本
./prometheus --version
技术分享图片
7、修改配置文件
prometheus.yml
技术分享图片

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.yml --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 https://dl.grafana.com/oss/release/grafana-6.5.2.linux-amd64.tar.gz
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、完成之后可以查看效果
技术分享图片

prometheus+grafana监控K8S容器

原文:https://blog.51cto.com/xiaorenwutest/2462621

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!