(Iv) OpenStack --- M --- dual node version Installation and Configuration build the Glance ---

↓↓↓↓↓↓↓↓ video on line B station has ↓↓↓↓↓↓↓↓

"" "" "" Portal

1. Create a database glance

2. Obtain admin credentials to get the command can be executed only administrators access

3. Create a service card number, create users, add character to the project

4. Create the image of the service API endpoint

5. Glance installation package, and configure

6. Synchronize Database Service

7. Start the mirroring service and set the boot

8. Verify operation, image uploaded

1. Create a database glance

# mysql -uroot -p000000
>create database glance;
> grant all privileges on glance.* to 'glance'@'localhost' identified by '000000';
> grant all privileges on glance.* to 'glance'@'%' identified by '000000';

Here Insert Picture Description

2. Obtain admin credentials to get the command can be executed only administrators access

# . /root/admin-openrc

Here Insert Picture Description

3. Create a service card number, create users, add character to the project

创建 glance 用户
#openstack user create --domain default --password 000000 glance

添加 admin 角色到 glance 用户和 service 项目上
#openstack role add --project service --user glance admin

创建 glance 服务实体:
#openstack service create --name glance --description "OpenStack Image" image

Here Insert Picture Description

4. Create the image of the service API endpoint

#openstack endpoint create --region RegionOne image public http://controller:9292
#openstack endpoint create --region RegionOne image internal http://controller:9292
#openstack endpoint create --region RegionOne image admin http://controller:9292

Here Insert Picture Description
Here Insert Picture Description

5. Glance installation package, and configure

Installation package

#yum -y install openstack-glance

1. Edit the file /etc/glance/glance-api.conf

#vi /etc/glance/glance-api.conf
在[database]下添加
connection = mysql+pymysql://glance:000000@controller/glance

在[keystone_authtoken]下添加
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = 000000 #此处六个零为之前创建的glance用户密码

在[paste_deploy]下添加
flavor = keystone

在[glance_store]下添加,配置本地文件系统存储和镜像文件位置
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images/

Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description

2. Edit the file /etc/glance/glance-registry.conf

#vi /etc/glance/glance-registry.conf
在[database]下,添加
connection = mysql+pymysql://glance:000000@controller/glance

在 [keystone_authtoken]下,配置认证服务访问:
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = 000000

在[paste_deploy]下添加
flavor = keystone

Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description

6. Synchronize Database Service

# su -s /bin/sh -c "glance-manage db_sync" glance

Here Insert Picture Description

7. Start the mirroring service and set the boot

#systemctl start openstack-glance-api.service openstack-glance-registry.service
#systemctl enable openstack-glance-api.service openstack-glance-registry.service

8. Verify operation, image uploaded

# . /root/admin-openrc
# glance image-create --name cirros --disk-format qcow2 --container-format bare --progress < /opt/mitaka/image/cirros-0.3.4-x86_64-disk.img
# openstack image list

Here Insert Picture Description
Here Insert Picture Description

Guess you like

Origin www.cnblogs.com/zhijian1574/p/11956834.html