一、Prometheus安装
1、服务器准备:
(1)关闭防火墙
# systemctl stop firewalld
# systemctl disable firewalld
# iptables -F
(2)时间同步
yum install -y ntpdate && ntpdate time.windows.com
2、安装Prometheus(官网提供的是二进制版,解压就能用,不需要编译)
从 https://prometheus.io/download/ 下载相应版本,安装到服务器上
(1)安装
tar -zxvf prometheus-2.5.0.linux-amd64.tar.gz -C /usr/local/
ln -s /usr/local/prometheus-2.5.0.linux-amd64/ /usr/local/prometheus
(2)启动
/usr/local/prometheus/prometheus --config.file="/usr/local/prometheus/prometheus.yml" &
(3)查询
ps -ef|grep prometheus
netstat -tunlp|grep prometheus # 查询端口 9090
(4)登录
通过浏览器http://服务器IP:9090
3、监控远程Linux主机
(1)安装node_exporter组件(远程客户端)
从 https://prometheus.io/download/ 下载node_exporter组件
tar -zxvf node_exporter-