Openstack架构构建及详解(7)--Cinder组件,mybatis原理

wuchangjian2021-11-09 13:25:34编程学习

MariaDB [(none)]> GRANT ALL PRIVILEGES ON cinder.* TO ‘cinder’@‘localhost’ IDENTIFIED BY ‘CINDER_DBPASS’;

Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON cinder.* TO ‘cinder’@’%’ IDENTIFIED BY ‘CINDER_DBPASS’;

Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit

Bye

[root

【一线大厂Java面试题解析+后端开发学习笔记+最新架构讲解视频+实战项目源码讲义】

浏览器打开:qq.cn.hn/FTf 免费领取

@controller ~]# source admin-openrc.sh

[root@controller ~]# keystone user-create --name cinder --pass CINDER_PASS

±---------±---------------------------------+

| Property | Value |

±---------±---------------------------------+

| email | |

| enabled | True |

| id | 81e66a4390474085a9d6eec0498ecbc9 |

| name | cinder |

| username | cinder |

±---------±---------------------------------+

[root@controller ~]# keystone user-role-add --user cinder --tenant service --role admin

[root@controller ~]# keystone service-create --name cinder --type volume --description “OpenStackBlock Storage”

±------------±---------------------------------+

| Property | Value |

±------------±---------------------------------+

| description | OpenStackBlock Storage |

| enabled | True |

| id | e34f25886150411880594b87633536c8 |

| name | cinder |

| type | volume |

±------------±---------------------------------+

[root@controller ~]# keystone service-create --name cinderv2 --type volumev2 --description “OpenStackBlock Storage”

±------------±---------------------------------+

| Property | Value |

±------------±---------------------------------+

| description | OpenStackBlock Storage |

| enabled | True |

| id | d5d4326f4fa14a1f960caed8af2d1ff1 |

| name | cinderv2 |

| type | volumev2 |

±------------±---------------------------------+

[root@controller ~]# keystone endpoint-create --service-id $(keystone service-list | awk ‘/ volume /{print $2}’) --publicurl http://controller.nice.com:8776/v1/%(tenant_id)s --internalurl http://controller.nice.com:8776/v1/%(tenant_id)s --adminurl http://controller.nice.com:8776/v1/%(tenant_id)s --region regionOne

±------------±-------------------------------------------------+

| Property | Value |

±------------±-------------------------------------------------+

| adminurl | http://controller.nice.com:8776/v1/%(tenant_id)s |

| id | 4262968b5b60490583dd4305b02257a6 |

| internalurl | http://controller.nice.com:8776/v1/%(tenant_id)s |

| publicurl | http://controller.nice.com:8776/v1/%(tenant_id)s |

| region | regionOne |

| service_id | e34f25886150411880594b87633536c8 |

±------------±-------------------------------------------------+

[root@controller ~]# keystone endpoint-create \

–service-id $(keystone service-list | awk ‘/ volumev2 / {print $2}’) \

–publicurl http://controller.nice.com:8776/v2/%(tenant_id)s \

–internalurl http://controller.nice.com:8776/v2/%(tenant_id)s \

–adminurl http://controller.nice.com:8776/v2/%(tenant_id)s \

–region regionOne

±------------±-------------------------------------------------+

| Property | Value |

±------------±-------------------------------------------------+

| adminurl | http://controller.nice.com:8776/v2/%(tenant_id)s |

| id | c1b8efc1f40048fa89ef5d7961d1b7da |

| internalurl | http://controller.nice.com:8776/v2/%(tenant_id)s |

| publicurl | http://controller.nice.com:8776/v2/%(tenant_id)s |

| region | regionOne |

| service_id | d5d4326f4fa14a1f960caed8af2d1ff1 |

±------------±-------------------------------------------------+

在这里插入图片描述在这里插入图片描述

2、配置block节点

[root@block1 ~]# yum install -y ntpdate

[root@block1 ~]# ntpdate -u controller.nice.com

24 Jul 09:07:13 ntpdate[11003]: step time server 192.168.222.5 offset 9415.809954 sec

[root@block1 ~]# crontab -e

分钟,小时,日,月,周,年

*/1 * * * * ntpdate -u controller.nice.com &> /dev/null

[root@block1 ~]# systemctl restart crond

[root@block1 ~]# systemctl enable crond

[root@block ~]# pvcreate /dev/sdb

[root@block ~]# vgcreate cinder-volumes /dev/sdb

在这里插入图片描述在这里插入图片描述在这里插入图片描述

[root@block ~]# systemctl enable openstack-cinder-volume.service target.service

ln -s ‘/usr/lib/systemd/system/openstack-cinder-volume.service’ ‘/etc/systemd/system/multi-user.target.wants/openstack-cinder-volume.service’

ln -s ‘/usr/lib/systemd/system/target.service’ ‘/etc/systemd/system/multi-user.target.wants/target.service’

[root@block ~]# systemctl start openstack-cinder-volume.service target.service

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。