1 个回答
使用docker启动prometheus,方法如下:
1、创建配置文件
1、创建配置文件
#创建conf文件夹
mkdir /home/pubserver/prometheus/conf/
#进入到conf文件夹
cd /home/pubserver/prometheus/conf/
#创建prometheus.yml文件
touch prometheus.yml
#把如下的内容保存到prometheus.yml文件中
global:
scrape_interval: 15s
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
2、使用如下的命令启动sudo docker run --name prometheus -d --privileged=true -u=root \
-p 9090:9090 \
-v /etc/localtime:/etc/localtime:ro \
-v /home/pubserver/prometheus/data:/prometheus/data \
-v /home/pubserver/prometheus/conf:/prometheus/config \
-v /home/pubserver/prometheus/rules:/prometheus/rules \
prom/prometheus:v2.41.0 --config.file=/prometheus/config/prometheus.yml --web.enable-lifecycle
3、访问http://xxxx:9090端口发布于:4个月前 (01-10) IP属地:四川省
我来回答
您需要 登录 后回答此问题!