• 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

  • 相关阅读:
    队列

    Oracle 12c新特性之——TABLE ACCESS BY INDEX ROWID BATCHED
    连续三月涨势明显,PostgreSQL 将崛起?
    Oracle物理DG自动切换——Dataguard Broker配置
    MSSQL索引视图(indexed view)之简述及使用
    连续三月涨势明显,PostgreSQL 将崛起?
    Scheduler & Task & Worker & Thread & Request & Session & Connection of SQL Server
    MSSQL内存架构及管理
    MSSQL数据库后台进程(线程)
  • 原文地址:https://www.cnblogs.com/jugglee/p/8392015.html
Copyright © 2020-2023  润新知