ceph添加mon节点

管理员

查看集群

[root@node1 ceph]# ceph -s
  cluster:
    id:     ad851f5e-edcd-4de6-938a-6f67807da979
    health: HEALTH_OK
 
  services:
    mon: 2 daemons, quorum node2,node1
    mgr: node1(active)
    osd: 8 osds: 6 up, 6 in
 
  data:
    pools:   0 pools, 0 pgs
    objects: 0  objects, 0 B
    usage:   6.0 GiB used, 294 GiB / 300 GiB avail
    pgs: 

以下操作在要添加monitor节点node3上执行

一、导出monitor的密钥

ceph auth get mon. -o /tmp/keyring

二、监视图

ceph mon getmap -o /tmp/mapfile

三、导入密钥和监视图

ceph-mon -i  node3 --mkfs --monmap /tmp/mapfile --keyring /tmp/keyring

四、声明地址

ceph-mon -i node3 --public-addr 192.168.20.151

五、查看是否添加到monitor里

[root@node1 ceph]# ceph mon dump
dumped monmap epoch 3
epoch 3
fsid ad851f5e-edcd-4de6-938a-6f67807da979
last_changed 2023-01-12 21:56:10.532790
created 2023-01-12 04:41:46.784010
0: 192.168.20.151:6789/0 mon.node3
1: 192.168.20.165:6789/0 mon.node2
2: 192.168.21.5:6789/0 mon.node1

查看集群

[root@node1 ceph]# ceph mon stat
e3: 3 mons at {node1=192.168.21.5:6789/0,node2=192.168.20.165:6789/0,node3=192.168.20.151:6789/0}, election epoch 18, leader 0 node3, quorum 0,1,2 node3,node2,node1
[root@node1 ceph]# ceph -s
  cluster:
    id:     ad851f5e-edcd-4de6-938a-6f67807da979
    health: HEALTH_OK
 
  services:
    mon: 3 daemons, quorum node3,node2,node1
    mgr: node1(active)
    osd: 8 osds: 6 up, 6 in
 
  data:
    pools:   0 pools, 0 pgs
    objects: 0  objects, 0 B
    usage:   6.0 GiB used, 294 GiB / 300 GiB avail
    pgs: