linux系统监控
监控集群架构图
一:单节点监控
1:前往官方网站下载相关软件包
普罗米修斯(prometheus)官方网站:https://prometheus.io/
2:将下载的软件包上传到需要安装的系统上
我这里使用wget命令下载软件包
复制他的下载链接
命令格式:wget 下载链接
cd /root/
wget https://github.com/prometheus/prometheus/releases/download/v2.26.0/prometheus-2.26.0.linux-amd64.tar.gz
3:配置时间同步
yum install -y ntpdate
ntpdate time.windows.com
4:关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
5:软件包处理
解压压缩包
mkdir /usr/local/prometheus
tar -zxvf /root/prometheus-2.26.0.linux-amd64.tar.gz -C /usr/local/prometheus/
使用自带的启动脚本
cd /usr/local/prometheus/prometheus-2.26.0.linux-amd64
./prometheus --config.file="prometheus.yml"
查看9090端口是否占用,如果有占用表示搭建完成
ss -tlunp |grep 9090
6:使用web界面访问
浏览器地址栏输入
http://服务器IP:9090
查看当前监控的节点有哪些
二:添加多个监控目标
我们将第一节搭建的节点当初集群的监控主机,以它为中心扩展多个监控节点
三:web监控界面美化(监控主机操作)
1:前往官网下载美化包
官方网站:https://grafana.com/grafana/download
我这里使用wget下载(方便)
cd /root
wget https://dl.grafana.com/oss/release/grafana-7.5.5-1.x86_64.rpm
2:使用yum安装,它会自动解决依赖
cd /root
yum install -y grafana-7.5.5-1.x86_64.rpm
3:启动相关服务
systemctl start grafana-server
systemctl enable grafana-server
4:确认端口
ss -tlunp |grep 3000
5:使用web界面访问
访问格式
http:// grafana服务器IP:3000
默认账号:admin
默认密码:admin