Openstack I版部署安装(四)
配置Cinder块设备存储
安装cinder组件1
yum install openstack-cinder -y
备份cinder配置文件1
mv /etc/cinder/cinder.conf /etc/cinder/cinder.conf.bak
创建cinder配置文件
vi /etc/cinder/cinder.conf
注意rbd_secret_uuid为前面实际创建的值,笔者的环境中是: AQCEWRpVGDOsCBAAuGIEzp/FkCc6KPQSaFGAbw==
1 | [DEFAULT] |
修改cinder配置文件权限1
chown -R root:cinder /etc/cinder/cinder.conf
同步导入cinder数据库表1
su -s /bin/sh -c "cinder-manage db sync" cinder
创建cinder用户、角色、端点服务1
2
3
4
5
6
7
8
9
10
11
12
13
14keystone user-create --name=cinder --pass=CINDER_PASS --email=cinder@example.com
keystone user-role-add --user=cinder --tenant=service --role=admin
keystone service-create --name=cinder --type=volume --description="OpenStack Block Storage"
keystone endpoint-create \
--service-id=$(keystone service-list | awk '/ volume / {print $2}') \
--publicurl=http://controller:8776/v1/%\(tenant_id\)s \
--internalurl=http://controller:8776/v1/%\(tenant_id\)s \
--adminurl=http://controller:8776/v1/%\(tenant_id\)s
keystone service-create --name=cinderv2 --type=volumev2 --description="OpenStack Block Storage v2"
keystone endpoint-create \
--service-id=$(keystone service-list | awk '/ volumev2 / {print $2}') \
--publicurl=http://controller:8776/v2/%\(tenant_id\)s \
--internalurl=http://controller:8776/v2/%\(tenant_id\)s \
--adminurl=http://controller:8776/v2/%\(tenant_id\)s
修改volumes的cephx密钥权限1
chown -R cinder:cinder /etc/ceph/ceph.client.volumes.keyring
启动cinder相关服务1
2
3
4
5
6service openstack-cinder-api start
service openstack-cinder-scheduler start
service openstack-cinder-volume start
chkconfig openstack-cinder-api on
chkconfig openstack-cinder-scheduler on
chkconfig openstack-cinder-volume on
Cinder创建volume硬盘卷验证
1 | [root@controller ~]# cinder create --display-name test 1 |
配置Dashboard门户服务
安装dashboard组件1
yum install memcached python-memcached mod_wsgi openstack-dashboard -y
修改dashboard配置
vi /etc/openstack-dashboard/local_settings
修改CACHES部分1
2
3
4
5
6CACHES = {
'default': {
'BACKEND':'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION' : '127.0.0.1:11211'
}
}
修改可允许访问的主机名称1
ALLOWED_HOSTS = ['localhost', 'controller', '10.0.0.11']
修改openstack主机名1
OPENSTACK_HOST = "controller"
启动apache服务,分布式缓存服务1
2
3
4
5setsebool -P httpd_can_network_connect on
service httpd start
service memcached start
chkconfig httpd on
chkconfig memcached on
Dashboard用户web访问
浏览器访问 http://10.0.0.11/dashboard (建议使用chrome 或者 firefox)
login: admin
password: ADMIN_PASS