您好,登录后才能下订单哦!
整个OpenStack是由控制节点,计算节点,网络节点,存储节点四大部分组成。上篇博文详细讲述了控制节点服务controller中的horizon组件,本篇博文将详解存储节点cinder的部署。分为两部分:控制节点和存储节点
存储节点包含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组件部分已部署完整,谢谢阅读!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。