openstack(cinder搭建)

            控制节点      

进入数据库
#mysql -u root -proot
创建cinder数据库
>create database cinder
给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用户
#openstack user create --domain default --password=cinder cinder
创建角色
#openstack role add --project service --user cinder admin
创建cinderv2和cinderv3服务
V2
#openstack service create --name cinderv2
–description “OpenStack Block Storage” volumev2
V3
#openstack service create --name cinderv3
–description “OpenStack Block Storage” volumev3
给v2设置权限
#openstack endpoint create --region RegionOne
volumev2 public http://sheng0:8776/v2/%(project_id)s
#openstack endpoint create --region RegionOne
volumev2 internal http://sheng0:8776/v2/%(project_id)s
#openstack endpoint create --region RegionOne
volumev2 admin http://sheng0:8776/v2/%(project_id)s
给v3设置权限
#openstack endpoint create --region RegionOne
volumev3 public http://sheng0:8776/v3/%(project_id)s
#openstack endpoint create --region RegionOne
volumev3 internal http://sheng0:8776/v3/%(project_id)s
#openstack endpoint create --region RegionOne
volumev3 admin http://sheng0:8776/v3/%(project_id)s
下载openstack-cinder
#yum -y install openstack-cinder
修改配置文件/etc/cinder/cinder.conf
#vim /etc/cinder/cinder.conf
配置文件内容查看cinder配置文件
导入数据库
su -s /bin/sh -c “cinder-manage db sync” cinder
修改配置文件/etc/nova/nova.conf
#vim /etc/nova/nova.conf
[cinder]
os_region_name = RegionOne
重启nova服务
#systemctl restart openstack-nova-api
启动服务设置开机自启
#systemctl start openstack-cinder-api openstack-cinder-scheduler

存储节点
下载lvm2
#yum -y install lvm2
启动服务设置开机自启
#systemctl start lvm2-lvmetad
创建pv卷
#pvcreate /dev/sdb
创建vg卷cinder-volumes
#vgcreate cinder-volumes /dev/sdb
修改配置文件/etc/lvm/lvm.cong
在devices下面添加
filter = [ “a/sdb/”, “r/.*/”]
下载软件
#yum -y install openstack-cinder targetcli python-keystone
修改配置文件
#vim /et/cinder/cinder.conf
查看cinder配置文件
启动服务并设置开机自启
#systemctl start openstack-cinder-volume.service target.service

cinder控制节点配置文件
[DEFAULT]
my_ip = 192.168.186.50
#glance_api_servers = http://sheng0:9292
auth_strategy = keystone
#enabled_backends = lvm
transport_url = rabbit://openstack:admin@sheng0
[backend]
[barbican]
[brcd_fabric_example]
[cisco_fabric_example]
[coordination]
[cors]
[cors.subdomain]
[database]
connection = mysql+pymysql://cinder:CINDER_DBPASS@sheng0/cinder
[fc-zone-manager]
[healthcheck]
[key_manager]
[keystone_authtoken]
auth_uri = http://sheng0:5000
auth_url = http://sheng0:35357
memcached_servers = sheng0:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = cinder
[matchmaker_redis]
[oslo_concurrency]
lock_path = /var/lib/cinder/tmp
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_messaging_zmq]
[oslo_middleware]
[oslo_policy]
[oslo_reports]
[oslo_versionedobjects]
[profiler]
[ssl]
[lvm]
#volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
#volume_group = cinder-volumes
#volumes_dir = $state_path/volumes
#iscsi_protocol = iscsi
#iscsi_helper = lioadm
#iscsi_ip_address = 192.168.186.50

cinder存储节点配置文件
[DEFAULT]
my_ip = 192.168.186.53
glance_api_servers = http://sheng0:9292
auth_strategy = keystone
enabled_backends = lvm
transport_url = rabbit://openstack:admin@sheng0
[backend]
[barbican]
[brcd_fabric_example]
[cisco_fabric_example]
[coordination]
[cors]
[cors.subdomain]
[database]
connection = mysql+pymysql://cinder:CINDER_DBPASS@sheng0/cinder
[fc-zone-manager]
[healthcheck]
[key_manager]
[keystone_authtoken]
auth_uri = http://sheng0:5000
auth_url = http://sheng0:35357
memcached_servers = sheng0:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = cinder
[matchmaker_redis]
[oslo_concurrency]
lock_path = /var/lib/cinder/tmp
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_messaging_zmq]
[oslo_middleware]
[oslo_policy]
[oslo_reports]
[oslo_versionedobjects]
[profiler]
[ssl]
[lvm]
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volume_group = cinder-volumes
volumes_dir = $state_path/volumes
iscsi_protocol = iscsi
iscsi_helper = lioadm
iscsi_ip_address = 192.168.186.53

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值