Prometheus + Grafana 监控 Redis

Prometheus安装

wget https://github.com/prometheus/prometheus/releases/download/v2.1.0/prometheus-2.1.0.linux-amd64.tar.gz
tar -zxvf prometheus-2.1.0.linux-amd64.tar.gz -C /prometheus --strip-components=1
cd /prometheus
# Start Prometheus.
# By default, Prometheus stores its database in ./data (flag --storage.tsdb.path).
./prometheus --config.file=prometheus.yml

在浏览器输入localhost:9090

Grafana安装

wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-4.6.3-1.x86_64.rpm 
sudo yum localinstall grafana-4.6.3-1.x86_64.rpm 

启动服务

$ sudo service grafana-server start

开机启动

$ sudo /sbin/chkconfig --add grafana-server

安装完成。浏览器打开 http://192.168.0.15:3000 ,输入默认用户名密码 (admin/admin) 可以进入 Grafana 。

Prometheus 和 Grafana 对接

 

 

Prometheus: URL: localhost:9090/

即可完成 Prometheus 和 Grafana 的对接。

在redis服务器安装node_exporter和redis_exporter

redis_exporter安装

wget https://github.com/oliver006/redis_exporter/releases/download/v0.15.0/redis_exporter-v0.15.0.linux-amd64.tar.gz
tar -zxvf redis_exporter-v0.15.0.linux-amd64.tar.gz -C /prometheus_exporters --strip-components=1
wget https://github.com/prometheus/node_exporter/releases/download/v0.15.2/node_exporter-0.15.2.linux-amd64.tar.gz
tar -zxvf redis_exporter-v0.15.2.linux-amd64.tar.gz -C /prometheus_exporters --strip-components=1

启动

cd  /prometheus_exporters
./node_exporter & 
./redis_exporter redis//localhost:6379 & -web.listenaddress 0.0.0.0:9122

 配置prometheus.yml 加入

- job_name: redis_exporter
  static_configs:
  - targets: ['192.168.0.17:9122']

注意prometheus.yml中缩进不能有tab。

导入json模板

下载grafana的redis的prometheus-redis_rev1.json模板

wget  https://grafana.com/api/dashboards/763/revisions/1/download

在grafana中导入json模板

启动redis

在redis安装路径执行

src/redis-server

 

转载于:https://www.cnblogs.com/jugglee/p/8392015.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
一、prometheus简介 Prometheus是一个开源的系统监控和告警系统,现在已经加入到CNCF基金会,成为继k8s之后第二个在CNCF维护管理的项目,在kubernetes容器管理系统中,通常会搭配prometheus进行监控prometheus支持多种exporter采集数据,还支持通过pushgateway进行数据上报,Prometheus再性能上可支撑上万台规模的集群。 二、prometheus架构图 三、prometheus组件介绍 1.Prometheus Server: 用于收集和存储时间序列数据。 2.Client Library: 客户端库,检测应用程序代码,当Prometheus抓取实例的HTTP端点时,客户端库会将所有跟踪的metrics指标的当前状态发送到prometheus server端。 3.Exporters: prometheus支持多种exporter,通过exporter可以采集metrics数据,然后发送到prometheus server端 4.Alertmanager: 从 Prometheus server 端接收到 alerts 后,会进行去重,分组,并路由到相应的接收方,发出报警,常见的接收方式有:电子邮件,微信,钉钉, slack等。 5.Grafana监控仪表盘 6.pushgateway: 各个目标主机可上报数据到pushgatewy,然后prometheus server统一从pushgateway拉取数据。 四、课程亮点 五、效果图展示 六、讲师简介 先超(lucky):高级运维工程师、资深DevOps工程师,在互联网上市公司拥有多年一线运维经验,主导过亿级pv项目的架构设计和运维工作 主要研究方向: 1.云计算方向:容器 (kubernetes、docker),虚拟化(kvm、Vmware vSphere),微服务(istio),PaaS(openshift),IaaS(openstack)等2.系统/运维方向:linux系统下的常用组件(nginx,tomcat,elasticsearch,zookeeper,kafka等),DevOps(Jenkins+gitlab+sonarqube+nexus+k8s),CI/CD,监控(zabbix、prometheus、falcon)等 七、课程大纲

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值