标签:useradd number cst enable service 启动 systemd sys pre
系统:CentOS 7.5
软件:prometheus-2.18.1.linux-amd64.tar.gz
下载二进制包
地址:https://prometheus.io/download/
安装
# tar -xzvf prometheus-2.18.1.linux-amd64.tar.gz
# mkdir /usr/local/prometheus
# mv prometheus-2.18.1.linux-amd64 /usr/local/prometheus/prometheus
创建数据目录
# mkdir -p /data/prometheus/prometheus/data
创建用户并授权
# useradd 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
User=prometheus
ExecStart=/usr/local/prometheus/prometheus/prometheus --config.file=/usr/local/prometheus/prometheus/prometheus.yml --storage.tsdb.path=/data/prometheus/prometheus/data
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
[Install]
WantedBy=multi-user.target
启动
# systemctl enable prometheus.service
# systemctl start prometheus.service
访问
web地址:http://ip:9090
标签:useradd number cst enable service 启动 systemd sys pre
原文地址:https://www.cnblogs.com/Python-K8S/p/13208637.html