标签:一个 安装软件 查看 set shadow restart protoc code 使用
# mysql -uroot -p000000
> create database cinder;
> grant all privileges on cinder.* to 'cinder'@'localhost' identified by '000000';
> grant all privileges on cinder.* to 'cinder'@'%' identified by '000000';
# . /root/admin-openrc
# openstack user create --domain default --password 000000 cinder
# openstack role add --project service --user cinder admin
创建服务实体
#openstack service create --name cinder --description "OpenStack Block Storage" volume
#openstack service create --name cinderv2 --description "OpenStack Block Storage" volumev2
#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
[root@controller ~]# yum -y install openstack-cinder
编辑 /etc/cinder/cinder.conf
#vi /etc/cinder/cinder.conf
在 “[DEFAULT]” 下添加
rpc_backend = rabbit
auth_strategy = keystone
my_ip = 192.168.100.10
在[database]下添加
connection = mysql+pymysql://cinder:000000@controller/cinder
在[oslo_messaging_rabbit]部分,配置 “RabbitMQ” 消息队列访问:
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = 000000
在[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 = 000000
在 [oslo_concurrency] 部分,配置锁路径:
lock_path = /var/lib/cinder/tmp
# su -s /bin/sh -c "cinder-manage db sync" cinder
编辑文件 /etc/nova/nova.conf 并添加如下到其中:
# [root@controller ~]# vi /etc/nova/nova.conf
在[cinder]下添加
os_region_name = RegionOne
重启计算API 服务:
# systemctl restart openstack-nova-api.service
启动块设备存储服务,并将其配置为开机自启:
#systemctl start openstack-cinder-api.service openstack-cinder-scheduler.service
#systemctl enable openstack-cinder-api.service openstack-cinder-scheduler.service
[root@compute ~]# yum -y install lvm2
启动LVM的metadata服务并且设置该服务随系统启动:
# systemctl start lvm2-lvmetad.service
# systemctl enable lvm2-lvmetad.service
首先查看是否存在sdb
# lsblk
首先执行如下命令
创建分区:
[root@compute ~]# fdisk /dev/sdb
# pvcreate /dev/sdb1
# vgcreate cinder-volumes /dev/sdb1
/etc/lvm/lvm.conf
文件,并修改首先查看哪些分区使用了 LVM格式
# lsblk
# vi /etc/lvm/lvm.conf
在``devices``部分,添加一个过滤器,接受使用lvm的设备:
filter = [ "a/sdb/", "r/.*/"]
# yum -y install openstack-cinder targetcli python-keystone
在[DEFAULT]下添加
rpc_backend = rabbit
auth_strategy = keystone
my_ip = 192.168.100.20 #这里的IP地址是存储节点的ip
enabled_backends = lvm
glance_api_servers = http://controller:9292
在[database]下添加
connection = mysql+pymysql://cinder:000000@controller/cinder
在[oslo_messaging_rabbit]”部分,配置 “RabbitMQ” 消息队列访问:
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = 000000
在[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 = 000000
添加[lvm]项
[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
# systemctl start openstack-cinder-volume.service target.service
# systemctl enable openstack-cinder-volume.service target.service
# . /root/admin-openrc
列出服务组件以验证是否每个进程都成功启动:
#cinder service-list
创建卷
# cinder create --display-name v1 1
# cinder list
(八)OpenStack---M版---双节点搭建---Cinder安装和配置
标签:一个 安装软件 查看 set shadow restart protoc code 使用
原文地址:https://www.cnblogs.com/zhijian1574/p/11956850.html