Openstack Ocata安装(Block Storage service)

来源:互联网 发布:软件注册授权系统 编辑:程序博客网 时间:2024/06/05 04:44

一、安装和配置控制器节点

在安装和配置块存储服务之前,你 必须创建一个数据库,服务凭证和API端点。

# mysql -u root -pMariaDB [(none)]> CREATE DATABASE cinder;MariaDB [(none)]> GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' \  IDENTIFIED BY '123qwe';MariaDB [(none)]> GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%' \  IDENTIFIED BY '123qwe';# source /home/admin-openrc.sh# openstack user create --domain default --password-prompt cinder# openstack role add --project service --user cinder admin

创建cinder和cinderv2服务

# openstack service create --name cinder \  --description "OpenStack Block Storage" volume# openstack service create --name cinderv2 \  --description "OpenStack Block Storage" volumev2

创建块存储API端点

# openstack endpoint create --region RegionOne \  volume public http://controller:8776/v1/%\   (tenant_id\)s# openstack endpoint create --region RegionOne \  volume internal http://controller:8776/v1/%\(tenant_id\)s# openstack endpoint create --region RegionOne \  volume admin http://controller:8776/v1/%\(tenant_id\)s# openstack endpoint create --region RegionOne \  volumev2 public http://controller:8776/v2/%\(tenant_id\)s# openstack endpoint create --region RegionOne \  volumev2 internal http://controller:8776/v2/%\(tenant_id\)s# openstack endpoint create --region RegionOne \  volumev2 admin http://controller:8776/v2/%\(tenant_id\)s# 

安装和配置组件

# yum install openstack-cinder# vi /etc/cinder/cinder.conf[DEFAULT]# ...transport_url = rabbit://openstack:RABBIT_PASS@controllerauth_strategy = keystonemy_ip = 172.16.5.135[database]# ...connection = mysql+pymysql://cinder:CINDER_DBPASS@controller/cinder[keystone_authtoken]# ...auth_uri = http://controller:5000auth_url = http://controller:35357memcached_servers = controller:11211auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultproject_name = serviceusername = cinderpassword = 123qwe[oslo_concurrency]# ...lock_path = /var/lib/cinder/tmp

填充数据库

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

配置计算服务使用块存储

#vi /etc/nova/nova.conf[cinder]os_region_name = RegionOne

重启计算服务

# systemctl enable openstack-cinder-api.service openstack-cinder-scheduler.service# systemctl start openstack-cinder-api.service openstack-cinder-scheduler.service

二、安装配置一个存储节点

首先你要有干净的硬盘,例如/dev/sdb没有任何数据和文件系统。如果想格式化硬盘,请参考这篇文章。
安装必要的包

# yum install lvm2# systemctl enable lvm2-lvmetad.service# systemctl start lvm2-lvmetad.service

创建LVM物理卷和LVM卷组

# pvcreate /dev/sdb# vgcreate cinder-volumes /dev/sdb# vi /etc/lvm/lvm.confdevices {...filter = [ "a/sdb/", "r/.*/"]

安装和配置组件

# yum install openstack-cinder targetcli python-keystonevi /etc/cinder/cinder.conf[DEFAULT]# ...enabled_backends = lvmglance_api_servers = http://controller:9292transport_url = rabbit://openstack:123qwe@controllerauth_strategy = keystonemy_ip = 172.16.5.136[database]# ...connection = mysql+pymysql://cinder:123qwe@controller/cinder[keystone_authtoken]# ...auth_uri = http://controller:5000auth_url = http://controller:35357memcached_servers = controller:11211auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultproject_name = serviceusername = cinderpassword = 123qwe[lvm]volume_driver = cinder.volume.drivers.lvm.LVMVolumeDrivervolume_group = cinder-volumesiscsi_protocol = iscsiiscsi_helper = lioadm[oslo_concurrency]# ...lock_path = /var/lib/cinder/tmp

启动存储服务

# systemctl enable openstack-cinder-volume.service target.service# systemctl start openstack-cinder-volume.service target.service

三、验证

# source /home/admin-openrc.sh# openstack volume service list
原创粉丝点击