OpenStack Train版 简单部署流程(2)

Stella981
• 阅读 629

cinder

controller node

1.条件设置

1.创库授权

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';

2.创建项目和角色

openstack user create --domain default --password cinder123 cinder
openstack role add --project admin --user cinder admin
openstack service create --name cinderv2 --description "OpenStack Block Storage" volumev2
openstack service create --name cinderv3 --description "OpenStack Block Storage" volumev3
openstack endpoint create --region RegionOne volumev2 public http://controller:8776/v2/%\(project_id\)s
openstack endpoint create --region RegionOne volumev2 internal http://controller:8776/v2/%\(project_id\)s
openstack endpoint create --region RegionOne volumev2 admin http://controller:8776/v2/%\(project_id\)s
openstack endpoint create --region RegionOne volumev3 public http://controller:8776/v3/%\(project_id\)s
openstack endpoint create --region RegionOne volumev3 internal http://controller:8776/v3/%\(project_id\)s
openstack endpoint create --region RegionOne volumev3 admin http://controller:8776/v3/%\(project_id\)s

2.安装并配置组件

1.安装软件包

yum install openstack-cinder -y

2.Edit the /etc/cinder/cinder.conf file

sed -i '/^\[database\]/a connection = mysql+pymysql://cinder:CINDER_DBPASS@controller/cinder' /etc/cinder/cinder.conf
sed -i '/^\[DEFAULT\]/a transport_url = rabbit://openstack:RABBIT_PASS@controller' /etc/cinder/cinder.conf
sed -i '/^\[DEFAULT\]/a auth_strategy = keystone' /etc/cinder/cinder.conf
sed -i '/^\[DEFAULT\]/a my_ip = 10.1.10.161' /etc/cinder/cinder.conf
sed -i '/^\[keystone_authtoken\]/a password = cinder123' /etc/cinder/cinder.conf
sed -i '/^\[keystone_authtoken\]/a username = cinder' /etc/cinder/cinder.conf
sed -i '/^\[keystone_authtoken\]/a project_name = admin' /etc/cinder/cinder.conf
sed -i '/^\[keystone_authtoken\]/a user_domain_name = Default' /etc/cinder/cinder.conf
sed -i '/^\[keystone_authtoken\]/a project_domain_name = Default' /etc/cinder/cinder.conf
sed -i '/^\[keystone_authtoken\]/a auth_type = password' /etc/cinder/cinder.conf
sed -i '/^\[keystone_authtoken\]/a memcached_servers = controller:11211' /etc/cinder/cinder.conf
sed -i '/^\[keystone_authtoken\]/a auth_url = http://controller:5000' /etc/cinder/cinder.conf
sed -i '/^\[keystone_authtoken\]/a www_authenticate_uri  = http://controller:5000' /etc/cinder/cinder.conf
sed -i '/^\[oslo_concurrency\]/a lock_path = /var/lib/cinder/tmp' /etc/cinder/cinder.conf

3.初始化数据库

su -s /bin/sh -c "cinder-manage db sync" cinder

4.Edit the /etc/nova/nova.conf file

sed -i '/^\[cinder\]/a os_region_name = RegionOne' /etc/nova/nova.conf

5.启动服务

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

(1)code

