码迷,mamicode.com
首页 > 其他好文 > 详细

prometheus安装全过程

时间:2019-12-27 21:55:25      阅读:97      评论:0      收藏:0      [点我收藏+]

标签:show   ted   root   down   failure   ant   The   ecs   wget   

#安装prometheus

技术图片
wget https://github.com/prometheus/prometheus/releases/download/v2.5.0/prometheus-2.5.0.linux-amd64.tar.gz
tar -xvf prometheus-2.5.0.linux-amd64.tar.gz
cd prometheus-2.5.0.linux-amd64/
mv * /home/work/prometheus/
cd /home/work/prometheus/
mkdir {data,cfg,logs,bin} -p
mv prometheus promtool bin/
mv prometheus.yml cfg/
vim /etc/systemd/system/prometheus.service

[Unit]
Description=Prometheus
Documentation=https://prometheus.io/
After=network.target

[Service]
Type=simple
User=root
ExecStart=/home/work/prometheus/bin/prometheus --config.file=/home/work/prometheus/cfg/prometheus.yml --storage.tsdb.path=/home/work/prometheus/data
Restart=on-failure

[Install]
WantedBy=multi-user.target

vim /home/work/prometheus/cfg/prometheus.yml
View Code

 

#安装node_exporter

技术图片
wget https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.darwin-amd64.tar.gz
tar -zxvf node_exporter-0.17.0-rc.0.linux-amd64.tar.gz -C cd /home/work/prometheus/
cd /home/work/prometheus/
mv node_exporter-0.17.0-rc.0.linux-amd64 node_exporter
vim /etc/systemd/system/node_exporter.service

[Unit]
Description=node_exporter
Documentation=https://prometheus.io/
After=network.target
[Service]
Type=simple
User=root
ExecStart=/home/work/prometheus/node_exporter/node_exporter
Restart=on-failure
[Install]
WantedBy=multi-user.target
View Code

 

#安装grafana

技术图片
wget https://dl.grafana.com/oss/release/grafana-6.1.3-1.x86_64.rpm 
yum -y localinstall grafana-6.1.3-1.x86_64.rpm
View Code

 


#安装alertmanager

技术图片
wget https://github.com/prometheus/alertmanager/releases/download/v0.20.0/alertmanager-0.20.0.linux-amd64.tar.gz 
tar -xvf alertmanager-0.20.0.linux-amd64.tar.gz -C /home/work/prometheus/ 
cd /home/work/prometheus/ && mv alertmanager-0.20.0.linux-amd64/ alertmanager 
cd alertmanager/ 
mkdir {bin,cfg,data} 
mv alertmanager amtool bin/ 
mv alertmanager.yml cfg/ 
vim /usr/lib/systemd/system/alertmanager.service 
[Unit]
Description=alertmanager
Documentation=https://prometheus.io/
After=network.target

[Service]
Type=simple
User=root
ExecStart=/home/work/prometheus/alertmanager/bin/alertmanager --config.file=/home/work/prometheus/alertmanager/cfg/alertmanager.yml --web.listen-address=10.10.2.17:9093 --cluster.listen-address=0.0.0.0:8001 --storage.path=/home/work/prometheus/alertmanager/data --log.level=info
Restart=on-failure
LimitNOFILE=65536

[Install]
WantedBy=multi-user.target
View Code

 

#安装pushgateway

技术图片
wget https://github.com/prometheus/pushgateway/releases/download/v1.0.1/pushgateway-1.0.1.linux-amd64.tar.gz
tar xzvf pushgateway-1.0.1.linux-amd64.tar.gz
mv pushgateway-1.0.1.linux-amd64 /home/work/prometheus/pushgateway
./pushgateway &
View Code

 

prometheus安装全过程

标签:show   ted   root   down   failure   ant   The   ecs   wget   

原文地址:https://www.cnblogs.com/tengfei520/p/12109612.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!