zoukankan      html  css  js  c++  java
  • 监控服务器配置(一)-----Prometheus安装配置

    最近和朋友一起做的监控配置,拿出来共享一下

    1.下载prometheus安装包(linux版)到 /opt/minitor/prometheus 。

    下载地址:https://download.csdn.net/download/a15565772151/11111904

    不知道为啥,csdn没法自己设置不需要积分了,可能是我没找到在哪里操作,可以私聊我一下我发你资源

    2.运行 tar -zxvf prometheus-2.0.0.linux-amd64.tar.gz ,解压文件到当前目录。

    3.执行 vim /opt/minitor/prometheus/prometheus.yml。 如果vim不可用,可以使用vi,这里使用vim主要是为了好看。额。。。。或者可以yum install vim

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    # my global config
    global:
      scrape_interval:     5s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
      evaluation_interval: 5s # Evaluate rules every 15 seconds. The default is every 1 minute.
      # scrape_timeout is set to the global default (10s).
     
    # Alertmanager configuration
    alerting:
      alertmanagers:
        - static_configs:
    #     - targets: ['localhost:9093']
     
    # Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
    rule_files:
    # - "/opt/prometheus/prome/prometheus-2.0.0.linux-amd64/rules/rules.yml"
     
    # A scrape configuration containing exactly one endpoint to scrape:
    # Here it's Prometheus itself.
    scrape_configs:
      # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
      - job_name: 'prometheus'
     
        # metrics_path defaults to '/metrics'
        # scheme defaults to 'http'.
     
        static_configs:
          - targets: ['ip地址:9090']
            labels:
              instance: prometheus

    一定要注意缩进,同一级别的一定得对其

    4.启动prometheus。

    1
    nohup ./prometheus --config.file=prometheus.yml --web.listen-address=:9090 &

    5.去prometheus自带的web页面上查看  http://IP地址:9090/graph

    6.prometheus状态为up,说明配置成功。

  • 相关阅读:
    spark 程序 TopN FileSort SecondarySort 的出错解决办法
    预报温度和体感温度不是一回事
    搜索引擎 搜索技巧
    scrapy 爬虫框架
    scala-sbt
    英语削笔机
    php 一句话木马
    [CS充实之路] CS50 WEEK 1
    UBUNTU 16.04 编译 OPENJDK8
    使用logrotate分割Tomcat的catalina日志
  • 原文地址:https://www.cnblogs.com/ExMan/p/11047402.html
Copyright © 2011-2022 走看看