安装ceph部署工具cephadm
dnf install -y cephadm
安装ceph命令:
dnf install -y ceph-common
使用cephadm安装ceph
cephadm bootstrap --mon-ip 192.168.10.0 --allow-overwrite --cluster-network 192.168.100.0/23
#部署完成后有admin密码信息,需保存,登录ceph页面使用
设置免密登陆
ssh-keygen -t rsa
ssh-copy-id Ceph101
ssh-copy-id Ceph102
ssh-copy-id Ceph103
ssh-copy-id -f -i /etc/ceph/ceph.pub root@Ceph101
ssh-copy-id -f -i /etc/ceph/ceph.pub root@Ceph102
ssh-copy-id -f -i /etc/ceph/ceph.pub root@Ceph103
添加Ceph节点
ceph orch host add Ceph101 192.168.10.101 mon
ceph orch host add Ceph102 192.168.10.102 mon
ceph orch host add Ceph103 192.168.10.103
开启自动添加osd
ceph orch apply osd --all-available-devices
节点没添加成功的话,使用此命令添加:
ceph orch daemon reconfig node-exporter. Ceph103
配置ceph
ceph osd pool create volumes
ceph osd pool create images
ceph osd pool create backups
ceph osd pool create vms
rbd pool init volumes
rbd pool init images
rbd pool init backups
rbd pool init vms
OpenStack集群Ceph配置
将ceph.conf配置文件复制到OpenStack部署机的目录下
ssh kollatest sudo tee /etc/kolla/config/ceph.conf </etc/ceph/ceph.conf
注意调整ceph.conf文件的格式,开头不能有tab和空格,在末尾追加三条配置
auth_cluster_required = cephx
auth_service_required = cephx
auth_client_required = cephx
创建glance、cinder的keyring认证文件
ceph auth get-or-create client.glance mon 'profile rbd' osd 'profile rbd pool=images' mgr 'profile rbd pool=images' -o /etc/ceph/ceph.client.glance.keyring
ceph auth get-or-create client.cinder mon 'profile rbd' osd 'profile rbd pool=volumes, profile rbd pool=vms, profile rbd-read-only pool=images' mgr 'profile rbd pool=volumes, profile rbd pool=vms' -o /etc/ceph/ceph.client.cinder.keyring
ceph auth get-or-create client.cinder-backup mon 'profile rbd' osd 'profile rbd pool=backups' mgr 'profile rbd pool=backups' -o /etc/ceph/ceph.client.cinder-backup.keyring
将认证文件同步到部署机的对应目录下(部署机)
ceph auth get-or-create client.glance | ssh kollatest sudo tee /etc/kolla/config/glance/ceph.client.glance.keyring
ceph auth get-or-create client.cinder | ssh kollatest sudo tee /etc/kolla/config/cinder/cinder-volume/ceph.client.cinder.keyring
ceph auth get-or-create client.cinder | ssh kollatest sudo tee /etc/kolla/config/nova/ceph.client.cinder.keyring
ceph auth get-or-create client.cinder | ssh kollatest sudo tee /etc/kolla/config/cinder/cinder-backup/ceph.client.cinder.keyring
ceph auth get-or-create client.cinder-backup | ssh kollatest sudo tee /etc/kolla/config/cinder/cinder-backup/ceph.client.cinder-backup.keyring
Ceph部署完成,执行kolla-ansible部署OpenStack即可