(一) 安装prometheus install
$ wget https://github.com/prometheus/prometheus/releases/download/v2.4.3/prometheus-2.4.3.linux-amd64.tar.gz
$ tar zxvf prometheus-2.4.3.linux-amd64.tar.gz
$ cd prometheus-2.4.3.linux-amd64
如果需要添加新的job,在这个文件添加
$ vim prometheus.yml
运行 start Prometheus
$ nohup ./prometheus &
改成systemd服务
Prometheus自带一个Web网站,默认端口为9090, http://ip:9090.可以查看表达式搜索结果、报警配置、prometheus配置,exporter状态等.
(二) 安装配置Grafana
官方安装文档: https://grafana.com/grafana/download?platform=linux
http://docs.grafana.org/installation/
需要开放3000端口的访问权限 https://blog.csdn.net/zbljz98/article/details/80464761
$ iptables -A INPUT -p tcp --dport 3000 -j ACCEPT
我开始的时候就是没做这一步,导致无法在ip:3000端口访问
进入登录页面,首次访问的用户名是admin, 密码是 admin
首次登录之后会要求你更换密码