Openstack I版 结合 Ceph 分布式存储 部署安装(四)

来源:互联网 发布:c语言高级编程 pdf 编辑:程序博客网 时间:2024/04/27 17:53

配置Cinder块设备存储

安装cinder组件

yum install openstack-cinder -y

备份cinder配置文件

mv /etc/cinder/cinder.conf /etc/cinder/cinder.conf.bak

创建cinder配置文件
vi /etc/cinder/cinder.conf

注意rbd_secret_uuid为前面实际创建的值,笔者的环境中是: AQCEWRpVGDOsCBAAuGIEzp/FkCc6KPQSaFGAbw==

[DEFAULT]auth_strategy = keystonerpc_backend = cinder.openstack.common.rpc.impl_qpidqpid_hostname = controllervolume_driver=cinder.volume.drivers.rbd.RBDDriverrbd_pool=volumesrbd_ceph_conf=/etc/ceph/ceph.confrbd_flatten_volume_from_snapshot=falserbd_max_clone_depth=5glance_api_version=2rbd_user=volumesrbd_secret_uuid= AQDEgllUyAslLxAAvExrAIZWzUOPHQk6M7GUgg==[BRCD_FABRIC_EXAMPLE]   [database]connection = mysql://cinder:CINDER_DBPASS@controller/cinder[fc-zone-manager][keymgr][keystone_authtoken]auth_uri = http://controller:5000auth_host = controllerauth_protocol = httpauth_port = 35357admin_user = cinderadmin_tenant_name = serviceadmin_password = CINDER_PASS[matchmaker_ring][ssl]

修改cinder配置文件权限

chown -R root:cinder /etc/cinder/cinder.conf

同步导入cinder数据库表

su -s /bin/sh -c "cinder-manage db sync" cinder

创建cinder用户、角色、端点服务

keystone user-create --name=cinder --pass=CINDER_PASS --email=cinder@example.comkeystone user-role-add --user=cinder --tenant=service --role=adminkeystone 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\)skeystone 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密钥权限

chown -R cinder:cinder /etc/ceph/ceph.client.volumes.keyring

启动cinder相关服务

service openstack-cinder-api startservice openstack-cinder-scheduler startservice openstack-cinder-volume startchkconfig openstack-cinder-api onchkconfig openstack-cinder-scheduler onchkconfig openstack-cinder-volume on

Cinder创建volume硬盘卷验证

[root@controller ~]# cinder create --display-name test 1+---------------------+--------------------------------------+|       Property      |                Value                 |+---------------------+--------------------------------------+|     attachments     |                  []                  ||  availability_zone  |                 nova                 ||       bootable      |                false                 ||      created_at     |      2015-04-02T03:43:16.194522      || display_description |                 None                 ||     display_name    |                 test                 ||      encrypted      |                False                 ||          id         | d6b816e1-1dcc-4f37-9bad-9d3581834233 ||       metadata      |                  {}                  ||         size        |                  1                   ||     snapshot_id     |                 None                 ||     source_volid    |                 None                 ||        status       |               creating               ||     volume_type     |                 None                 |+---------------------+--------------------------------------+[root@controller ~]# cinder list+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+|                  ID                  |   Status  | Display Name | Size | Volume Type | Bootable | Attached to |+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+| d6b816e1-1dcc-4f37-9bad-9d3581834233 | available |     test     |  1   |     None    |  false   |             |+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+

配置Dashboard门户服务

安装dashboard组件

yum install memcached python-memcached mod_wsgi openstack-dashboard -y

修改dashboard配置

vi /etc/openstack-dashboard/local_settings

修改CACHES部分

CACHES = {    'default': {        'BACKEND':'django.core.cache.backends.memcached.MemcachedCache',        'LOCATION' : '127.0.0.1:11211'    }}

修改可允许访问的主机名称

ALLOWED_HOSTS = ['localhost', 'controller', '10.0.0.11']

修改openstack主机名

OPENSTACK_HOST = "controller"

启动apache服务,分布式缓存服务

setsebool -P httpd_can_network_connect onservice httpd startservice memcached startchkconfig httpd onchkconfig memcached on

Dashboard用户web访问

浏览器访问 http://10.0.0.11/dashboard (建议使用chrome firefox)
login: admin
password: ADMIN_PASS

0 0
原创粉丝点击