环境说明
IP | 主机名 | 角色 | 存储设备 |
192.168.2.100 | master100 | mon,mgr,osd,mds,rgw | 大于5G的空设备 |
192.168.2.101 | node101 | mon,mgr,osd,mds,rgw | 大于5G的空设备 |
192.168.2.102 | node102 | mon,mgr,osd,mds,rgw | 大于5G的空设备 |
关闭防火墙
关闭并且禁用selinux
配置主机名/etc/hosts
配置ssh免密登录
配置时间同步chrony
安装docker服务
配置ceph国内镜像 (ubuntu server 20.04)
wget -q -O- 'https://mirrors.aliyun.com/ceph/keys/release.asc' | apt-key add -
apt-add-repository 'deb https://mirrors.aliyun.com/ceph/debian-quincy/ focal main'
apt update
参考Get Packages — Ceph Documentation
安装cephadm
curl https://ghproxy.com/https://raw.githubusercontent.com/ceph/ceph/quincy/src/cephadm/cephadm -o cephadm
chmod +x cephadm
./cephadm add-repo --release quincy
./cephadm install ceph-common ceph
./cephadm install
which cephadm
which ceph
初始化ceph集群
cephadm bootstrap --mon-ip 192.168.2.100
添加新节点
ssh-copy-id -f -i /etc/ceph/ceph.pub root@node101
ssh-copy-id -f -i /etc/ceph/ceph.pub root@node102
ceph orch host add node101 或 ceph orch host add node101 192.168.2.101
ceph orch host add node102 或 ceph orch host add node102 192.168.2.102
ceph orch host ls
部署MON
ceph orch apply mon master100,node101,node102
部署OSD
查看可用的存储设备
ceph orch device ls
方式1: 让ceph使用所有可用的存储设备
ceph orch apply osd --all-available-devices
方式2:手工添加存储设备
ceph orch daemon add osd master100:/dev/sdb
ceph orch daemon add osd node101:/dev/sdb
ceph orch daemon add osd node102:/dev/sdb
部署mds
ceph orch apply mds cephfs --placement=”3 master100 node101 node102”
部署rgw
ceph orch apply rgw myrealm myzone --placement=”3 master100 node101 node102”
部署mgr
ceph orch apply mgr master100,node101,node102
查看状态
访问ceph dashboard
https://192.168.2.100:8443