首页 > 代码库 > Openstack-之cinder
Openstack-之cinder
教程大纲
到今天我们的分享已经完成目标了!
1. cinder安装
2. cinder界面创建云硬盘
1.创建cinder数据库
mysql -u root -p -e "create database cinder;"
mysql -u root -p -e "grant all on cinder.* to cinder@localhost identified by ‘cinder‘;"
mysql -u root -p -e "grant all on cinder.* to cinder@‘%‘ identified by ‘cinder‘;"
2.安装cinder组件
yum install openstack-cinder
3.配置cinder配置文件
[database]
connection = mysql://cinder:cinder@192.168.100.40/cinder
同步数据库
su -s /bin/sh -c "cinder-manage db sync" cinder
验证数据库 mysql -u cinder -p cinder -e "use cinder;show tables"
[DEFAULT]
rpc_backend = rabbit
【RabbitMQ】
[oslo_messaging_rabbit]
...
rabbit_host = 192.168.100.40
rabbit_userid = openstack
rabbit_password = openstack
【keystone】
[DEFAULT]
auth_strategy = keystone
[keystone_authtoken]
auth_uri = http://192.168.100.40:5000
auth_url = http://192.168.100.40:35357
memcached_servers = 192.168.100.40:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = cinder
4.修改Nova的配置文件/etc/nova/nova.conf
[cinder]
os_region_name = RegionOne
5.创建cinder的用户
. admin-openrc 3.1创建cinder用户 openstack user create --domain default --password-prompt cinder 3.2添加 admin 角色到 cinder 用户上。 openstack role add --project service --user cinder admin 3.3创建 cinder 和 cinderv2 服务实体: openstack service create --name cinder --description "OpenStack Block Storage" volume openstack service create --name cinderv2 --description "OpenStack Block Storage" volumev2
11.创建块设备存储服务的 API 入口点:
openstack endpoint create --region RegionOne \
volume public http://192.168.100.40:8776/v1/%\(tenant_id\)s
openstack endpoint create --region RegionOne \
volume internal http://192.168.100.40:8776/v1/%\(tenant_id\)s
openstack endpoint create --region RegionOne \
volume admin http://192.168.100.40:8776/v1/%\(tenant_id\)s
openstack endpoint create --region RegionOne \
volumev2 public http://192.168.100.40:8776/v2/%\(tenant_id\)s
openstack endpoint create --region RegionOne \
volumev2 internal http://192.168.100.40:8776/v2/%\(tenant_id\)s
openstack endpoint create --region RegionOne \
volumev2 admin http://192.168.100.40:8776/v2/%\(tenant_id\)s
13. 重启服务Nova-api 和cinder服务
重启Nova-api 服务
systemctl restart openstack-nova-api.service
启动服务cinder
systemctl enable openstack-cinder-api.service openstack-cinder-scheduler.service
systemctl restart openstack-cinder-api.service openstack-cinder-scheduler.service
14.计算节点的cinder网络组件
yum install openstack-cinder targetcli python-keystone
15.node2上添加一块磁盘:(关机后)
16.创建lvm逻辑卷
创建LVM 物理卷 /dev/sdb:
pvcreate /dev/sdb
创建 LVM 卷组 cinder-volumes:
vgcreate cinder-volumes /dev/sdb
修改lvm的配置/etc/lvm/lvm.conf
devices {
...
filter = [ "a/sdb/", "r/.*/"]
17.修改node2上的cinder配置
/etc/cinder/cinder.conf
[DEFAULT]
...
enabled_backends = lvm 启用 LVM 后端:
手动添加以下[ lvm]
[lvm]
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volume_group = cinder-volumes
iscsi_protocol = iscsi
iscsi_helper = lioadm
16.重启cinder node2节点服务
启动服务:
systemctl enable openstack-cinder-volume.service target.service
systemctl restart openstack-cinder-volume.service target.service
16.测试查看
验证:
$ . admin-openrc
cinder service-list
请观看视屏
视屏会在腾讯课堂和优酷、56视屏网站中上传。请大家搜索中祥课堂即可观看
Openstack-之cinder