四:OPENSTACK Queens部署glance服务
Posted MisterChen
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了四:OPENSTACK Queens部署glance服务相关的知识,希望对你有一定的参考价值。
备注:在控制节点操作
创建数据库以及用户
[root@controller ~]# mysql -u root -p
create database glance;
GRANT ALL PRIVILEGES ON glance.* TO'glance'@'localhost' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY '123456';
使用admin环境变量,创建glance用户
[root@controller ~]# . admin_src
[root@controller ~]# openstack user create --domain default --password-prompt glance
将glance加入server服务和admin用户
[root@controller ~]# openstack role add --project service --user glance admin
创建glance项目和对外API接口
[root@controller ~]# openstack service create --name glance --description "OpenStack Image" image
[root@controller ~]# openstack endpoint create --region RegionOne image public http://controller:9292
[root@controller ~]#openstack endpoint create --region RegionOne image internal http://controller:9292
[root@controller ~]# openstack endpoint create --region RegionOne image admin http://controller:9292
安装glance软件包
[root@controller ~]# yum install -y openstack-glance
编辑配置文件glance-api.conf
[root@controller ~]# vim /etc/glance/glance-api.conf
[database]
connection = mysql+pymysql://glance:123456@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 = 123456
[paste_deploy]
flavor = keystone
[glance_store]
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images/
编辑配置文件glance-registry.conf
[root@controller ~]# vim /etc/glance/glance-registry.conf
[database]
connection = mysql+pymysql://glance:123456@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 = 123456
同步数据库
[root@controller ~]# su -s /bin/sh -c "glance-manage db_sync" glance
启动服务
[root@controller ~]# systemctl enable openstack-glance-api.service openstack-glance-registry.service
[root@controller ~]# systemctl start openstack-glance-api.service openstack-glance-registry.service
下载一个镜像,测试上传看是否成功
[root@controller ~]# wget http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img
[root@controller ~]# openstack image create "cirros" --file cirros-0.3.5-x86_64-disk.img --disk-format qcow2 --container-format bare --public
[root@controller ~]# openstack image list
以上是关于四:OPENSTACK Queens部署glance服务的主要内容,如果未能解决你的问题,请参考以下文章
OpenStack 运维 - 部署Glance组件 [T版]
OpenStack 运维 - 部署Glance组件 [Tarin版]