prometheus更改默认端口

默认的9090改为9999:

  • 容器

docker run -d -p 9999:9090 \
            -v $PWD/prometheus.yml:/etc/prometheus/prometheus.yml \
            --name prometheus \
            prom/prometheus \

  • 二进制

安装包解压后直接启动,加上参数 --web.listen-address中指定:./prometheus --web.listen-address=:9999 

  • 自启动配置

[Unit]

Description=Prometheus

[Service]
ExecStart=/opt/prometheus  --config.file=/opt/prometheus.yml  --web.listen-address=:9999
[Install]
WantedBy=multi-user.target

posted @ 2021-04-29 18:52  jamespeng2020  阅读(3422)  评论(0)    收藏  举报