⑥ prometheus+grafana监控Ceph集群

在新建的主机192.168.0.5

一、安装grafana

1、清华源下载
 [root@ceph-grafana-prometheus ~]# wget https://mirrors.tuna.tsinghua.edu.cn/grafana/yum/rpm/grafana-6.7.3-1.x86_64.rpm
2.安装grafana
rpm -ivh grafana-6.7.3-1.x86_64.rpm
或
yum localinstall grafana-6.7.3-1.x86_64.rpm

3.启动grafana并设为开机自启
systemctl start grafana-server.service 
systemctl enable grafana-server.service
#grafana的默认端口为3000

二、安装prometheus

#1、下载安装包,下载地址
wget https://github.com/prometheus/prometheus/releases/download/v2.18.0/prometheus-2.18.0.linux-amd64.tar.gz
#2、解压压缩包
tar xf prometheus-2.14.0.linux-amd64.tar.gz
#3、将解压后的目录改名
mv prometheus-2.18.0.linux-amd64 /opt/prometheus
#4、查看prometheus版本
cd /opt/prometheus/
./prometheus --version
prometheus, version 2.18.0
#5、配置系统服务启动
vim /etc/systemd/system/prometheus.service
[Unit]
Description=Prometheus Monitoring System
Documentation=Prometheus Monitoring System

[Service]
ExecStart=/opt/prometheus/prometheus \
  --config.file /opt/prometheus/prometheus.yml \
  --web.listen-address=:9090

[Install]
WantedBy=multi-user.target
#6、加载系统服务
systemctl daemon-reload
#7、启动服务和添加开机自启动
systemctl restart prometheus
systemctl enable prometheus
#8、访问
http://192.168.0.5:9090

三、ceph mgr prometheus插件配置

在cephnode01上配置

#启动prometheus模块
ceph mgr module enable prometheus
#检查端口
netstat -nltp | grep mgr 
ceph -s (mgr在cephnode03上)
#测试返回值
curl 192.168.0.8:9283/metrics  
#访问
http://192.168.0.8:9283/metrics

四、配置prometheus

1、在 scrape_configs: 配置项下添加

#每个job_name要分开
vim prometheus.yml
  - job_name: 'ceph_cluster'
    honor_labels: true
    scrape_interval: 5s
    static_configs:
      - targets: ['192.168.0.8:9283']
        labels:
          instance: ceph

2、重启prometheus服务

systemctl restart prometheus

3、检查prometheus服务器中是否添加成功

浏览器-》 http://x.x.x.x:9090 -》status -》Targets

五、配置grafana

1、浏览器登录 grafana 管理界面

http://192.168.0.5:3000/

2、添加data sources,点击configuration–》data sources

3、添加dashboard,点击HOME–》find dashboard on grafana.com

4、搜索ceph的dashboard

5、点击HOME–》Import dashboard, 选择合适的dashboard,记录编号

6、检测成功

7、也可以检测Cephfs文件系统

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值