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

相关推荐
Clown951 天前
go-zero(十九)使用Prometheus监控ES指标
elasticsearch·golang·prometheus
奔跑中的小象1 天前
基于 nvitop+Prometheus+Grafana 的物理资源与 VLLM 引擎服务监控方案
grafana·prometheus·vllm·nvitop
小黑_深呼吸1 天前
Prometheus实战教程:k8s平台-Mysql监控案例
运维·学习·kubernetes·prometheus
艾文伯特2 天前
Prometheus+Grafana+AlertManager完整安装过程
grafana·prometheus
@PHARAOH5 天前
WHAT - 简单服务发现
服务发现
李匠20246 天前
C++GO语言微服务和服务发现②
开发语言·c++·golang·服务发现
一个向上的运维者8 天前
Prometheus生产实战全流程详解(存储/负载/调度篇)
云原生·prometheus
hwj运维之路8 天前
k8s监控方案实践(一):部署Prometheus与Node Exporter
容器·kubernetes·prometheus
Mr.小怪8 天前
自定义prometheus exporter实现监控阿里云RDS
阿里云·adb·prometheus
阿里云云原生8 天前
剑指大规模 AI 可观测,阿里云 Prometheus 2.0 应运而生
人工智能·阿里云·prometheus