mysql -u root -p1234qwer
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';
quit
. /root/admin-openrc
openstack user create --domain default --password cinder123 cinder
openstack role add --project admin --user cinder admin
openstack service create --name cinderv2 --description "OpenStack Block Storage" volumev2
openstack service create --name cinderv3 --description "OpenStack Block Storage" volumev3
openstack endpoint create --region RegionOne volumev2 public http://controller:8776/v2/%\(project_id\)s
openstack endpoint create --region RegionOne volumev2 internal http://controller:8776/v2/%\(project_id\)s
openstack endpoint create --region RegionOne volumev2 admin http://controller:8776/v2/%\(project_id\)s
openstack endpoint create --region RegionOne volumev3 public http://controller:8776/v3/%\(project_id\)s
openstack endpoint create --region RegionOne volumev3 internal http://controller:8776/v3/%\(project_id\)s
openstack endpoint create --region RegionOne volumev3 admin http://controller:8776/v3/%\(project_id\)s
yum install openstack-cinder -y
sed -i '/^\[database\]/a connection = mysql+pymysql://cinder:CINDER_DBPASS@controller/cinder' /etc/cinder/cinder.conf
sed -i '/^\[DEFAULT\]/a transport_url = rabbit://openstack:RABBIT_PASS@controller' /etc/cinder/cinder.conf
sed -i '/^\[DEFAULT\]/a auth_strategy = keystone' /etc/cinder/cinder.conf
sed -i '/^\[DEFAULT\]/a my_ip = 10.1.10.161' /etc/cinder/cinder.conf
sed -i '/^\[keystone_authtoken\]/a password = cinder123' /etc/cinder/cinder.conf
sed -i '/^\[keystone_authtoken\]/a username = cinder' /etc/cinder/cinder.conf
sed -i '/^\[keystone_authtoken\]/a project_name = admin' /etc/cinder/cinder.conf
sed -i '/^\[keystone_authtoken\]/a user_domain_name = Default' /etc/cinder/cinder.conf
sed -i '/^\[keystone_authtoken\]/a project_domain_name = Default' /etc/cinder/cinder.conf
sed -i '/^\[keystone_authtoken\]/a auth_type = password' /etc/cinder/cinder.conf
sed -i '/^\[keystone_authtoken\]/a memcached_servers = controller:11211' /etc/cinder/cinder.conf
sed -i '/^\[keystone_authtoken\]/a auth_url = http://controller:5000' /etc/cinder/cinder.conf
sed -i '/^\[keystone_authtoken\]/a www_authenticate_uri  = http://controller:5000' /etc/cinder/cinder.conf
sed -i '/^\[oslo_concurrency\]/a lock_path = /var/lib/cinder/tmp' /etc/cinder/cinder.conf
su -s /bin/sh -c "cinder-manage db sync" cinder
sed -i '/^\[cinder\]/a os_region_name = RegionOne' /etc/nova/nova.conf
systemctl restart openstack-nova-api.service
systemctl enable openstack-cinder-api.service openstack-cinder-scheduler.service
systemctl restart openstack-cinder-api.service openstack-cinder-scheduler.service

storage node

1.安装并配置组件

1.创建卷

yum install lvm2 device-mapper-persistent-data -ysystemctl enable lvm2-lvmetad.servicesystemctl restart lvm2-lvmetad.servicepvcreate /dev/sdbvgcreate cinder-volumes /dev/sdb

只有实例可以访问块存储卷组。但是,底层的操作系统管理着与这些卷相关联的设备。默认情况下,LVM卷扫描工具会扫描``/dev`` 目录,查找包含卷的块存储设备。如果项目在他们的卷上使用了LVM,扫描工具便会在检测到这些卷时尝试缓存它们,这可能会在底层操作系统和项目卷上产生各种问题。所以您必须重新配置LVM,让它扫描仅包含``cinder-volume``卷组的设备。编辑``/etc/lvm/lvm.conf``文件并完成下面的操作:

在``devices``部分,添加一个过滤器,只接受``/dev/sdb``设备,拒绝其他所有设备:

