一、prometheus网址
https://prometheus.io/download/
下载prometheus的tar.gz解压包
二、安装prometheus
解压:
cd /usr/wubin
tar zxvf prometheus-2.14.0.linux-amd64.tar.gz
更名:
mv prometheus-2.14.0.linux-amd64 prometheus
查看版本:
./prometheus --version
vim prometheus.yml
修改配置
scrape_configs:
- job_name: 'prometheus'
static_configs:
# 监控本地及端口
- targets: ['172.16.75.205:9090']
启动;
./prometheus --config.file=prometheus.yml
三、设置开机自启
vim /usr/lib/systemd/system/prometheus.service
配置环境:
[Unit]
Description=Prometheus
After=network.target
[Service]
Type=simple
ExecStart=/usr/wubin/prometheus2.14/prometheus --config.file=/usr/wubin/prometheus2.14/prometheus.yml
[Install]
WantedBy=multi-user.target
输入完成,wq保存退出;
输入命令:
systemctl daemon-reload
systemctl enable prometheus
systemctl start prometheus
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。