美文网首页运维部署
13 Redis_exporter 一篇就够

13 Redis_exporter 一篇就够

作者: starQuest | 来源:发表于2022-06-30 09:39 被阅读0次

    wget https://github.com/oliver006/redis_exporter/releases/download/v0.21.2/redis_exporter-v0.21.2.linux-amd64.tar.gz

    13.1解压安装

    tar -zxvf redis_exporter-v0.21.2.linux-amd64.tar.gz

    groupadd prometheus2

    useradd -g prometheus2 -m -d /home/monitor/node_exporter/ -s /sbin/nologin prometheus2

    mv node_exporter-0.18.1.linux-amd64 node_exporter

    rm -rf node_exporter-0.18.1.linux-amd64

    13.2 自启动

    ./redis_exporter -h #查看信息

    touch /usr/lib/systemd/system/redis_exporter.service

    chown prometheus2:prometheus2 /usr/lib/systemd/system/redis_exporter.service

    chown -R prometheus2:prometheus2 /home/monitor/redis_exporter

    vim /usr/lib/systemd/system/redis_exporter.service

    [Unit]

    Description=redis_exporter

    Documentation=https://github.com/oliver006/redis_exporter

    After=network.target

    [Service]

    Type=simple

    User=prometheus2

    ExecStart=/home/monitor/redis_exporter/redis_exporter -redis.addr localhost:6379 -redis.password root

    Restart=on-failure

    [Install]

    WantedBy=multi-user.target

    启动

    systemctl daemon-reload

    systemctl enable redis_exporter.service

    systemctl start redis_exporter.service

    systemctl status redis_exporter.service

    systemctl stop redis_exporter.service

    systemctl restart redis_exporter.service

    13.3 添加到Prometheus

    • job_name: '10.2_reids'

      static_configs:

      • targets: ['x.x.x.2:9121']

    13.4 添加grafana

    Import dashboard 763 选择数据源 Prometheus

    image.png

    相关文章

      网友评论

        本文标题:13 Redis_exporter 一篇就够

        本文链接:https://www.haomeiwen.com/subject/ytzsvrtx.html