目前kolla官方最新的版本已经废弃ceph的部署,不过之前的Kolla版本还是支持。最后一个版本支持部署ceph的为Openstack-Train。那就使用T版本的ceph镜像进行部署。
本次部署的ceph使用bluestore类型的存储。关于filestore和bluestore的区别,就在于写到磁盘的次数,filestore有journal存储,每次数据先写到此磁盘中,然后再写到数据库,并且还有文件系统 ,所以此方式对于连续写的集群来说,性能不佳。使用bluestore后,数据直接落盘,不存在写入到文件系统。其中blustore还有不同空间的使用,slow:慢速空间,直接存储数据,一般使用机械盘;db:高速空间,存储元数据,一般使用ssd盘;wal:超高速空间,存储集群日志,一般使用NVMe ssd 或NVRAM 时延小的SSD盘。
具体步骤如下
1 设置磁盘label
注:此步最重要,如果标签没有打对,后续部署可能会出错。
本集群使用三台虚拟机模拟,每一台机器上面有五块盘,三块盘做slow空间,一块盘做db空间,一块盘做wal空间。
[root@node01 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 100G 0 disk
├─sda1 8:1 0 1G 0 part /boot
├─sda2 8:2 0 49G 0 part
│ ├─centos-root 253:0 0 97G 0 lvm /
│ └─centos-swap 253:1 0 2G 0 lvm
└─sda3 8:3 0 50G 0 part
└─centos-root 253:0 0 97G 0 lvm /
sdb 8:16 0 20G 0 disk
sdc 8:32 0 20G 0 disk
sdd 8:48 0 20G 0 disk
sde 8:64 0 20G 0 disk
sdf 8:80 0 20G 0 disk
sr0 11:0 1 1024M 0 rom
使用ansible对三台机器行标签
此步为设置slow空间
先创建slow空间gpt分区
###sdb盘
[root@node01 ~]# ansible all -m shell -a "parted /dev/sdb -s -- mklabel gpt mkpart KOLLA_CEPH_OSD_BOOTSTRAP_BS_FOO1 1 100"
/usr/lib/python2.7/site-packages/ansible/parsing/vault/__init__.py:44: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release.
from cryptography.exceptions import InvalidSignature
node01 | SUCCESS | rc=0 >>
node03 | SUCCESS | rc=0 >>
node02 | SUCCESS | rc=0 >>
###sdc盘
[root@node01 ~]# ansible all -m shell -a "parted /dev/sdc -s -- mklabel gpt mkpart KOLLA_CEPH_OSD_BOOTSTRAP_BS_FOO2 1 100"
/usr/lib/python2.7/site-packages/ansible/parsing/vault/__init__.py:44: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release.
from cryptography.exceptions import InvalidSignature
node03 | SUCCESS | rc=0 >>
node01 | SUCCESS | rc=0 >>
node02 | SUCCESS | rc=0 >>
###sdd盘
[root@node01 ~]# ansible all -m shell -a "parted /dev/sdd -s -- mklabel gpt mkpart KOLLA_CEPH_OSD_BOOTSTRAP_BS_FOO3 1 100"
/usr/lib/python2.7/site-packages/ansible/parsing/vault/__init__.py:44: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release.
from cryptography.exceptions import InvalidSignature
node01 | SUCCESS | rc=0 >>
node02 | SUCCESS | rc=0 >>
node03 | SUCCESS | rc=0 >>
将此三块盘的剩余空间全部分配给slow空间
###sdb盘
[root@node01 ~]# ansible all -m shell -a "parted /dev/sdb -s mkpart KOLLA_CEPH_OSD_BOOTSTRAP_BS_FOO1_B 101 100%"