docker部署Prometheus
1、 拉取prometheus镜像
docler pull prom/prometheus
遇到问题:注意下科学上网。
2、将prometheus配置文件放在外面管理 prometheus.yml
yml
global:
scrape_interval: 15s
evaluation_interval: 15s
alerting:
alertmanagers:
- static_configs:
- targets:
# - alertmanager:9093
rule_files:
# - "first_rules.yml"
# - "second_rules.yml"
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
3、启动一个prometheus容器
sh
docker run -d --name prometheus -p 9090:9090 -v /Users/xxx/docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus
4、mac 精准查找本机ip命令
ifconfig en0 | grep inet| awk '{print $2}'
5、访问地址
6、效果图

docker部署Grafana
1、拉取 grafana镜像
docker pull grafana/grafana
2、启动一个grafana容器
docker run -d --name grafana -p 3000:3000 grafana/grafana
3、访问地址 http://本机地址:3000/
java
默认账号 admin/admin 第一次登陆会重新设置密码
4、效果图
