设为首页 收藏本站
查看: 1514|回复: 0

[经验分享] CentOS6.4安装OpenStack Icehouse controller (三)

[复制链接]

尚未签到

发表于 2015-4-13 08:18:01 | 显示全部楼层 |阅读模式
  CentOS6.4安装OpenStack Icehouse controller(二)

  

  OpenStack交流群:322596568
  
  *本文介绍Cinder、Swift的安装配置过程
  

  9.安装配置Cinder
  9.1.初始化Cinder
  (1).安装Cinder服务:
  [iyunv@openstack ~]# yum -y install openstack-cinder openstack-selinux
  (2).创建Cinder数据库:
  [iyunv@openstack ~]# openstack-db --init --service cinder  --rootpw passwd
  
  cinder default DB is not mysql. Would you like to reset to mysql now? (y/n): y
  Verified connectivity to MySQL.
  Creating 'cinder' database.
  Initializing the cinder database, please wait...
  /usr/lib64/python2.6/site-packages/Crypto/Util/number.py:57: PowmInsecureWarning: Not using mpz_powm_sec.  You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.
    _warn("Not using mpz_powm_sec.  You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.", PowmInsecureWarning)
  Complete!
  上述warning不影响数据库创建,也可以使用:
  
[iyunv@openstack ~]# su -s /bin/sh -c "cinder-manage db sync" cinder  创建cinder数据库。
  

  9.2.创建User,定义Services 和 API Endpoints
  (1).为cinder创建一个cinder用户:
  [iyunv@openstack ~]# keystone user-create --name=cinder --pass=service --email=cinder@chensh.net
  
  WARNING: Bypassing authentication using a token & endpoint (authentication credentials are being ignored).
  +----------+----------------------------------+
  | Property |              Value               |
  +----------+----------------------------------+
  |  email   |        cinder@chensh.net         |
  | enabled  |               True               |
  |    id    | f67dd31740ca4d0bbca4f673ffff85b0 |
  |   name   |              cinder              |
  | username |              cinder              |
  +----------+----------------------------------+
  [iyunv@openstack ~]# keystone user-role-add --user=cinder --tenant=service --role=admin
  WARNING: Bypassing authentication using a token & endpoint (authentication credentials are being ignored).
  (2).创建cinder服务,创建endpoint:
  [iyunv@openstack ~]# vi /root/config/cinder-user.sh
  
  #!/bin/sh
  my_ip=0.0.0.0
  keystone service-create --name=cinder --type=volume --description="OpenStack Block Storage"
  
  service=$(keystone service-list | awk '/volume/ {print $2}')
  keystone endpoint-create --service-id=$service --publicurl=http://$my_ip:8776/v1/%\(tenant_id\)s --internalurl=http://$my_ip:8776/v1/%\(tenant_id\)s --adminurl=http://$my_ip:8776/v1/%\(tenant_id\)s
  keystone service-create --name=cinder --type=volumev2 --description="OpenStack Block Storage V2"
  service=$(keystone service-list | awk '/volumev2/ {print $2}')
  keystone endpoint-create --service-id=$service --publicurl=http://$my_ip:8776/v2/%\(tenant_id\)s --internalurl=http://$my_ip:8776/v2/%\(tenant_id\)s --adminurl=http://$my_ip:8776/v2/%\(tenant_id\)s
  [iyunv@openstack ~]# sh /root/config/cinder-user.sh
  
WARNING: Bypassing authentication using a token & endpoint (authentication credentials are being ignored).
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |     OpenStack Block Storage      |
|   enabled   |               True               |
|      id     | f4f8a1e3ea104a689e6e11da53ed239d |
|     name    |              cinder              |
|     type    |              volume              |
+-------------+----------------------------------+
  WARNING: Bypassing authentication using a token & endpoint (authentication credentials are being ignored).
  +-------------+--------------------------------------+
  |   Property  |                Value                 |
  +-------------+--------------------------------------+
  |   adminurl  | http://0.0.0.0:8776/v1/%(tenant_id)s |
  |      id     |   6027a4a61f7f4acba13e52544ca53acb   |
  | internalurl | http://0.0.0.0:8776/v1/%(tenant_id)s |
  |  publicurl  | http://0.0.0.0:8776/v1/%(tenant_id)s |
  |    region   |              regionOne               |
  |  service_id |   f4f8a1e3ea104a689e6e11da53ed239d   |
  +-------------+--------------------------------------+
  
