重庆分公司,新征程启航
为企业提供网站建设、域名注册、服务器等服务
整个OpenStack是由控制节点,计算节点,网络节点,存储节点四大部分组成。上篇博文详细讲述了控制节点服务controller中的horizon组件,本篇博文将详解存储节点cinder的部署。分为两部分:控制节点和存储节点
十多年的济宁网站建设经验,针对设计、前端、开发、售后、文案、推广等六对一服务,响应快,48小时及时工作处理。营销型网站的优势是能够根据用户设备显示端的尺寸不同,自动调整济宁建站的显示方式,使网站能够适用不同显示终端,在浏览器中调整网站的宽度,无论在任何一种浏览器上浏览网站,都能展现优雅布局与设计,从而大程度地提升浏览体验。创新互联公司从事“济宁网站设计”,“济宁网站推广”以来,每个客户项目都认真落实执行。
存储节点包含Cinder,Swift等服务
主 机 | 系 统 | IP地址 | 角 色 |
---|---|---|---|
controller | CentOS7 | 192.168.37.128 | keystone、nova、glance、neutron、horizon、cinder、ntp、mariadb、rabbitmq、memcached、etcd、apache |
compute | CentOS7 | 192.168.37.130 | nova、neutron、ntp |
cinder | CentOS7 | 192.168.37.131 | cinder、ntp |
++安装和配置Cinder节点++
1、添加、新建一块磁盘sdb
fdisk /dev/sdb
2、创建LVM物理逻辑卷/dev/sdb1
pvcreate /dev/sdb1
3、创建cinder-volumes逻辑卷组
vgcreate cinder-volumes /dev/sdb1
4、yum安装cinder软件包
yum install openstack-cinder targetcli python-keystone -y
5、编辑配置文件
vim /etc/cinder/cinder.conf
[DEFAULT]
#1302
transport_url = rabbit://openstack:123456@controller
#399
auth_strategy = keystone
#291
my_ip = 192.168.175.155
#403
enabled_backends = lvm #支持格式
#296
glance_api_servers = http://controller:9292
[database]
#3586
connection = MySQL+pymysql://cinder:123456@controller/cinder
[keystone_authtoken]
#3850
auth_uri = http://controller:5000
auth_url = http://controller:35357
#3901
memcached_servers = controller:11211
#4008
auth_type = password
project_domain_id = default
user_domain_id = default
project_name = service
username = cinder
password = 123456
[oslo_concurrency]
#4125
lock_path = /var/lib/cinder/tmp
#末尾添加[lvm] 模块,使用LVM驱动程序,cinder-volumes卷组,iSCSI协议和相应的iSCSI服务配置LVM后端。
[lvm]
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volume_group = cinder-volumes
iscsi_protocol = iscsi
iscsi_helper = lioadm
6、开启cinder服务,设置开机自启动
systemctl enable openstack-cinder-volume.service target.service
systemctl start openstack-cinder-volume.service target.service
++安装和配置controller节点++
1、配置数据库
mysql -u root -p
create database cinder;
grant all privileges on cinder. to 'cinder'@'localhost' identified by '123456';
grant all privileges on cinder. to 'cinder'@'%' identified by '123456';
2、创建用户cinder
source ~/admin-openrc
openstack user create --domain default --password-prompt cinder
密码:123456
3、添加角色
openstack role add --project service --user cinder admin
4、创建cinderv2和cinderv3服务实体
openstack service create --name cinderv2 --description "OpenStack Block Storage" volumev2
openstack service create --name cinderv3 --description "OpenStack Block Storage" volumev3
5、创建块存储服务API
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
6、安装cinder软件包
yum install openstack-cinder -y
7、编辑配置文件
vim /etc/cinder/cinder.conf
[database]
#3586
connection = mysql+pymysql://cinder:123456@controller/cinder
[DEFAULT]
#1302
transport_url = rabbit://openstack:123456@controller
#399
auth_strategy = keystone
#291
my_ip = 192.168.175.145
[keystone_authtoken]
#3850
auth_uri = http://controller:5000
auth_url = http://controller:35357
#3901
memcached_servers = controller:11211
#4008
auth_type = password
project_domain_id = default
user_domain_id = default
project_name = service
username = cinder
password = 123456
[oslo_concurrency]
#4126
lock_path = /var/lib/cinder/tmp
8、同步数据库
su -s /bin/sh -c "cinder-manage db sync" cinder
9、编辑nova配置文件
vim /etc/nova/nova.conf
[cinder]
#4237
os_region_name = RegionOne
10、重启openstack-nova-api服务,开启cinder服务
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
11、查看用户cinder
12、查看服务实体
到此为止,cinder组件部分已部署完整,谢谢阅读!