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

相关推荐
juma90021 小时前
西门子S7-200SMART_PLC基于RS485通讯恒压供水一拖二程序样例,采样PLC+sm...
prometheus
比奥利奥还傲.13 小时前
无需复杂操作!Prometheus+cpolar+实现跨网监控自由
prometheus
听风吟丶1 天前
云原生 APM 实战:Prometheus Operator+K8s 构建容器化微服务监控体系
云原生·kubernetes·prometheus
听风吟丶1 天前
Java 微服务 APM 实战:Prometheus+Grafana 构建全维度性能监控与资源预警体系
java·微服务·prometheus
递归尽头是星辰1 天前
架构实战:1 小时搭建Java微服务指标监控体系(Prometheus+Grafana 落地指南)
grafana·prometheus·可观测性·micrometer·指标监控·java 微服务监控
阿拉斯攀登1 天前
SpringCloudAlibaba之Nacos
微服务·服务发现·springcloud
拾忆,想起3 天前
Dubbo动态服务发现配置指南:从基础到云原生实践
服务器·网络·微服务·云原生·架构·服务发现·dubbo
忙里偷闲学python3 天前
prometheus部署,解锁监控新篇章
信息可视化·数据分析·prometheus
a***81394 天前
SpringBoot集成Prometheus
spring boot·后端·prometheus
java_logo4 天前
Prometheus Docker 容器化部署指南
运维·人工智能·docker·容器·prometheus·ai编程