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发现的

相关推荐
Yu_摆摆2 天前
windows部署prometheus+windows_exporter+grafana+alertmanager实现监控CPU、内存、磁盘并邮件告警
windows·grafana·prometheus
indexsunny3 天前
互联网大厂Java面试实战:从Spring Boot到微服务架构的深度解析
java·spring boot·spring cloud·kafka·prometheus·security·microservices
**蓝桉**3 天前
Prometheus的服务发现机制
服务发现·prometheus
**蓝桉**5 天前
prometheus监控docker容器(Rocky9)
docker·容器·prometheus
Amour恋空5 天前
Nacos服务发现与配置
java·后端·服务发现
j200103225 天前
Prometheus
k8s·prometheus
lpruoyu5 天前
【云原生】可观测性系统—Prometheus—EFK
云原生·prometheus
**蓝桉**5 天前
Pushgateway的使⽤
grafana·prometheus
**蓝桉**6 天前
prometheus监控nginx
nginx·elasticsearch·prometheus
**蓝桉**6 天前
Grafana Redis 监控面板全解析(小白版)
redis·prometheus