• 监控服务器配置(一)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

    # 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。

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

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

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

  • 相关阅读:
    golang不想http自动处理重定向的解决方案
    学习WebDav
    keepass+坚果云管理我的密码
    定制右键功能,看这一篇就够了
    翻转二叉树
    加密sqlite3数据库文件
    算出cron表达式接下来几次执行时间
    关于斐波那契数列的3种解法
    golang通过cgo调用lua
    学习go语言并完成第一个作品
  • 原文地址:https://www.cnblogs.com/cui0614/p/10700149.html
Copyright © 2020-2023  润新知