美文网首页
Prometheus监控PHP-FPM

Prometheus监控PHP-FPM

作者: 袁先生的笔记 | 来源:发表于2018-11-15 18:38 被阅读0次

    环境

    系统:CentOS 7.5
    软件:php-fpm-exporter.linux.amd64

    准备

    PHP-FPM端

    • 下载php-fpm-exporter
      地址:https://github.com/bakins/php-fpm-exporter/releases

    • 安装php-fpm-exporter

      # mkdir -p /usr/local/prometheus/php-fpm-exporter
      # mv php-fpm-exporter.linux.amd64 /usr/local/prometheus/php-fpm-exporter/php-fpm-exporter
      # chmod +x /usr/local/prometheus/php-fpm-exporter/php-fpm-exporter
      
    • 启动php-fpm-exporter

      # nohup /usr/local/prometheus/php-fpm-exporter/php-fpm-exporter --addr 0.0.0.0:9190 --endpoint http://127.0.0.1:9010/status > /usr/local/prometheus/php-fpm-exporter/php-fpm-exporter.log 2>&1 &
      

    Prometheus端

    • 配置Prometheus

      # vim /usr/local/prometheus/prometheus.yml
      scrape_configs:
        - job_name: 'PHP-FPM'
          static_configs:
            - targets:
              - yuantong.zjcx-local.com:9190
      
    • 重启Prometheus

      # systemctl restart prometheus
      

    Grafana端

    • 添加dashboards
      点击Create - Import,输入dashboards的id(推荐)

    相关文章

      网友评论

          本文标题:Prometheus监控PHP-FPM

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