互联网业内最受欢迎的监控:Prometheus在linux下的搭建
1、下载Prometheus(建议使用2.x版本)
wget https://github.com/prometheus/prometheus/releases/download/v2.8.0/prometheus-2.8.0.linux-amd64.tar.gz
tar xf prometheus-2.8.0.linux-amd64.tar.gz -C /usr/local/
mv /usr/local/prometheus-2.8.0.linux-amd64 /usr/local/prometheus
cd /usr/local/prometheus
2、查看Prometheus版本
./promethues --version
#显示如下
prometheus, version 2.8.0 (branch: HEAD, revision: 59369491cfdfe8dcb325723d6d28a837887a07b9)
build user: root@4c4d5c29b71f
build date: 20190312-07:46:58
go version: go1.11.5
3、启动Prometheus(后台)
#默认启动9090端口,读取当前目录下的promethues.yml配置
cd /usr/local/promethus && nohup ./promethues &
4、以服务方式启动
#添加到系统服务,方便于管理
vi /etc/systemd/system/prometheus.service
#添加如下内容
[Unit]
Description=Prometheus Monitoring System
Documentation=Prometheus Monitoring System
[Service]
ExecStart=/usr/local/prometheus/prometheus \
--config.file=/usr/local/prometheus/prometheus.yml \
--web.listen-address=:9090
[Install]
WantedBy=multi-user.target
5、启动服务,设置开机自启
systemctl daemon-reload
systemctl enable prometheus
systemctl start prometheus
6、访问Promethues主页
访问http://{IP}:9090,如果是本机则是http://localhost:9090
博主:测试生财(一个不为996而996的测开码农)
座右铭:专注测试开发与自动化运维,努力读书思考写作,为内卷的人生奠定财务自由。
内容范畴:技术提升,职场杂谈,事业发展,阅读写作,投资理财,健康人生。
csdn:https://blog.csdn.net/ccgshigao
博客园:https://www.cnblogs.com/qa-freeroad/
51cto:https://blog.51cto.com/14900374
微信公众号:测试生财(定期分享独家内容和资源)