prometheus+grafana构建应用监控(二)

来源:互联网 发布:贵州广电网络好用吗 编辑:程序博客网 时间:2024/05/29 15:30

安装与配置

  • prometheus安装与配置

    • 源码安装,只需要下载prometheus,并解压即可
    • 使用docker安装,使用docker run -p 9090:9090 -v /tmp/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus
    • 启动可指定端口

      ./prometheus –config.file=prometheus.yml -web.listen-address 127.0.0.1:9090

    • 使用文件动态发现配置

    - job_name: 'applications'     file_sd_configs:       - files:         - config/applications/*.json         refresh_interval: 5m
  • grafana安装与配置

    • 源码安装

      wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-4.4.3-1.x86_64.rpm
      sudo yum install initscripts fontconfig
      sudo rpm -Uvh grafana-4.4.3-1.x86_64.rpm

    • 邮件配置,只需要将defaults.ini中的smtp section配置好即可

至此,安装已经完毕

原创粉丝点击