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
阅读(1155) | 评论(0) | 转发(0) |