cortex 基本试用
cortext是prometheus的多租户解决方案,目前在cncf 沙箱孵化,以下是一个简单的试用
注意因为golang 包的问题,而且以下依赖的几个项目都是基于go module 的所以使用了goproxy 配置,具体配置为:
export GOPROXY=https://goproxy.cn/,此处运行的是单实例模式
单实例,单进程运行
- clone cortex 代码
git clone https://github.com/cortexproject/cortex.git
- 构建
cd cortex
go build ./cmd/cortex
- 启动
./cortex -config.file=./docs/single-process-config.yaml
- prometheus 运行
也是基于源码构建,同时需要添加remote_write
clone prometheus 代码
git clone https://github.com/prometheus/prometheus
构建prometheus
cd prometheus
go build ./cmd/prometheus
修改demo 配置
documentation/examples/prometheus.yml 添加以下内容
remote_write:
- url: http://localhost:9009/api/prom/push
- 运行
./prometheus --config.file=./documentation/examples/prometheus.yml
- 运行grafana dashboard工具
docker 启动
docker run -d --name=grafana -p 3000:3000 grafana/grafana
添加promethesu datasource
注意修改为自己的docker 主机ip
http://host.docker.internal:9009/api/prom
说明:为了对比,最好也添加下原生prometheus server
运行效果
- 通过grafana 查询对比
- 数据存储效果
demo 数据存放在/tmp/cortex 内容如下:
说明
以上是一个简单的单机运行试用,后边会试用docker-compose 运行多实例
参考资料
https://github.com/cortexproject/cortex/blob/master/docs/getting_started.md
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
2018-09-29 nuclio kubernetes 部署
2018-09-29 nuclio dokcer 运行测试