prometheus + grafana安装部署(centos6.8)
GitHub网址:https://github.com/prometheus/prometheus
软件下载地址:https://prometheus.io/download/
第三方中文介绍:https://github.com/1046102779/prometheus
prometheus介绍
Prometheus是一个开源的系统监控和报警的工具包,最初由SoundCloud发布。
特点:
- 多维数据模型(有metric名称和键值对确定的时间序列)
- 灵活的查询语言
- 不依赖分布式存储
- 通过pull方式采集时间序列,通过http协议传输
- 支持通过中介网关的push时间序列的方式
- 监控数据通过服务或者静态配置来发现
- 支持图表和dashboard等多种方式
组件:
- Prometheus 主程序,主要是负责存储、抓取、聚合、查询方面。
- Alertmanager 程序,主要是负责实现报警功能。
- Pushgateway 程序,主要是实现接收由Client push过来的指标数据,在指定的时间间隔,由主程序来抓取。
- *_exporter 这类是不同系统已经实现了的集成。
架构:

prometheus部署
1、下载安装包prometheus-1.6.2.linux-amd64.tar.gz
https://github.com/prometheus/prometheus/releases/tag/v1.6.2
2、解压
tar -xvf prometheus-1.6.2.linux-amd64.tar.gz
cd prometheus-1.6.2.linux-amd64
3、配置prometheus.yml
- scrape_interval: 15s # 默认15秒到目标处抓取数据
4、启动
nohup ./prometheus -config.file=prometheus.yml &
或
nohup /opt/prometheus-1.6.2.linux-amd64/prometheus &
5、WEB页面访问http://localhost:9090/ ,可以看到Prometheus的graph页面。
备注:参考文章 http://www.cnblogs.com/vovlie/p/Prometheus_install.html
grafana部署
http://docs.grafana.org/installation/rpm/
1、安装
wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-4.2.0-1.x86_64.rpm
sudo yum install initscripts fontconfig -y
sudo rpm -Uvh grafana-4.2.0-1.x86_64.rpm
2、启动服务service grafana-server start
3、访问页面http://localhost:3000 ,默认账号、密码admin/admin

4、Prometheus 和 Grafana 的对接
https://prometheus.io/docs/visualization/grafana/

参考文章:http://www.cnblogs.com/sfnz/p/6566951.html
MySQL的dashboards(Grafana)
https://github.com/percona/grafana-dashboards
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监控部署
在需要监控的mysql上安装 node_exporter和 mysqld_exporter
下载 https://prometheus.io/download/
tar -xvf node_exporter-0.14.0.linux-amd64.tar.gz
cd node_exporter-0.14.0.linux-amd64
nohup ./node_exporter &
tar -xvf mysqld_exporter-0.10.0.linux-amd64.tar.gz
cd mysqld_exporter-0.10.0.linux-amd64 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

redis监控部署
下载 https://github.com/oliver006/redis_exporter/releases
tar -xvf redis_exporter-v0.11.linux-amd64.tar.gz
nohup /opt/redis_exporter -redis.addr "redis://10.10.83.162:16379" &
grafana配置
下载 redis_exporter-0.11.tar.gz
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 - job_name: redis_exporter
static_configs:
- targets: ['10.10.83.162:9121']
labels:
instance: redis-10.10.83.162
prometheus + grafana安装部署(centos6.8)的更多相关文章
- Prometheus 和 Grafana 安装部署
Prometheus 是一套开源的系统监控报警框架.Prometheus 作为生态圈 Cloud Native Computing Foundation(简称:CNCF)中的重要一员,其活跃度仅次于 ...
- Prometheus(一):Prometheus+Grafana 安装配置
一.基础环境 系统 IP 监控主机 CentOS 7 192.168.56.200 被监控主机 CentOS 7 192.168.56.201 二.Prometheus服务端安装 以下操作皆在监控主机 ...
- Prometheus+Grafana监控部署实践
参考文档: Prometheus github:https://github.com/prometheus grafana github:https://github.com/grafana/graf ...
- 微服务监控神器Prometheus的安装部署
本文涉及:如何在k8s下搭建Prometheus+grafana的监控环境 基本概念 Prometheus提供了容器和云原生领域数据搜集.存储.处理.可视化和告警一套完整的解决方案,最初时是由Soun ...
- Prometheus+Grafana安装搭建
介绍 Prometheus是由SoundCloud开发的开源监控报警系统和时序列数据库(TSDB).Prometheus使用Go语言开发,是Google BorgMon监控系统的开源版本. 2016年 ...
- k8s集群监控 cadvisor/exporter+prometheus+grafana
### k8s监控处理 ### 1.cadvisor/exporter+prometheus+grafana 安装#### 1.1 配置nfs安装```shellubuntu: nfs 服务器 apt ...
- Prometheus + Grafana 部署说明之「安装」
说明 在前面的Prometheus学习系列文章里,大致介绍说明了Prometheus和Grafana的一些使用,现在开始介绍如何从头开始部署Prometheus+Grafana,来监控各个相关的指标数 ...
- 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之类的).下 ...
随机推荐
- mui 从列表进入到详情,再返回,列表页还是进入列表之前的样子,而不刷新页面
mui 从列表进入到详情,再返回,列表页还是进入列表之前的样子,而不刷新页面
- fastjson转换json字符串key的首字母小写变大写的解决办法
https://blog.csdn.net/erbao_2014/article/details/53688934 问题描述在开发过程中,由于接口文档的描述,要求json字符串的key首字母为大写,而 ...
- 禅道docker
64位电脑安装禅道,满足发送邮件功能 第一步: docker ps 查看docker中的容器是否有禅道(docker ps -a 这个指令看的是所有容器,包括未运行的)ps:登录服务器这个步骤没 ...
- C#版Websocket实例
C#版Websocket实例 Demo地址:www.awbeci.xyz websocket有java.nodejs.python,Php等等版本,我使用的是C#版本,服务器端是Fleck,git ...
- Python之关于工具包简介
1.Pandas Python Data Analysis Library 或 pandas 是基于NumPy 的一种工具,该工具是为了解决数据分析任务而创建的.Pandas 纳入了大量库和一些标准的 ...
- Vmware 虚拟机无法启动
问题背景: 自己的电脑坏了,用的事小伙伴的电脑,安装VMware 软件,然后创建虚拟机(放在移动硬盘上).在操作虚拟主机的时候,中间不小心碰到了移动硬盘, 然后移动硬盘就掉线了.这个时候再去启动虚拟主 ...
- BizTalk Schedule Adapter的使用
由于BizTalk作为一个消息中间件是无状态的,一般不能主动去触发消息.因此在有一些特定的场景,比如每隔X分钟/小时/天去轮询或获取数据时就会特别不方便.不过可以通过Codeplex上的开源项目:Bi ...
- 物联网架构成长之路(28)-Docker练习之MQ中间件(Kafka)
0. 前言 消息队列MQ,这个在一般的系统上都是会用到的一个中间件,我选择Kafka作为练手的一个中间件,Kafka依赖Zookeeper.Zookeeper安装上一篇博客已经介绍过了. 1. Kaf ...
- Jupyter/JupyterLab安装使用
一.介绍 Jupyther notebook(曾经的Ipython notebook),是一个可以把代码.图像.注释.公式和作图集于一处,实现可读性及可视化分析的工具,支持多种编程语言.官方使用手册. ...
- java集合 线程安全
1.快速失败(fail-fast)和安全失败(fail-safe)? 一:快速失败(fail—fast) 在用迭代器遍历一个集合对象时,如果遍历过程中对集合对象的内容进行了修改(增加.删除.修改),则 ...