如何使用prometheus和grafana监控Kubernetes-创新互联

机器 : 172.27.143.155

创新互联服务项目包括泗水网站建设、泗水网站制作、泗水网页制作以及泗水网络营销策划等。多年来,我们专注于互联网行业,利用自身积累的技术优势、行业经验、深度合作伙伴关系等,向广大中小型企业、政府机构等提供互联网行业的解决方案,泗水网站推广取得了明显的社会效益与经济效益。目前,我们服务的客户以成都为中心已经辐射到泗水省份的部分城市,未来相信会继续扩大服务区域并继续获得客户的支持与信任!

prometheus 介绍:

Prometheus是一个开源的系统监控和报警工具包,普罗米修斯在2016年加入了云原生计算基金会,成为继Kubernetes之后的第二个项目。

主要特征是:

多维数据模型,时间序列数据由度量名称和键/值对标识

PromQL是一种灵活的查询语言,可以利用这种维度

不依赖分布式存储;单个服务器节点是自治的

时间序列收集通过HTTP上的拉模型进行

通过中间网关支持时间序列的推送

通过服务发现或静态配置发现目标

多种模式的绘图和仪表板的支持

一、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
如何使用prometheus和grafana监控Kubernetes
7、修改配置文件
prometheus.yml
如何使用prometheus和grafana监控Kubernetes

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
如何使用prometheus和grafana监控Kubernetes

然后启动就可以了
然后验证
systemctl start prometheus
http://172.27.143.155:9090/targets
如何使用prometheus和grafana监控Kubernetes

二、安装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
如何使用prometheus和grafana监控Kubernetes

8、导入模板ID号时193
如何使用prometheus和grafana监控Kubernetes
9、完成之后可以查看效果
如何使用prometheus和grafana监控Kubernetes

另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。

文章标题:如何使用prometheus和grafana监控Kubernetes-创新互联
文章来源:https://www.cdcxhl.com/article36/ceehsg.html

成都网站建设公司_创新互联,为您提供Google关键词优化网站制作网站维护网站收录外贸建站

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

搜索引擎优化