Prometheus 和 Grafana 安装部署
Prometheus 是一套开源的系统监控报警框架。Prometheus 作为生态圈 Cloud Native Computing Foundation(简称:CNCF)中的重要一员,其活跃度仅次于 Kubernetes, 现已广泛用于 Kubernetes 集群的监控系统中。
每个人都应该使用Prometheus,它提供了自定义的时序监控功能,允许你instrument代码并在Grafana中以图形化的方式进行监视。你还可以搭建告警功能,当生产环境崩溃或延迟让顾客感到不满时,你能得到提醒。它同时还需要Grafana和kube-state-metrics chart。
Prometheus
网址
官方网址:https://prometheus.io/
GitHub网址:https://github.com/prometheus/prometheus
软件下载地址:https://prometheus.io/download/
第三方中文介绍:https://github.com/1046102779/prometheus
架构图
特点:
多维数据模型(有metric名称和键值对确定的时间序列)
灵活的查询语言
不依赖分布式存储
通过pull方式采集时间序列,通过http协议传输
支持通过中介网关的push时间序列的方式
监控数据通过服务或者静态配置来发现
支持图表和dashboard等多种方式
组件
Prometheus 主程序,主要是负责存储、抓取、聚合、查询方面。
Alertmanager 程序,主要是负责实现报警功能。
Pushgateway 程序,主要是实现接收由Client push过来的指标数据,在指定的时间间隔,由主程序来抓取。
*_exporter 这类是不同系统已经实现了的集成。
prometheus部署
wget https://github.com/prometheus/prometheus/releases/download/v1.6.2/prometheus-1.6.2.linux-amd64.tar.gz
tar -xvf prometheus-1.6.2.linux-amd64.tar.gz
cd prometheus-1.6.2.linux-amd64
配置prometheus.yml
scrape_interval: 15s # 默认15秒到目标处抓取数据
启动
nohup ./prometheus -config.file=prometheus.yml &
或
nohup /opt/prometheus-1.6.2.linux-amd64/prometheus &
5、WEB页面访问 http://10.211.55.4:9090/graph ,可以看到Prometheus的graph页面。
grafana 部署
1、安装
wget wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-4.4.3-1.x86_64.rpm
yum install grafana-4.4.3-1.x86_64.rpm
2、启动服务
systemctl start grafana-server
systemctl enable grafana-server
3、访问页面
curl http://localhost:3000
,默认账号、密码admin/admin
4、Prometheus 和 Grafana 的对接
https://prometheus.io/docs/visualization/grafana/
填入数据源
安装好后
登陆后
MySQL的dashboards(Grafana)
git clone https://github.com/percona/grafana-dashboards.git
cp -r grafana-dashboards/dashboards /var/lib/grafana/dashboards
编辑Grafana配置文件
vi /etc/grafana/grafana.ini
[dashboards.json]
enabled = true
path = /var/lib/grafana/dashboards
重启
service grafana-server restart
mysql监控部署
wget https://github.com/prometheus/node_exporter/releases/download/v0.14.0/node_exporter-0.14.0.linux-amd64.tar.gz
tar -xvf node_exporter-0.14.0.linux-amd64.tar.gz
cd node_exporter-0.14.0.linux-amd64
nohup ./node_exporter &
vi .my.cnf
[client]
user=root
password=root
./mysqld_exporter -config.my-cnf=".my.cnf" &
服务端配置,文件prometheus.yml
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
- job_name: 'mysql'
static_configs:- targets: ['10.10.83.162:9104']
labels:
instance: db-10.10.83.162
- targets: ['10.10.83.162:9104']
redis监控部署
wget https://github.com/oliver006/redis_exporter/releases/download/v0.11.1/redis_exporter-v0.11.1.linux-amd64.tar.gz
tar -xvf redis_exporter-v0.11.linux-amd64.tar.gz
nohup /opt/redis_exporter -redis.addr "redis://10.10.83.162:16379" &
tar -xvf redis_exporter-0.11.tar.gz
cd redis_exporter-0.11
cp *json /var/lib/grafana/dashboards/
服务端配置,文件prometheus.yml
scrape_configs:
# The job name is added as a label job=<job_name>
to any timeseries scraped from this config.
- job_name: 'prometheus'
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs:
- targets: ['localhost:9090']
job_name: 'mysql'
static_configs:- targets: ['10.10.83.162:9104']
labels:
instance: db-10.10.83.162
- targets: ['10.10.83.162:9104']
job_name: redis_exporter
static_configs:- targets: ['10.10.83.162:9121']
labels:
instance: redis-10.10.83.162
- targets: ['10.10.83.162:9121']
总结
- Prometheus 9090
- Grafana 3000
- 3方的基本介绍,1注入2作为数据源,做展示
参考
prometheus + grafana安装部署(centos6.8)
Prometheus 和 Grafana 安装部署的更多相关文章
- prometheus + grafana安装部署(centos6.8)
官方网址:https://prometheus.io/ GitHub网址:https://github.com/prometheus/prometheus 软件下载地址:https://prometh ...
- 部署 Prometheus 和 Grafana 到 k8s
在 k8s 中部署 Prometheus 和 Grafana Intro 上次我们主要分享了 asp.net core 集成 prometheus,以及简单的 prometheus 使用,在实际在 k ...
- Grafana安装配置介绍
一.Grafana介绍 Grafana是一个可视化面板(Dashboard),有着非常漂亮的图表和布局展示,功能齐全的度量仪表盘和图形编辑器,支持Graphite.zabbix.InfluxDB.Pr ...
- kubernetes(k8s) Prometheus+grafana监控告警安装部署
主机数据收集 主机数据的采集是集群监控的基础:外部模块收集各个主机采集到的数据分析就能对整个集群完成监控和告警等功能.一般主机数据采集和对外提供数据使用cAdvisor 和node-exporter等 ...
- prometheus + grafana + node_exporter + alertmanager 的安装部署与邮件报警 (一)
大家一定要先看详细的理论教程,再开始搭建,这样报错后才容易找到突破口 参考文档 https://www.cnblogs.com/afterdawn/p/9020129.html https://www ...
- CentOS7安装部署Prometheus+Grafana (转)
转自:https://www.jianshu.com/p/967cb76cd5ca 作为监控系统的后起之秀,prometheus的安装可谓非常简单,不需要第三方的依赖(数据库.缓存.PHP之类的).下 ...
- 微服务监控神器Prometheus的安装部署
本文涉及:如何在k8s下搭建Prometheus+grafana的监控环境 基本概念 Prometheus提供了容器和云原生领域数据搜集.存储.处理.可视化和告警一套完整的解决方案,最初时是由Soun ...
- 01 . Prometheus简介及安装配置Grafana
Promethus简介 Prometheus受启发于Google的Brogmon监控系统(相似的Kubernetes是从Google的Brog系统演变而来),从2012年开始由前Google工程师在S ...
- 使用Docker部署监控系统,Prometheus,Grafana,监控服务器信息及Mysql
使用Docker部署监控系统,Prometheus,Grafana,监控服务器信息及Mysql 一.docker部署prometheus监控系统 1.1 配置安装环境 1.1.1 安装promethe ...
随机推荐
- Spring Boot集成MyBatis的2种方式
目录 写在前面 准备工作 配置数据库驱动 配置数据源 原生集成MyBatis 依赖配置 注册MyBatis核心组件 定义并使用映射器 通过MyBatis-Spring-Boot-Starter集成 默 ...
- Codeforces Round #449 (Div. 2) D. Ithea Plays With Chtholly
题目链接 交互题. 题意:给你三个数n,m,k.让你完成至多m次互动,每次给你一个q,让你从n个位置选一个位置放这个数,覆盖已经放过的数.让你再m次使得n个位置的数不递减,达到直接退出. 解法:暴力, ...
- word20161228
1.principles英[p'rɪnsəplz]美[p'rɪnsəplz]n.原则; 原理; 准则; 道义; 节操; 原则( principle的名词复数 ); 工作原理; [P-] (基督教科学派 ...
- Angular7_获取异步方法里面的数据
1.回调函数 getName() { return '张三'; } getAsyncName() { setTimeout(() => { return 'async_张三'; }, ); } ...
- IDEA 在同一目录创建多个项目
以往的Eclipse.NetBeans等开发工具不同,IDEA的Project相当与Eclipse的Workspace,而Module相当于Project. 下边就给出Eclipse与IDEA的概念的 ...
- 【转】解决keepalived正常启动但是虚IP(VIP)没有生成的问题
如题所示,keepalived安装配置好之后能够正常启动,但是虚IP并没有生成.接着检查防火墙(iptables)发现也没有相关的限制.稍微郁闷了一下之后,查看了keepalived日志文件,这次成功 ...
- having的用法
转载:http://blog.csdn.net/oathevil/article/details/5521757 where和having: “Where” 是一个约束声明,使用Where来约束来自于 ...
- 【sklearn】数据预处理 sklearn.preprocessing
数据预处理 标准化 (Standardization) 规范化(Normalization) 二值化 分类特征编码 推定缺失数据 生成多项式特征 定制转换器 1. 标准化Standardization ...
- Excel-VBA入门(1): 基础 / 变量 /for / if/ 调试
(一) 启动VBA 打开excel ,选项-自定义功能区-开发工具, 在界面的开发工具下选择 宏安全: 勾选 启用所有 excel保存xlsm后缀的格式才可以用宏! 若启动VBA编辑器(以下简称VB ...
- linux关于软件安装的博文
https://www.cnblogs.com/kundeg/archive/2018/03/06/7247934.html https://www.cnblogs.com/qiaozhoulin/p ...