博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
cinder节点部署
阅读量:5815 次
发布时间:2019-06-18

本文共 3994 字,大约阅读时间需要 13 分钟。

其实看基础理论篇大家也可以看出来,cinder跟nova流程比较像,是这样的,nova为云主机提供了虚拟资源,cinder则是提供存储相关的资源,cinder的小伙伴叫swift,不过这个一般没人用了现在,之所以要部署cinder呢是因为需要用它来对接ceph,不过考虑到并不是所有人都想后端用分布式存储,所以这篇文章就写默认情况下cinder提供lvm存储的方式,需要对接ceph的小伙伴讲ceph对接里面需要修改的地方看清自行修改就可以了

前面说了,跟nova类似,那么肯定也有控制的跟干活的,控制的还是用总的控制节点,干活的就原来的计算节点吧,分工明确

yum install openstack-cinder -y

1.控制节点
一样,先弄数据库把表建了,其实操作多了大家也可以看出来不论什么服务,都是一套流程
mysql -uroot -pbfmq
CREATE DATABASE cinder;
GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' IDENTIFIED BY 'bfmq';
GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%' IDENTIFIED BY 'bfmq';
GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'controller01' IDENTIFIED BY 'bfmq';
flush privileges;
quit

openstack user create --domain default --password-prompt cinder(会提示设置密码,如果出现os什么什么的报错就. admin-openrc下,因为你退出了环境变量不生效了)

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://controller01:8776/v1/%\(tenant_id\)s
openstack endpoint create --region RegionOne volume internal http://controller01:8776/v1/%\(tenant_id\)s
openstack endpoint create --region RegionOne volume admin http://controller01:8776/v1/%\(tenant_id\)s
openstack endpoint create --region RegionOne volumev2 public http://controller01:8776/v2/%\(tenant_id\)s
openstack endpoint create --region RegionOne volumev2 internal http://controller01:8776/v2/%\(tenant_id\)s
openstack endpoint create --region RegionOne volumev2 admin http://controller01:8776/v2/%\(tenant_id\)s
vim /etc/cinder/cinder.conf修改
[DEFAULT]
rpc_backend = rabbit
auth_strategy = keystone
my_ip = 60.34.30.11

[oslo_messaging_rabbit]

rabbit_host = controller01
rabbit_userid = rabbitmq
rabbit_password = bfmq

[database]

connection = mysql+pymysql://cinder:bfmq@controller01/cinder

[keystone_authtoken]

auth_url = http://controller01:5000
memcached_servers = controller01:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = bfmq

[oslo_concurrency]

lock_path = /var/lib/cinder/tmp

su -s /bin/sh -c "cinder-manage db sync" cinder(各种info信息请忽略)

systemctl restart openstack-nova-api.service
systemctl enable openstack-cinder-api.service openstack-cinder-scheduler.service
systemctl start openstack-cinder-api.service openstack-cinder-scheduler.service

2.计算节点,注意这里就是你部署nova-computer的节点

vim /etc/nova/nova.conf添加
[cinder]
os_region_name = RegionOne

systemctl restart openstack-nova-api.service

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

3.存储节点,就是你提供真实物理存储设备的节点,我的跟计算节点是同节点

yum install lvm2 targetcli -y
systemctl enable lvm2-lvmetad.service
systemctl start lvm2-lvmetad.service
pvcreate /dev/sdb(以后可以再创建pv向vg里加以扩大容量)
vgcreate cinder-volumes /dev/sdb
vim /etc/lvm/lvm.conf修改
filter = [ "a/sdb/", "r/.*/"](新加了pv就需要修改了)

vim /etc/cinder/cinder.conf修改

[DEFAULT]
rpc_backend = rabbit
auth_strategy = keystone
my_ip = 60.34.30.13
enabled_backends = lvm
glance_api_servers = http://controller01:9292

[oslo_messaging_rabbit]

rabbit_host = controller01
rabbit_userid = rabbitmq
rabbit_password = bfmq

[database]

connection = mysql+pymysql://cinder:bfmq@controller01/cinder

[keystone_authtoken]

auth_url = http://controller01:5000
memcached_servers = controller01:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = bfmq

[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 enable openstack-cinder-volume.service target.service

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

转载于:https://www.cnblogs.com/bfmq/p/6040942.html

你可能感兴趣的文章
【聚能聊有奖话题】Boring隧道掘进机完成首段挖掘,离未来交通还有多远?
查看>>
USNews大学排名遭美国计算机研究学会怒怼,指排名荒谬要求撤回
查看>>
七大关键数据 移动安全迎来历史转折点
查看>>
在AngularJS中学习javascript的new function意义及this作用域的生成过程
查看>>
盘点物联网网关现有联网技术及应用场景
查看>>
mui 总结2--新建第一个app项目
查看>>
nginx的lua api
查看>>
考研太苦逼没坚持下来!看苑老师视频有点上头
查看>>
HCNA——RIP的路由汇总
查看>>
zabbix监控php状态(四)
查看>>
定时任务的创建
查看>>
实战Django:小型CMS Part2
查看>>
原创]windows server 2012 AD架构试验系列 – 16更改DC计算机名
查看>>
统治世界的十大算法
查看>>
linux svn安装和配置
查看>>
SSH中调用另一action的方法(chain,redirect)
查看>>
数据库基础
查看>>
表格排序
查看>>
关于Android四大组件的学习总结
查看>>
java只能的round,ceil,floor方法的使用
查看>>