二进制安装 Prome 生态
· 阅读需 7 分钟
Prometheus 二进制安装
下载解压二进制程序
mkdir /apps && cd /apps
#wget https://github.com/prometheus/alertmanager/releases/download/v0.24.0/alertmanager-0.24.0.linux-amd64.tar.gz
wget https://github.com/prometheus/prometheus/releases/download/v2.35.0/prometheus-2.35.0.linux-amd64.tar.gz
tar xf prometheus-2.35.0.linux-amd64.tar.gz
# 创建软连接
ln -sv prometheus-2.35.0.linux-amd64 /apps/prometheus
# 检查配置文件
./promtool check config prometheus.yml
创建 prometheus service 启动脚本
vim /etc/systemd/system/prometheus.service
[Unit]
Description=Prometheus Server
Documentation=https://prometheus.io/docs/introduction/overview/
After=network.target
[Service]
Restart=on-failure
WorkingDirectory=/apps/prometheus/
ExecStart=/apps/prometheus/prometheus --config.file=/apps/prometheus/prometheus.yml
[Install]
WantedBy=multi-user.target
启动 prometheus 服务
systemctl daemon-reload
systemctl restart prometheus
systemctl enable prometheus
node export 二进制安装
下载解压二进制程序
cd /apps
wget https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-amd64.tar.gz
tar xf node_exporter-1.3.1.linux-amd64.tar.gz
# 创建软连接
ln -sv /apps/node_exporter-1.3.1.linux-amd64 /apps/node_exporter