zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    Codechef EDGEST 树套树 树状数组 线段树 LCA 卡常
    BZOJ4319 cerc2008 Suffix reconstruction 字符串 SA
    Codechef STMINCUT S-T Mincut (CodeChef May Challenge 2018) kruskal
    Codeforces 316G3 Good Substrings 字符串 SAM
    Codechef CHSIGN Change the Signs(May Challenge 2018) 动态规划
    BZOJ1396 识别子串 字符串 SAM 线段树
    CodeForces 516C Drazil and Park 线段树
    CodeForces 516B Drazil and Tiles 其他
    CodeForces 516A Drazil and Factorial 动态规划
    SPOJ LCS2
  • 原文地址:https://www.cnblogs.com/jugglee/p/8392015.html
Copyright © 2011-2022 走看看