系统相关
首页 > 系统相关> > ubuntu 16.04二进制安装prometheus

ubuntu 16.04二进制安装prometheus

作者:互联网

一、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']

修改完成,wq保存退出;

启动;

./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

标签:tar,16.04,--,prometheus,usr,wubin,ubuntu,yml
来源: https://www.cnblogs.com/smile635664087/p/16133599.html