行业知识
Openstack云计算(六)Openstack环境对接ceph
一、实施步骤:
(1)客���端也要有cent用户:
useradd cent && echo "123" | passwd --stdin centecho -e 'Defaults:cent !requiretty\ncent ALL = (root) NOPASSWD:ALL' | tee /etc/sudoers.d/cephchmod 440 /etc/sudoers.d/ceph
(2)openstack要用ceph的节点(比如compute-node和storage-node)安装下载的软件包:
yum localinstall ./* -y
或则:每个节点安装 clients(要访问ceph集群的节点):
yum install python-rbdyum install ceph-common如果先采用上面的方式安装客户端,其实这两个包在rpm包中早已经安装过了
(3)部署节点上执行,为openstack节点安装ceph:
ceph-deploy install controllerceph-deploy admin controller
(4)客户端执行
sudo chmod 644 /etc/ceph/ceph.client.admin.keyring
| 1 |
(5)create pools,只需在一个ceph节点上操作即可:
ceph osd pool create images 1024ceph osd pool create vms 1024ceph osd pool create volumes 1024
显示pool的状态
ceph osd lspools
(6)在ceph集群中,创建glance和cinder用户, 只需在一个ceph节点上操作即可:
ceph auth get-or-create client.glance mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=images'ceph auth get-or-create client.cinder mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=volumes, allow rwx pool=vms, allow rx pool=images'nova使用cinder用户,就不单独创建了
(7)拷贝ceph-ring, 只需在一个ceph节点上操作即可:
| 1 2 | ceph auth get-or-create client.glance > /etc/ceph/ceph.client.glance.keyring ceph auth get-or-create client.cinder > /etc/ceph/ceph.client.cinder.keyring |
使用scp拷贝到其他节点(ceph集群节点和openstack的要用ceph的节点比如compute-node和storage-node,本次对接的是一个all-in-one的环境,所以copy到controller节点即可 )
| 1 2 3 4 | [root@yunwei ceph]# ls ceph.client.admin.keyring ceph.client.cinder.keyring ceph.client.glance.keyring ceph.conf rbdmap tmpR3uL7W [root@yunwei ceph]# [root@yunwei ceph]# scp ceph.client.glance.keyring ceph.client.cinder.keyring controller:/etc/ceph/ |
(8)更改文件的权限(所有客户端节点均执行)
| 1 2 | chown glance:glance /etc/ceph/ceph.client.glance.keyring chown cinder:cinder /etc/ceph/ceph.client.cinder.keyring |
(9)更改libvirt权限(只需在nova-compute节点上操作即可,每个计算节点都做)
uuidgen940f0485-e206-4b49-b878-dcd0cb9c70a4在/etc/ceph/目录下(在什么目录没有影响,放到/etc/ceph目录方便管理):cat > secret.xml