docker 版本prometheus
缘由
之前是jar 安装到服务器,但是服务器重启后,没有自启动,而且很多都是docker维护,有平台方便重启,
最后还是决定docker 安装prometheus
安装
1 | docker run -itd --name=prometheus --restart=always -p 9090:9090 prom/prometheus |
容器创建成功后,即可通过浏览器访问 http: / /{ip}:9090 来进行验证
配置
复制docker内配置文件出来
docker cp prometheus:/etc/prometheus/prometheus.yml $PWD
[root@Docker ~]# vim prometheus.yml 在Prometheus配置文件按以下内容修改: scrape_configs: # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config. - job_name: 'prometheus' # metrics_path defaults to '/metrics' # scheme defaults to 'http'. static_configs: - targets: ['localhost:9090'] labels: instance: prometheus - job_name: linux static_configs: - targets: ['192.168.1.1:9100'] #被监控端的IP地址和端口号(有多个被监控端可用 逗号 隔开) labels: instance: localhost
修改后 复制回去
docker cp $PWD/prometheus.yml prometheus:/etc/prometheus/prometheus.yml
最后重启prometheus
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
2017-07-16 python 时间复杂度