Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7347350
  • 博文数量: 1763
  • 博客积分: 18684
  • 博客等级: 上将
  • 技术积分: 16217
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-02 10:28
个人简介

啥也没写

文章分类

全部博文(1763)

文章存档

2023年(44)

2022年(39)

2021年(46)

2020年(43)

2019年(27)

2018年(44)

2017年(50)

2016年(47)

2015年(15)

2014年(21)

2013年(43)

2012年(143)

2011年(228)

2010年(263)

2009年(384)

2008年(246)

2007年(30)

2006年(38)

2005年(2)

2004年(1)

分类: 系统运维

2019-02-20 11:46:12




wget -O prometheus-2.6.0.linux-amd64.tar.gz
wget -O node_exporter-0.17.0.linux-amd64.tar.gz


安装consul
unzip consul_1.2.3_linux_amd64.zip
mkdir -p 
./consul agent -server -bootstrap-expect 1 -data-dir /etc/consul.d/ -node=k8s101 -bind 10.0.2.101 -client 0.0.0.0 -config-dir /etc/consul.d/ -ui


curl 127.0.0.1:8500/v1/catalog/nodes

tar -zxvf prometheus-2.6.0.linux-amd64.tar.gz
cd prometheus-2.6.0.linux-amd64

vi prometheus.yml
...
  - job_name: 'consul-prometheus'
    scrape_interval: 5s
    scrape_timeout: 1s
    metrics_path: '/metrics'
    scheme: http
    consul_sd_configs:
      - server: '10.0.2.101:8500'
        refresh_interval: 30s
        services: []
    relabel_configs:
      - source_labels: ['__meta_consul_tags']
        regex: .*prometheus-target.*
        action: keep

运行
./prometheus


tar -zxvf node_exporter-0.17.0.linux-amd64.tar.gz 
cd node_exporter-0.17.0.linux-amd64
./node_exporter-0.17.0.linux-amd64.tar.gz 


添加服务
cat 1.json 
{
      "ID": "k8s102",
      "Name": "k8s102",
      "Tags": ["prometheus-target"],
      "Address": "10.0.2.102",
      "port": 9100,
      "Check":
          {
              "HTTP": "",
              "Interval": "15s"
          }
  }
添加
curl --request PUT --data @1.json

删除
curl --request PUT


wget
sudo yum localinstall grafana-5.4.2-1.x86_64.rpm 

下载dash导入就OK

阅读(1080) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~