安装Prometheus
docker run -itd --name prometheus -v /software:/software -p 9090:9090 -p 9091:9091 --privileged=true vvhello/centos:7.9.2009_exten /usr/sbin/init
mkdir /software && cd /software
wget https://github.com/prometheus/prometheus/releases/download/v2.30.0/prometheus-2.30.0.linux-amd64.tar.gz
tar xf prometheus-2.30.0.linux-amd64.tar.gz
mv prometheus-2.30.0.linux-amd64 /usr/local/prometheus
useradd -M -s /sbin/nologin prometheus
mkdir -p /data/prometheus
chown -R prometheus:prometheus /usr/local/prometheus /data/prometheus
vim /usr/lib/systemd/system/prometheus.service
[Unit]
Description=Prometheus
After=network.target
[Service]
Type=simple
Environment="GOMAXPROCS=4"
User=prometheus
Group=prometheus
ExecReload=/bin/kill -HUP $MAINPID
ExecStart=/usr/local/prometheus/prometheus \
--config.file=/usr/local/prometheus/prometheus.yml \
--storage.tsdb.path=/data/prometheus \