prometheus服务发现

Consul简介

◼ 一款基于golang开发的开源工具,主要面向分布式,服务化的系统提供服务注册、服务发现和配置管理

的功能

◼ 提供服务注册/发现、健康检查、Key/Value存储、多数据中心和分布式一致性保证等功能

部署

bash 复制代码
curl -LO https://releases.hashicorp.com/consul/1.16.2/consul_1.16.2_linux_amd64.zip

unzip  consul_1.16.2_linux_amd64.zip



mv consul /usr/local/bin
consul agent -dev -ui -data-dir=/consul/data/ \
-config-dir=/etc/consul/ -client=0.0.0.0

访问

http://120.77.146.92:8500/

bash 复制代码
root@server01:/consul/data# vi /etc/consul/nodes.json 

{
"service": {
"id": "node_exporter",
"name": "node01",
"address": "172.29.21.67",
"port": 9100,
"tags": ["nodes"],
"checks": [{
"http": "http://172.29.21.67:9100/metrics",
"interval": "5s"
}]
}
}

基于consnl的服务发现

修改prometheus配置文件

注释file_sd_configs段

添加consul_sd_configs段

查看prometheus

之前labels的os标签没有了,这个是基于consnl发现的

相关推荐
1candobetter2 小时前
文件下载接口从预热到正式性能测试实践(JMeter + Prometheus + Grafana)
jmeter·grafana·prometheus
文青小兵3 小时前
Linux云计算——docker 告警(六)
linux·运维·docker·云计算·prometheus
成为你的宁宁4 小时前
【Kubernetes监控实战:NFS持久化存储 + Prometheus Operator + etcd监控】
kubernetes·prometheus·etcd
念何架构之路2 天前
接入LVS+Nginx和服务发现
nginx·服务发现·lvs
江南风月2 天前
WGCLOUD监控系统的Restful Http接口一览
运维·zabbix·运维开发·prometheus
文青小兵2 天前
Linux云计算——docker 监控(五)
linux·docker·云计算·grafana·prometheus
IT策士2 天前
第29篇 k8s之Service 与 Endpoints 深入:服务发现原理
容器·kubernetes·服务发现
weixin_468466853 天前
Prometheus监控服务部署与实战指南
服务器·后端·python·docker·自动化·prometheus
江华森3 天前
Prometheus 全栈监控体系部署与使用指南
prometheus
tellmewhoisi4 天前
Docker Compose最巧妙的设计之一——内置的服务发现机制
docker·服务发现