标签:network openstack vxlan neutron mitaka
安装配置cinder服务
controller节点
一、创建数据库
[root@controller ~]# mysql -u root -p >>CREATE DATABASE cinder; >>GRANT ALL PRIVILEGES ON cinder.* TO ‘cinder‘@‘localhost‘ IDENTIFIED BY ‘CINDER_DBPASS‘; >>GRANT ALL PRIVILEGES ON cinder.* TO ‘cinder‘@‘%‘ IDENTIFIED BY ‘CINDER_DBPASS‘;
CINDER_DBPASS换成自己想要设置的密码
二、创建服务实体和api接口
[root@controller ~]# source /root/admin-openrc.sh [root@controller ~]# openstack user create --domain default --password-prompt cinder [root@controller ~]# openstack role add --project service --user cinder admin [root@controller ~]# openstack service create --name cinder --description "OpenStack Block Storage" volume [root@controller ~]# openstack service create --name cinderv2 --description "OpenStack Block Storage" volumev2 [root@controller ~]# openstack endpoint create --region RegionOne volume public http://controller:8776/v1/%\(tenant_id\)s [root@controller ~]# openstack endpoint create --region RegionOne volume internal [root@controller ~]# openstack endpoint create --region RegionOne \ volume admin http://controller:8776/v1/%\(tenant_id\)s [root@controller ~]# openstack endpoint create --region RegionOne \ volumev2 public http://controller:8776/v2/%\(tenant_id\)s [root@controller ~]# openstack endpoint create --region RegionOne \ volumev2 internal http://controller:8776/v2/%\(tenant_id\)s [root@controller ~]# openstack endpoint create --region RegionOne \ volumev2 admin http://controller:8776/v2/%\(tenant_id\)s
三、安装cinder服务
[root@controller ~]# yum install openstack-cinder
配置cinder服务
[root@controller ~]# mv /etc/cinder/cinder.conf /etc/cinder/cinder.conf_bak [root@controller ~]# vim /etc/cinder/cinder.conf [DEFAULT] rpc_backend = rabbit my_ip = 10.0.0.11 auth_strategy = keystone [database] connection = mysql+pymysql://cinder:CINDER_DBPASS@controller/cinder #改为自己的数据库密码 [oslo_messaging_rabbit] rabbit_host = controller rabbit_userid = openstack rabbit_password = RABBIT_PASS #改为rabbimq的密码 [keystone_authtoken] auth_uri = http://controller:5000 auth_url = http://controller:35357 memcached_servers = controller:11211 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = cinder password = CINDER_PASS #改为cinder服务的密码 [oslo_concurrency] lock_path = /var/lib/cinder/tmp
配置nova使用cinder
[root@controller ~]# vim /etc/nova/nova.conf #增加以下内容 [cinder] os_region_name = RegionOne
重启nova-api服务
[root@controller ~]# systemctl restart openstack-nova-api.service
启动cinder服务,并设置开机启动
[root@controller ~]# systemctl enable openstack-cinder-api.service openstack-cinder-scheduler.service [root@controller ~]# systemctl start openstack-cinder-api.service openstack-cinder-scheduler.service
storage 节点
改节点测试,我这里有两块磁盘,用第二块测试
一、安装配置lvm2
[root@block1 ~]# yum install lvm2 [root@block1 ~]# systemctl enable lvm2-lvmetad.service [root@block1 ~]# systemctl start lvm2-lvmetad.service
使用第二块磁盘/dev/sdb 穿件一个pv
[root@block1 ~]# pvcreate /dev/sdb Physical volume "/dev/sdb" successfully created
在上面的pv上创建一个vg
[root@block1 ~]# vgcreate cinder-volumes /dev/sdb Volume group "cinder-volumes" successfully created
编辑lvm配置文件
[root@block1 ~]#vim /etc/lvm/lvm.conf devices { filter = [ "a/sdb/", "r/.*/"] #lvm可以扫描发现sdb,其他的分区都reject
二、安装配置cinder volume
[root@block1 ~]# yum install openstack-cinder targetcli
编辑cinder配置文件
[root@block1 ~]#mv /etc/cinder/cinder.conf /etc/cinder/cinder.conf_bak [root@block1 ~]#vim /etc/cinder/cinder.conf [DEFAULT] rpc_backend = rabbit auth_strategy = keystone my_ip = MANAGEMENT_INTERFACE_IP_ADDRESS #改成管理网的ip 这里 10.0.0.41 enabled_backends = lvm glance_api_servers = http://controller:9292 [database] connection = mysql+pymysql://cinder:CINDER_DBPASS@controller/cinder #改成自己数据库密码 [oslo_messaging_rabbit] rabbit_host = controller rabbit_userid = openstack rabbit_password = RABBIT_PASS #改成自己rabbit密码 [keystone_authtoken] auth_uri = http://controller:5000 auth_url = http://controller:35357 memcached_servers = controller:11211 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = cinder password = CINDER_PASS #改成自己cinder服务密码 [lvm] volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver volume_group = cinder-volumes iscsi_protocol = iscsi iscsi_helper = lioadm [oslo_concurrency] lock_path = /var/lib/cinder/tmp
启动cinder相关服务,并添加开机启动
[root@block1 ~]# systemctl enable openstack-cinder-volume.service target.service [root@block1 ~]# systemctl start openstack-cinder-volume.service target.service
三、验证
在controller节点执行
[root@controller ~]#source /root/admin-openrc.sh [root@controller ~]# cinder service-list +------------------+--------------+------+---------+-------+----------------------------+-----------------+ | Binary | Host | Zone | Status | State | Updated_at | Disabled Reason | +------------------+--------------+------+---------+-------+----------------------------+-----------------+ | cinder-scheduler | controller | nova | enabled | up | 2016-06-16T14:17:46.000000 | - | | cinder-volume | block1@lvm | nova | enabled | up | 2016-06-16T14:17:00.000000 | - | | cinder-volume | compute2@lvm | nova | enabled | down | 2016-06-16T08:41:19.000000 | - | +------------------+--------------+------+---------+-------+----------------------------+-----------------+
我这里在compute2上做测试装了cinder服务,因为compute2没有启动,所以是down,cinder对时间同步有要求,时间不同步这里就显示down。
如果出现上面信息,表示成功。
对于创建网络,创建实例,创建卷,挂载卷,热迁移,待续.....
本文出自 “venuxs” 博客,请务必保留此出处http://venuxs.blog.51cto.com/11763538/1796039
openstack M版安装 storage(cinder)服务篇
标签:network openstack vxlan neutron mitaka
原文地址:http://venuxs.blog.51cto.com/11763538/1796039