天天看點

openstack之dashboard與cinder(一)

  dashboard必備的是nova neutron glance keystone其他的服務可以先安裝,但是不能提前注冊,

否則dashboard打不開,比如cinder提前注冊了,dashboard啟動後看到cinder注冊的東西了,

就會連接配接cinder,但是cinder你還沒配置好,是以dashboard就無法啟動了。

herizon隻需要連接配接到keystone就行了,herizion登入也是用的keystone認證的使用者

安裝:    

yum install openstack-dashboard -y

配置:

vim /etc/openstack-dashboard/local_settings

29 ALLOWED_HOSTS = ['*',]                       #允許哪些主機連接配接

103 SECRET_KEY='30110465420bb59687ce'           #預設的沒有修改

108 CACHES = {                                 #memcache緩存的配置

109     'default': {

110         'BACKEND': 'django.core.cache. backends.memcached. MemcachedCache',

111         'LOCATION': '192.168.56.11:11211',

112     }

113 }

138 OPENSTACK_HOST = "192.168.56.11"           #keystone主機所在位置

140 OPENSTACK_KEYSTONE_DEFAULT_ROLE = "user"  #使用keystone預設哪個角色

320 TIME_ZONE = "Asia/Shanghai"                 #時區設定

重新開機httpd服務

systemctl restart httpd

使用demo使用者demo密碼登入

遇到的故障:dashboard無法啟動,現象:重新開機httpd後,把keystone服務擠掉,注釋掉/etc/httpd/conf.d/openstack-dashboard.conf 之後

再次啟動httpd服務,keystone恢複正常

最後解決:把keystone安裝在另外一台機器上就可以了,(注意修改連接配接memcache和keystone的主機IP)

1塊存儲:硬碟 LVS DAS(直連式存儲)SAN存儲(FC-SAN IP-SAN)

2檔案存儲: NFS nas

3對象存儲:分布式存儲(ceph PB級)

分布式存儲:ceph

cinder:提供雲硬碟,雲硬碟的瓶頸為網絡

元件介紹:

cinder-api:接受API請求并将請求路由到 cinder-volume 來執行。 (作用類似nova-api的)

cinder-volume:響應請求,讀取或寫向塊存儲資料庫為維護狀态,通過資訊隊列機制與其他程序互動,

或直接與上層塊存儲提供的硬體或軟體進行互動。通過驅動結構,他可以與衆多的存儲提供者進行互動。

 可以有多個。(作用類似nova-compute)

cinder-scheduler:守護程序,為存儲卷的執行個體選取最優的塊存儲供應節點。(類似于nova-scheduler)

基于三個元件的作用劃分,通常我們将

    cinder-api和cinder-shceduler 安裝在控制節點上,

把  cinder-volume安裝在存儲節點上。(本次實驗安裝在計算節點的一塊單獨的硬碟上)

控制節點上:

yum install openstack-cinder python-cinderclient -y

同步資料庫:

确認是否同步成功

+----------------------------+

| Tables_in_cinder           |

| backups                    |

| cgsnapshots                |

| consistencygroups          |

| driver_initiator_data      |

| encryption                 |

| image_volume_cache_entries |

| iscsi_targets              |

| migrate_version            |

| quality_of_service_specs   |

| quota_classes              |

| quota_usages               |

| quotas                     |

| reservations               |

| services                   |

| snapshot_metadata          |

| snapshots                  |

| transfers                  |

| volume_admin_metadata      |

| volume_attachment          |

| volume_glance_metadata     |

| volume_metadata            |

| volume_type_extra_specs    |

| volume_type_projects       |

| volume_types               |

| volumes                    |

User Password:cinder

Repeat User Password:cinder

+-----------+----------------------------------+

| Field     | Value                            |

| domain_id | default                          |

| enabled   | True                             |

| id        | b47cb3f352b0462fb2939fc5b536a1a2 |

| name      | cinder                           |

2294 rpc_backend = rabbit

2640 [keystone_authtoken]

2643 auth_plugin = password

2644 project_domain_id = default

2645 user_domain_id = default