devices {
...
filter = [ "a/sdb/", "r/.*/"]

每个过滤器组中的元素都以``a``开头,即为 accept,或以 r 开头,即为**reject**,并且包括一个设备名称的正则表达式规则。过滤器组必须以``r/.*/``结束,过滤所有保留设备。您可以使用 :命令:`vgs -vvvv` 来测试过滤器。

警告

如果您的存储节点在操作系统磁盘上使用了 LVM,您还必需添加相关的设备到过滤器中。例如,如果 /dev/sda 设备包含操作系统:

filter = [ "a/sda/", "a/sdb/", "r/.*/"]

类似地,如果您的计算节点在操作系统磁盘上使用了 LVM,您也必需修改这些节点上 /etc/lvm/lvm.conf 文件中的过滤器,将操作系统磁盘包含到过滤器中。例如,如果``/dev/sda`` 设备包含操作系统:

filter = [ "a/sda/", "r/.*/"]

2.安装软件包

yum install openstack-cinder targetcli python-keystone -y

3.Edit the /etc/cinder/cinder.conf file

sed -i '/^\[database\]/a connection = mysql+pymysql://cinder:CINDER_DBPASS@controller/cinder' /etc/cinder/cinder.confsed -i '/^\[DEFAULT\]/a transport_url = rabbit://openstack:RABBIT_PASS@controller' /etc/cinder/cinder.confsed -i '/^\[DEFAULT\]/a auth_strategy = keystone' /etc/cinder/cinder.confsed -i '/^\[DEFAULT\]/a my_ip = 10.1.10.161' /etc/cinder/cinder.confsed -i '/^\[keystone_authtoken\]/a password = cinder123' /etc/cinder/cinder.confsed -i '/^\[keystone_authtoken\]/a username = cinder' /etc/cinder/cinder.confsed -i '/^\[keystone_authtoken\]/a project_name = admin' /etc/cinder/cinder.confsed -i '/^\[keystone_authtoken\]/a user_domain_name = Default' /etc/cinder/cinder.confsed -i '/^\[keystone_authtoken\]/a project_domain_name = Default' /etc/cinder/cinder.confsed -i '/^\[keystone_authtoken\]/a auth_type = password' /etc/cinder/cinder.confsed -i '/^\[keystone_authtoken\]/a memcached_servers = controller:11211' /etc/cinder/cinder.confsed -i '/^\[keystone_authtoken\]/a auth_url = http://controller:5000' /etc/cinder/cinder.confsed -i '/^\[keystone_authtoken\]/a www_authenticate_uri  = http://controller:5000' /etc/cinder/cinder.confsed -i '/^\[oslo_concurrency\]/a lock_path = /var/lib/cinder/tmp' /etc/cinder/cinder.confecho '[lvm]' >> /etc/cinder/cinder.confsed -i '/^\[lvm\]/a iscsi_helper = lioadm' /etc/cinder/cinder.confsed -i '/^\[lvm\]/a iscsi_protocol = iscsi' /etc/cinder/cinder.confsed -i '/^\[lvm\]/a volume_group = cinder-volumes' /etc/cinder/cinder.confsed -i '/^\[lvm\]/a volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver' /etc/cinder/cinder.confsed -i '/^\[DEFAULT\]/a enabled_backends = lvm' /etc/cinder/cinder.confsed -i '/^\[DEFAULT\]/a glance_api_servers = http://controller:9292' /etc/cinder/cinder.conf

4.启动服务

systemctl enable openstack-cinder-volume.service target.servicesystemctl restart openstack-cinder-volume.service target.service

(2)code

yum install lvm2 device-mapper-persistent-data -ysystemctl enable lvm2-lvmetad.servicesystemctl restart lvm2-lvmetad.servicepvcreate /dev/sdbvgcreate cinder-volumes /dev/sdbyum install openstack-cinder targetcli python-keystone -ysed -i '/^\[database\]/a connection = mysql+pymysql://cinder:CINDER_DBPASS@controller/cinder' /etc/cinder/cinder.confsed -i '/^\[DEFAULT\]/a transport_url = rabbit://openstack:RABBIT_PASS@controller' /etc/cinder/cinder.confsed -i '/^\[DEFAULT\]/a auth_strategy = keystone' /etc/cinder/cinder.confsed -i '/^\[DEFAULT\]/a my_ip = 10.1.10.161' /etc/cinder/cinder.confsed -i '/^\[keystone_authtoken\]/a password = cinder123' /etc/cinder/cinder.confsed -i '/^\[keystone_authtoken\]/a username = cinder' /etc/cinder/cinder.confsed -i '/^\[keystone_authtoken\]/a project_name = admin' /etc/cinder/cinder.confsed -i '/^\[keystone_authtoken\]/a user_domain_name = Default' /etc/cinder/cinder.confsed -i '/^\[keystone_authtoken\]/a project_domain_name = Default' /etc/cinder/cinder.confsed -i '/^\[keystone_authtoken\]/a auth_type = password' /etc/cinder/cinder.confsed -i '/^\[keystone_authtoken\]/a memcached_servers = controller:11211' /etc/cinder/cinder.confsed -i '/^\[keystone_authtoken\]/a auth_url = http://controller:5000' /etc/cinder/cinder.confsed -i '/^\[keystone_authtoken\]/a www_authenticate_uri  = http://controller:5000' /etc/cinder/cinder.confsed -i '/^\[oslo_concurrency\]/a lock_path = /var/lib/cinder/tmp' /etc/cinder/cinder.confecho '[lvm]' >> /etc/cinder/cinder.confsed -i '/^\[lvm\]/a iscsi_helper = lioadm' /etc/cinder/cinder.confsed -i '/^\[lvm\]/a iscsi_protocol = iscsi' /etc/cinder/cinder.confsed -i '/^\[lvm\]/a volume_group = cinder-volumes' /etc/cinder/cinder.confsed -i '/^\[lvm\]/a volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver' /etc/cinder/cinder.confsed -i '/^\[DEFAULT\]/a enabled_backends = lvm' /etc/cinder/cinder.confsed -i '/^\[DEFAULT\]/a glance_api_servers = http://controller:9292' /etc/cinder/cinder.confsystemctl enable openstack-cinder-volume.service target.servicesystemctl restart openstack-cinder-volume.service target.service
点赞
收藏
评论区
推荐文章
blmius blmius
3年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
Easter79 Easter79
3年前
swap空间的增减方法
(1)增大swap空间去激活swap交换区:swapoff v /dev/vg00/lvswap扩展交换lv:lvextend L 10G /dev/vg00/lvswap重新生成swap交换区:mkswap /dev/vg00/lvswap激活新生成的交换区:swapon v /dev/vg00/lvswap
皕杰报表之UUID
​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为
Jacquelyn38 Jacquelyn38
3年前
2020年前端实用代码段,为你的工作保驾护航
有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )
Wesley13 Wesley13
3年前
Java获得今日零时零分零秒的时间(Date型)
publicDatezeroTime()throwsParseException{    DatetimenewDate();    SimpleDateFormatsimpnewSimpleDateFormat("yyyyMMdd00:00:00");    SimpleDateFormatsimp2newS
Stella981 Stella981
3年前
KVM调整cpu和内存
一.修改kvm虚拟机的配置1、virsheditcentos7找到“memory”和“vcpu”标签,将<namecentos7</name<uuid2220a6d1a36a4fbb8523e078b3dfe795</uuid
Wesley13 Wesley13
3年前
mysql设置时区
mysql设置时区mysql\_query("SETtime\_zone'8:00'")ordie('时区设置失败,请联系管理员!');中国在东8区所以加8方法二:selectcount(user\_id)asdevice,CONVERT\_TZ(FROM\_UNIXTIME(reg\_time),'08:00','0
Wesley13 Wesley13
3年前
00:Java简单了解
浅谈Java之概述Java是SUN(StanfordUniversityNetwork),斯坦福大学网络公司)1995年推出的一门高级编程语言。Java是一种面向Internet的编程语言。随着Java技术在web方面的不断成熟,已经成为Web应用程序的首选开发语言。Java是简单易学,完全面向对象,安全可靠,与平台无关的编程语言。
Stella981 Stella981
3年前
Django中Admin中的一些参数配置
设置在列表中显示的字段,id为django模型默认的主键list_display('id','name','sex','profession','email','qq','phone','status','create_time')设置在列表可编辑字段list_editable
Wesley13 Wesley13
3年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_
Python进阶者 Python进阶者
10个月前
Excel中这日期老是出来00:00:00,怎么用Pandas把这个去除
大家好,我是皮皮。一、前言前几天在Python白银交流群【上海新年人】问了一个Pandas数据筛选的问题。问题如下:这日期老是出来00:00:00,怎么把这个去除。二、实现过程后来【论草莓如何成为冻干莓】给了一个思路和代码如下:pd.toexcel之前把这