Docs/存储/ceph/p版本安装/7-添加ceph节点.md

37 lines
No EOL
1.4 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

> 将ceph镜像导出到其他ceph节点上
```shell
# docker images  |grep -v "REPOSITORY" |awk '{print $1":"$2}' |xargs docker save -o ceph-images.tar
# for i in {2..5};do scp ceph-images.tar ceph0$i:/root/;done
## 在ceph02-05上导入镜像
# docker load -i ceph-images.tar
```
>
> 将ceph.pub公钥拷贝到其他ceph节点
```shell
# ssh-copy-id -f -i /etc/ceph/ceph.pub ceph02
# ssh-copy-id -f -i /etc/ceph/ceph.pub ceph03
# ssh-copy-id -f -i /etc/ceph/ceph.pub ceph04
# ssh-copy-id -f -i /etc/ceph/ceph.pub ceph05
## 也可以用以下命令拷贝在ceph01上操作
# for i in {2..5};do ssh-copy-id -f -i /etc/ceph/ceph.pub ceph0$i;done
```
> 使用cephadm将主机添加到存储集群中,执行添加节点命令后会在目标节点拉到ceph/node-exporter镜像需要一定时间所以可提前在节点上将镜像导入。
```shell
# cephadm shell ceph orch host add ceph02 192.168.59.242 --labels=mon,mgr
# ceph orch host add ceph03 192.168.59.243 --labels=mon
# ceph orch host add ceph04 192.168.59.244
# ceph orch host add ceph05 192.168.59.245
```
> 查看加入到集群的节点
```shell
# ceph orch host ls
HOST    ADDR            LABELS   STATUS  
ceph01  192.168.59.241  _admin          
ceph02  192.168.59.242  mon mgr          
ceph03  192.168.59.243  mon              
ceph04  192.168.59.244                  
ceph05  192.168.59.245                  
5 hosts in cluster
```