zoukankan      html  css  js  c++  java
  • Docker 配置国内镜像源拉取prometheus,解决prometheus拉取特别慢的问题

    在使用过程中,发现docker拉取prometheus的时候默认使用的国外的镜像源,特别慢,于是网上查了下,可以按照如下方式配置国内镜像源,尝试了下,果然快多了。

    一、配置国内镜像源

    编辑 vi /etc/docker/daemon.json,如果文件没有可以 touch 新建一个。

    {
        "registry-mirrors": ["http://hub-mirror.c.163.com", "https://docker.mirrors.ustc.edu.cn"]
    }
    

     重启 docker

    systemctl restart docker

    其他国内镜像源:

    Docker中国区官方镜像
    https://registry.docker-cn.com
    
    网易
    http://hub-mirror.c.163.com
    
    ustc 
    https://docker.mirrors.ustc.edu.cn
    
    中国科技大学
    https://docker.mirrors.ustc.edu.cn
    

     二、安装并运行Promethues

    (1)下载安装promethues的docker镜像

    docker pull prom/prometheus:latest

     

    (2)运行promethues

    docker run -itd -p 9090:9090 --name=prometheus -v \

    /etc/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus

    三、监控Linux性能指标

    修改promethues配置文件(建议蓝色内容直接拷贝)

    vi /etc/promethues.yml

     

    # my global config

    global:

      # 设置抓取数据的时间间隔,间隔设置为每15秒一次。默认为每1分钟。

      scrape_interval:     15s

      # 设定抓取数据的超时时间,默认为10s

      scrape_timeout: 5s

      # 设置规则刷新,每15秒刷新一次规则。默认值为每1分钟。

      evaluation_interval: 15s

     

    # 监控报警配置(需要额外安装 alertmanager组件)

    #alerting:

    #  alertmanagers:

    #  - static_configs:

        # 设定alertmanager和prometheus交互的接口,即alertmanager监听的ip地址和端口

    #    - targets: ["k8s.dev-share.top:9093"]

     

    # 报警规则文件

    #rule_files:

     # - '/home/deploy/alertmanager/rules/*.yml'

     

    # 普罗米修斯与抓取模块交互的接口配置

    scrape_configs:

     

      # 一定要全局唯一, 采集 远程linux的 metrics

      - job_name: linux

        static_configs:

          - targets: ['192.168.100.100:9100']

            labels:

              instance: linux

    参考:

    https://blog.csdn.net/xiaobinqt/article/details/116139871

    https://mp.weixin.qq.com/s/KTqXmofI99AzE-GeSFjutA

  • 相关阅读:
    [LeetCode] Max Area of Island
    [TCP/IP] TCP数据报
    [LeetCode] Number of Islands
    [LeetCode] Binary Number with Alternating Bits
    [TCP/IP] Internet协议
    [LeetCode] Isomorphic Strings
    [LeetCode] Path Sum
    [LeetCode] Count and Say
    [学习OpenCV攻略][001][Ubuntu安装及配置]
    [国嵌攻略][038][时钟初始化]
  • 原文地址:https://www.cnblogs.com/annatest/p/15717932.html
Copyright © 2011-2022 走看看