Prometheus(普罗米修斯)是一款开源的监控系统,使用go语言开发,启动速度快,易于部署,下载后可直接运行。
本文简单的来说下Prometheus安装启动,以Centos7.x为例。
1、下载Prometheus
1 2 3 4 |
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版本
1 |
./prometheus --version |
1 2 3 4 |
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
1 |
./prometheus & |
你没看错,启动一个Prometheus是非常容易的,默认的配置文件prometheus.yml,默认启动后的端口为9090。
4、以服务方式启动
添加到系统服务,方便于管理
1 |
vi /etc/systemd/system/prometheus.service |
1 2 3 4 5 6 7 8 9 10 11 |
[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 |
启动服务,设置开机自启
1 2 3 |
systemctl daemon-reload systemctl enable prometheus systemctl start prometheus |
访问http://IP:9090
原文链接:Prometheus安装启动(一),转载请注明来源!