Ceph 的监控可视化界面方案很多----grafana、Kraken。但是从Luminous开始,Ceph 提供了原生的Dashboard功能,通过Dashboard可以获取Ceph集群的各种基本状态信息。
1.查看ceph状态
[root@controller ~]# ceph -s
cluster:
id: 25dae5c3-3fa7-44a4-9f35-7f0b288e26c9
health: HEALTH_OK
services:
mon: 3 daemons, quorum node1,node2,node3
mgr: node1(active), standbys: node2, node3
mds: cephfs-1/1/1 up {0=node1=up:active}
osd: 3 osds: 2 up, 2 in
rgw: 2 daemons active
data:
pools: 7 pools, 168 pgs
objects: 257 objects, 136 MiB
usage: 2.3 GiB used, 7.7 GiB / 10 GiB avail
pgs: 168 active+clean
2.启用
[root@controller ~]# ceph mgr module enable dashboard
[root@controller ~]# ceph-deploy mgr create node1
[root@controller ~]# ceph mgr module enable dashboard
3.生成并安装一个 自签名证书
[root@node1 ~]# ceph dashboard create-self-signed-cert
Self-signed certificate created
4.生成密钥,生成两个文件----dashboard.crt dashboard.key
mkdir mgr-dashboard
cd mgr-dashboard
openssl req -new -nodes -x509 -subj "/O=IT/CN=ceph-mgr-dashboard" -days 3650 -keyout dashboard.key -out dashboard.crt -extensions v3_ca
5.配置服务地址、端口,默认的端口是8443
[root@node1 mgr-dashboard]# ceph config set mgr mgr/dashboard/server_addr 192.168.236.131
[root@node1 mgr-dashboard]# ceph config set mgr mgr/dashboard/server_port 8443
[root@node1 mgr-dashboard]# ceph mgr services
{
"dashboard": "https://node1:8443/"
}
6.创建一个用户、密码
[root@node1 mgr-dashboard]# ceph dashboard set-login-credentials admin admin
7.重启
[root@node1 ~]# systemctl restart ceph-mgr@node1
8.访问:https://ip:8443
---------------------------------------------------------------------------------------------------------------------------------------------------------
2020.07.15 ceph升级到nautilus版本,dashboard新版也试用几个月,变化比较大,界面内容也丰富了许多。
2020.09.16 之前忘记说明,nautilus版需要在所有mgr节点安装 ceph-mgr-dashboard,然后开启dashboard。
yum install -y ceph-mgr-dashboard
查看是否已安装module:
ceph mgr module ls |grep dashboard
参考方案:
1.http://docs.ceph.com/docs/master/mgr/dashboard/
2.http://www.yangguanjun.com/2018/09/15/ceph-mimic-dashboard-intro/