WARNING: Bypassing authentication using a token & endpoint (authentication credentials are being ignored).
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |    OpenStack Block Storage V2    |
|   enabled   |               True               |
|      id     | 5022d74ed60b4a79b0acef9e71e2fd9d |
|     name    |              cinder              |
|     type    |             volumev2             |
+-------------+----------------------------------+
  WARNING: Bypassing authentication using a token & endpoint (authentication credentials are being ignored).
  +-------------+--------------------------------------+
  |   Property  |                Value                 |
  +-------------+--------------------------------------+
  |   adminurl  | http://0.0.0.0:8776/v2/%(tenant_id)s |
  |      id     |   ddd42956b4e14e4abb427fdcb3e31b61   |
  | internalurl | http://0.0.0.0:8776/v2/%(tenant_id)s |
  |  publicurl  | http://0.0.0.0:8776/v2/%(tenant_id)s |
  |    region   |              regionOne               |
  |  service_id |   5022d74ed60b4a79b0acef9e71e2fd9d   |
  +-------------+--------------------------------------+
  9.3.配置Cinder服务
  (1).创建LVM分区
  [iyunv@openstack ~]# fdisk /dev/sdb
  [iyunv@openstack ~]# pvcreate /dev/sdb1
  [iyunv@openstack ~]# vgcreate cinder-volumes /dev/sdb1
  (2).修改Cinder配置文件
  [iyunv@openstack ~]# cp -av /etc/cinder/cinder.conf /etc/cinder/cinder.conf_bak
  [iyunv@openstack ~]# sed -i '/^#/d' /etc/cinder/cinder.conf
  [iyunv@openstack ~]# sed -i '/^$/d' /etc/cinder/cinder.conf
  [iyunv@openstack ~]# vi /etc/cinder/cinder.conf
  [DEFAULT]
  
  my_ip = 192.168.20.100
  #glance_host = controller
  #osapi_volume_listen = 192.168.20.100
  osapi_volume_listen = 0.0.0.0
  log_dir = /var/log/cinder
  state_path = /var/lib/cinder
  lock_path = /var/lib/cinder/tmp
  volumes_dir=/openstack/cinder/volumes
  iscsi_helper = tgtadm
  connection = mysql://cinder:cinder@localhost/cinder
  notification_driver = cinder.openstack.common.notifier.rpc_notifier
  control_exchange = cinder
  rpc_backend = cinder.openstack.common.rpc.impl_qpid
  qpid_hostname = 192.168.20.100
  auth_strategy = keystone
  [BRCD_FABRIC_EXAMPLE]
  [database]
  [fc-zone-manager]
  [keymgr]
  [keystone_authtoken]
  
  auth_uri = http://127.0.0.1:5000
  auth_host = 127.0.0.1
  auth_protocol = http
  auth_port = 35357
  admin_user = cinder
  admin_tenant_name = service
  admin_password = service
  [matchmaker_ring]
  [ssl]
  [iyunv@openstack ~]# cp -av /etc/cinder /openstack/
  (3).修改api-paste.ini配置文件
  [iyunv@openstack ~]# cp -av /etc/cinder/api-paste.ini /etc/cinder/api-paste.ini_bak
  [iyunv@openstack ~]# vi /etc/cinder/api-paste.ini
  #############
  # OpenStack #
  #############
  

  [composite:osapi_volume]
  use = call:cinder.api:root_app_factory
  /: apiversions
  /v1: openstack_volume_api_v1
  /v2: openstack_volume_api_v2
  

  [composite:openstack_volume_api_v1]
  use = call:cinder.api.middleware.auth:pipeline_factory
  noauth = request_id faultwrap sizelimit noauth apiv1
  keystone = request_id faultwrap sizelimit authtoken keystonecontext apiv1
  keystone_nolimit = request_id faultwrap sizelimit authtoken keystonecontext apiv1
  

  [composite:openstack_volume_api_v2]
  use = call:cinder.api.middleware.auth:pipeline_factory
  noauth = request_id faultwrap sizelimit noauth apiv2
  keystone = request_id faultwrap sizelimit authtoken keystonecontext apiv2
  keystone_nolimit = request_id faultwrap sizelimit authtoken keystonecontext apiv2
  

  [filter:request_id]
  paste.filter_factory = cinder.openstack.common.middleware.request_id:RequestIdMiddleware.factory
  

  [filter:faultwrap]
  paste.filter_factory = cinder.api.middleware.fault:FaultWrapper.factory
  

  [filter:noauth]
  paste.filter_factory = cinder.api.middleware.auth:NoAuthMiddleware.factory
  

  [filter:sizelimit]
  paste.filter_factory = cinder.api.middleware.sizelimit:RequestBodySizeLimiter.factory
  

  [app:apiv1]
  paste.app_factory = cinder.api.v1.router:APIRouter.factory
  

  [app:apiv2]
  paste.app_factory = cinder.api.v2.router:APIRouter.factory
  

  [pipeline:apiversions]
  pipeline = faultwrap osvolumeversionapp
  

  [app:osvolumeversionapp]
  paste.app_factory = cinder.api.versions:Versions.factory
  

  ##########
  # Shared #
  ##########
  

  [filter:keystonecontext]
  paste.filter_factory = cinder.api.middleware.auth:CinderKeystoneContext.factory
  

  [filter:authtoken]
  paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
  auth_host = 127.0.0.1
  auth_port = 35357
  auth_protocol = http
  admin_user = cinder
  admin_tenant_name = service
  admin_password = service
  (4).修改targets.conf配置文件
  [iyunv@openstack ~]# grep -q /openstack/cinder/volumes /etc/tgt/targets.conf || sed -i '1iinclude /openstack/cinder/volumes/*' /etc/tgt/targets.conf
  (5).启动服务:
  
  [iyunv@openstack ~]# service tgtd start
  [iyunv@openstack ~]# chkconfig tgtd on
  [iyunv@openstack ~]# service openstack-cinder-api start
  [iyunv@openstack ~]# service openstack-cinder-scheduler start
  [iyunv@openstack ~]# service openstack-cinder-volume start
  [iyunv@openstack ~]# chkconfig openstack-cinder-api on
  [iyunv@openstack ~]# chkconfig openstack-cinder-scheduler on
  [iyunv@openstack ~]# chkconfig openstack-cinder-volume on
  

  9.4.Cinder测试
  [iyunv@openstack ~]# cinder create --display-name volume01 2
  +---------------------+--------------------------------------+
  |       Property      |                Value                 |
  +---------------------+--------------------------------------+
  |     attachments     |                  []                  |
  |  availability_zone  |                 nova                 |
  |       bootable      |                false                 |
  |      created_at     |      2014-05-22T17:07:17.321513      |
  | display_description |                 None                 |
  |     display_name    |               volume01               |
  |      encrypted      |                False                 |
  |          id         | c6a236c7-3989-4616-8108-ccca0caa7181 |
  |       metadata      |                  {}                  |
  |         size        |                  2                   |
  |     snapshot_id     |                 None                 |
  |     source_volid    |                 None                 |
  |        status       |               creating               |
  |     volume_type     |                 None                 |
  +---------------------+--------------------------------------+
  [iyunv@openstack ~]# cinder list
  
  +--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
  |                  ID                  |   Status  | Display Name | Size | Volume Type | Bootable | Attached to |
  +--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
  | c6a236c7-3989-4616-8108-ccca0caa7181 | available |   volume01   |  2   |     None    |  false   |             |
  +--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
  

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-56443-1-1.html 上篇帖子: CentOS6.4安装OpenStack Icehouse controller(一) 下篇帖子: openstack命令备忘录
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表