资源规划
组件 | LTSR003 | LTSR005 | LTSR006 | LTSR007 | LTSR008 |
---|---|---|---|---|---|
OS | centos7.6 | centos7.6 | centos7.6 | centos7.6 | centos7.6 |
Prometheus | Prometheus | N.A | N.A | N.A | N.A |
安装介质
版本:prometheus-2.10.0.linux-amd64.tar.gz
下载:https://github.com/prometheus/prometheus/releases/download/v2.10.0/prometheus-2.10.0.linux-amd64.tar.gz
安装Prometheus
解压缩
sudo su
cd /home/bigdata/software/
# 下载安装介质
wget https://github.com/prometheus/prometheus/releases/download/v2.10.0/prometheus-2.10.0.linux-amd64.tar.gz
tar -zxvf /home/bigdata/software/prometheus-2.10.0.linux-amd64.tar.gz
rm -rf /share/prometheus-2.10.0.linux-amd64.tar.gz
rm -rf /usr/local/prometheus
mv /home/bigdata/software/prometheus-2.10.0.linux-amd64 /usr/local/prometheus
创建相关目录
mkdir -p /usr/local/prometheus/data
创建用户并授权
useradd prometheus
chown -R prometheus:prometheus /usr/local/prometheus
启动服务配置
rm -rf /usr/lib/systemd/system/prometheus.service
vi /usr/lib/systemd/system/prometheus.service
配置如下:
[Unit]
Description=Prometheus
After=network.target
[Service]
Type=simple
User=prometheus
ExecStart=/usr/local/prometheus/prometheus --config.file=/usr/local/prometheus/prometheus.yml --storage.tsdb.path=/usr/local/prometheus/data
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
[Install]
WantedBy=multi-user.target
启动
systemctl enable prometheus.service
systemctl start prometheus.service
systemctl status prometheus.service
systemctl stop prometheus.service
验证
systemctl status prometheus.service
ps -ef | grep prometheus
# 端口查看
netstat -anpt
Web UI:http://LTSR003:9090