OpenStack安装ceph
一、安装前准备
1.安装Centos
https://mirrors.aliyun.com/centos/8-stream/isos/x86_64/
2.安装VMvare
参考其他教程
3.安装OpenStack-Yoga版本
参考其他教程
二、安装过程
1.修改hostname(根据自己需要,非强制性的)
hostnamectl set-hostname kyc
2.关闭防火墙和selinux
systemctl disable --now firewalld
setenforce 0
sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
3.配置时间同步
yum install -y chrony
systemctl enable --now chronyd
4.安装Cephadm
参考官方文档:Installing Ceph — Ceph Documentation
文档推荐了两种,任选一种:
1 | dnf install --assumeyes centos-release-ceph-pacific.noarch
2 | dnf install --assumeyes cephadm
5.引导集群
5.1查询本机的ip
ip -a
5.2然后使用如下命令:
cephadm bootstrap --mon-ip *<mon-ip>*
注意:将**中的内容更换为自己的ip地址
例如,我的IP是172.20.136.196
cephadm bootstrap --mon-ip 172.20.136.196
界面会显示如下内容:
5.3根据图中URL所显示的端口:8443,通过浏览器进行访问:
https://172.20.136.196:8443/
5.4使用图中URL的下方显示的登录界面的账号和密码User和Password,进行登录,注意:第一次登录会要求改密码,进去之后的界面如图所示:
6.安装Ceph-common软件包
cephadm install ceph-common
7.添加OSD
第一种:告诉Ceph使用任何可用和未使用的存储设备:
ceph orch apply osd --all-available-devices
第二种:特定主机上特定设备创建OSD
首先查询当前的情况:
cephadm shell ceph orch device ls
接着在特定主机上特定设备创建OSD:
cephadm shell ceph orch daemon add osd kyc:/dev/sdb
其中:kyc是hostname
dev/sdb可进行查询本地的机器
fdisk -l
8.最后,使用命令查询Ceph的状态
ceph -s