目录:
1、Ceph Dashboard的部署
2、在k8s中建立有状态prometheus及Grafana监控Ceph集群状态node
Ceph 的监控可视化界面方案不少----grafana、Kraken。可是从Luminous开始,Ceph 提供了原生的Dashboard功能,经过Dashboard能够获取Ceph集群的各类基本状态信息。
mimic版 (nautilus版) dashboard 安装。若是是 (nautilus版) 须要安装 ceph-mgr-dashboard ios
一、在每一个mgr节点安装,尽可能保证在每一个节点都安装dashboard由于当一个节点挂了的话,去访问其余的节点,其余的节点没有这个dashboard的话就访问不到了浏览器
#yum -y install ceph-mgr-dashboard #ceph mgr module ls |more { "enabled_modules": [ "dashboard", "iostat", "restful" ], "disabled_modules": [ { "name": "ansible", "can_run": true,
二、开启mgr功能#ceph mgr module enable dashboard
restful
开启以后能够查看咱们的开启的模块
也能够经过ceph -s查看集群状态
这里会列出显示的services,这里显示mgr安装在三个节点上curl
#ceph -s cluster: id: 75aade75-8a3a-47d5-ae44-ec3a84394033 health: HEALTH_OK services: mon: 3 daemons, quorum cephnode01,cephnode02,cephnode03 (age 34m) mgr: cephnode01(active, since 5m), standbys: cephnode02, cephnode03 mds: cephfs:2 {0=cephnode02=up:active,1=cephnode03=up:active} 1 up:standby osd: 3 osds: 3 up (since 47m), 3 in (since 23h) rgw: 1 daemon active (cephnode01)
三、生成并安装自签名的证书tcp
#ceph dashboard create-self-signed-cert
四、建立一个dashboard登陆用户名密码ide
#ceph dashboard ac-user-create guest 1a2s3d4f administrator {"username": "guest", "lastUpdate": 1583304693, "name": null, "roles": ["administrator"], "password": "$2b$12$RgzO9RZzWWCYVcPSs3ACXO5dClSJH1gLh3QAc6GlaDQbhzKKHAXFC", "email": null}
五、查看服务访问方式测试
#ceph mgr services { "dashboard": "https://cephnode01:8443/" }
六、登陆页面ui
七、登陆ceph-dashboard的管理页面
关于建立访问ui的用户基于权限的设置,包含管理员,只读,块的管理者,cephfs的管理者均可以去建立url
这里我是用k8s将prometheus和grafana部署起来的,这里就再也不将部署细节进行展现了,以前写过这类的文档,另外就是咱们首先是去拿ceph的数据,怎么去拿呢?要就须要ceph提供的自己的mgr的模块对prometheus开启。
这里在k8s中部署prometheus的文档:http://www.javashuo.com/article/p-fwrlpmgx-dt.html
把这行获取收集ceph数据的模版加入configmap文件中
- job_name: 'ceph_cluster' honor_labels: true scrape_interval: 5s static_configs: - targets: ['192.168.1.5:9283'] labels: instance: ceph
部署完查看目前是没有获取到ceph的数据的,由于咱们如今尚未拿到数据
4、ceph mgr prometheus插件配置
这里去获取ceph的数据的方式有不少种,好比使用ceph-exporter是采集ceph集群数据的客户端程序运的,在nautilus版本中能够直接开启这个进程,开启以后就会自动的将数据拿到,而后经过prometheus进行收集起来,再经过grafana将ceph的图形展现出来
这个在ceph管理节点开启
# ceph mgr module enable prometheus # netstat -nltp | grep mgr 检查端口 tcp 0 0 0.0.0.0:6800 0.0.0.0:* LISTEN 10311/ceph-mgr tcp 0 0 0.0.0.0:6801 0.0.0.0:* LISTEN 10311/ceph-mgr tcp 0 0 192.168.1.10:6800 192.168.1.10:45594 ESTABLISHED 10311/ceph-mgr tcp 0 0 192.168.1.10:6800 192.168.1.11:51040 ESTABLISHED 10311/ceph-mgr tcp 0 0 192.168.1.10:6800 192.168.1.11:51044 ESTABLISHED 10311/ceph-mgr tcp 0 0 192.168.1.10:6800 192.168.1.10:45602 ESTABLISHED 10311/ceph-mgr tcp 0 0 192.168.1.10:6800 192.168.1.10:45600 ESTABLISHED 10311/ceph-mgr tcp 0 0 192.168.1.10:6800 192.168.1.11:51042 ESTABLISHED 10311/ceph-mgr tcp 0 0 192.168.1.10:6800 192.168.1.12:60668 ESTABLISHED 10311/ceph-mgr tcp 0 0 192.168.1.10:6800 192.168.1.12:60666 ESTABLISHED 10311/ceph-mgr tcp 0 0 192.168.1.10:45600 192.168.1.10:6800 ESTABLISHED 10311/ceph-mgr tcp 0 0 192.168.1.10:6800 192.168.1.11:51038 ESTABLISHED 10311/ceph-mgr tcp 0 0 192.168.1.10:6800 192.168.1.12:60670 ESTABLISHED 10311/ceph-mgr tcp 0 0 192.168.1.10:33400 192.168.1.10:3300 ESTABLISHED 10311/ceph-mgr tcp 0 0 192.168.1.10:6800 192.168.1.10:45598 ESTABLISHED 10311/ceph-mgr tcp 0 0 192.168.1.10:6800 192.168.1.10:45596 ESTABLISHED 10311/ceph-mgr tcp 0 0 192.168.1.10:6800 192.168.1.12:60672 ESTABLISHED 10311/ceph-mgr tcp 0 0 192.168.1.10:6800 192.168.1.10:45592 ESTABLISHED 10311/ceph-mgr tcp6 0 0 :::9283 :::* LISTEN 10311/ceph-mgr tcp6 0 0 192.168.1.10:9283 192.168.1.15:22202 ESTABLISHED 10311/ceph-mgr # curl 192.168.1.10:9283/metrics 测试返回值
查看数据已经被prometheus收集到,并显示为UP状态
1)、浏览器登陆 grafana 管理界面
2)、添加data sources,点击configuration--》data sources
3)、grafana官方提供了不少的模版
https://grafana.com/grafana/dashboards
4)、搜索ceph的dashboard ,这里我选择的是2842这个模版,这个主要是监控集群
5.一、监控Ceph-cluster集群
五、import导入
这样就监控到咱们的ceph集群的状态了,并能够看到ceph的pools、OSD等相关数据
5.二、监控OSD,模版编号5336
5.三、监控POOLS ,监控模版编号5342
import导入模版