2646 project_name = service

2647 username = cinder

2648 password = cinder

Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-cinder-api.service to /usr/lib/systemd/system/openstack-cinder-api.service.

Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-cinder-scheduler.service to /usr/lib/systemd/system/openstack-cinder-scheduler.service.

建立服務:

>   --description "OpenStack Block Storage" volume

+-------------+----------------------------------+

| Field       | Value                            |

| description | OpenStack Block Storage          |

| enabled     | True                             |

| id          | b069f3ddf10849729a7e24ba9598b16e |

| name        | cinder                           |

| type        | volume                           |

>   --description "OpenStack Block Storage" volumev2

| id          | f54356c5dfad4d6db666a1e0361e19cd |

| name        | cinderv2                         |

| type        | volumev2                         |

+--------------+--------------------------------------------+

| Field        | Value                                      |

| enabled      | True                                       |

| id           | 16c0b5acb8f4471ea2b81a3a34c8c337           |

| interface    | public                                     |

| region       | RegionOne                                  |

| region_id    | RegionOne                                  |

| service_id   | b069f3ddf10849729a7e24ba9598b16e           |

| service_name | cinder                                     |

| service_type | volume                                     |

 +--------------+--------------------------------------------+

| id           | 9e07046c6464478391c3c741529194e8           |

| interface    | internal                                   |

| id           | d7c455a939fc4b0d975ab2ba7745f397           |

| interface    | admin                                      |

| id           | 534741eb6c2040679f1638d14f7907cb           |

| service_id   | f54356c5dfad4d6db666a1e0361e19cd           |

| service_name | cinderv2                                   |

| service_type | volumev2                                   |

| id           | bf6f8b54a999495e8e912f8722b03081           |

| id           | d5d8c3b07f77441980a39d961bef6ad7           |

1:[DEFAULT]

421:glance_host = 192.168.56.11

536:auth_strategy = keystone

2294:rpc_backend = rabbit

2371:[BRCD_FABRIC_EXAMPLE]

2404:[CISCO_FABRIC_EXAMPLE]

2437:[cors]

2465:[cors.subdomain]

2493:[database]

2593:[fc-zone-manager]

2621:[keymgr]

2640:[keystone_authtoken]

2643:auth_plugin = password

2644:project_domain_id = default

2645:user_domain_id = default

2646:project_name = service

2647:username = cinder

2648:password = cinder

2811:[matchmaker_redis]

2840:[matchmaker_ring]

2859:[oslo_concurrency]

2874:lock_path = /var/lib/cinder/tmp

2877:[oslo_messaging_amqp]

2976:[oslo_messaging_qpid]

3119:[oslo_messaging_rabbit]

3173:rabbit_host = 192.168.56.11

3177:rabbit_port = 5672

3189:rabbit_userid = openstack

3193:rabbit_password = openstack

3348:[oslo_middleware]

3369:[oslo_policy]

3394:[oslo_reports]

3404:[profiler]

存儲節點:

添加一塊50G的硬碟

Disk /dev/sdb: 53.7 GB, 53687091200 bytes, 104857600 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/sda: 32.2 GB, 32212254720 bytes, 62914560 sectors

Disk label type: dos

Disk identifier: 0x000bbf7d

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *        2048     2099199     1048576   83  Linux

/dev/sda2         2099200    35653631    16777216   82  Linux swap / Solaris

/dev/sda3        35653632    62914559    13630464   83  Linux

  Physical volume "/dev/sdb" successfully created

  Volume group "cinder-volumes" successfully created

540:enabled_backends = lvm

3414:[lvm]

3415:volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver

3416:volume_group = cinder-volumes

3417:iscsi_protocol = iscsi

3418:iscsi_helper = lioadm

Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-cinder-volume.service to /usr/lib/systemd/system/openstack-cinder-volume.service.

Created symlink from /etc/systemd/system/multi-user.target.wants/target.service to /usr/lib/systemd/system/target.service.

     本文轉自陳繼松 51CTO部落格,原文連結:http://blog.51cto.com/chenjisong/1735899,如需轉載請自行聯系原作者