一 简单架构图示参考

更新中...

二 部署glance

yum install memcached python-memcached
systemctl enable memcached.service
systemctl start memcached.service

step 1:glance关于数据库的操作

mysql -u root -p #登入数据库
CREATE DATABASE glance; #新建库keystone
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' \
IDENTIFIED BY ''; #新建本地访问glance库的账号
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' \
IDENTIFIED BY ''; #新建远程访问glance库的账号

step 2:glance关于keystone的操作

soure admin-openrc #执行管理员脚本
#为glance的使用者创建用户
openstack user create --domain default --password-prompt glance #对glance-service添加role角色,提示:用户glance只有在一个确定的项目service内才有角色的概念,单独的用户或者单独的项目都是无法绑定角色的。
openstack role add --project service --user glance admin #创建glance服务的catalog:service+endpoint
openstack service create --name glance \
--description "OpenStack Image" image openstack endpoint create --region RegionOne \
image public http://192.168.31.57:9292
openstack endpoint create --region RegionOne \
image internal http://192.168.31.57:9292
openstack endpoint create --region RegionOne \
image admin http://192.168.31.57:9292

step 3:安装软件包

yum -y install openstack-glance

step 4:配置/etc/glance/glance.conf

大前提:每一条配置都应该新增到文件中,一定不要打开注释在原有的基础上修改。

创建本地存储:

1.一定要在opesntack-glance-api.service服务启动之前部署好存储设备,因为该服务在启动时会加载存储驱动检索存储设备,如果事先不存在,就意味着该服务没有识别到任何可用的存储设备,即便是后来你又新增了存储,仍然是无效的,最终导致你上传镜像失败;

2.一定要赋予opesntack-glance-api.service服务对存储设备的可写权限。

mkdir -p /var/lib/glance/images
chown -R glance.glance /var/lib/glance/images

配置/etc/glance/glance-api.conf

[database]
connection = mysql+pymysql://glance:123@192.168.31.57/glance [keystone_authtoken]
auth_uri = http://192.168.31.57:5000
auth_url = http://192.168.31.57:35357
memcached_servers = 192.168.31.57:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = glance
password = 123 [paste_deploy]
flavor = keystone [glance_store]
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images/

配置/etc/glance/glance-registry.conf

[database]
connection = mysql+pymysql://glance:123@192.168.31.57/glance [keystone_authtoken]
auth_uri = http://192.168.31.57:5000
auth_url = http://192.168.31.57:35357
memcached_servers = 192.168.31.57:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = glance
password = 123 [paste_deploy]
flavor = keystone

step 5: 初始化数据库glance

su -s /bin/sh -c "glance-manage db_sync" glance
'''
忽略以下打印,此乃正常性行为:
Option "verbose" from group "DEFAULT" is deprecated for removal. Its value may be silently ignored in the future.
/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py:1171:...... oslo_db.sqlalchemy.enginefacade
...... a future release.")
result = self._query(query)
'''

step 6:启动glance且设置开机启动

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

三 验证

source admin-openrc

#如果没有wget则必须yum -y install wget
wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img openstack image create "cirros" \
--file cirros-0.3.4-x86_64-disk.img \
--disk-format qcow2 --container-format bare \
--public openstack image list

For information about the openstack image create parameters, see Create or update an image (glance) in the OpenStack User Guide.

For information about disk and container formats for images, see Disk and container formatsfor images in the OpenStack Virtual Machine Image Guide.

glance系列二:glance部署及操作的更多相关文章

  1. Windows Azure入门教学系列 (二):部署第一个Web Role程序

    本文是Windows Azure入门教学的第二篇文章. 在第一篇教学中,我们已经创建了第一个Web Role程序.在这篇教学中,我们将学习如何把该Web Role程序部署到云端. 注意:您需要购买Wi ...

  2. Kafka系列二之部署与使用

    Kafka部署与使用 写在前面 从上一篇Kafka的架构介绍和安装中,可能,你还一直很蒙,kafka到底该怎么使用呢?接下来,我们就来介绍Kafka的部署与使用.上篇文章中我们说到,Kafka的几个重 ...

  3. openstack之glance部署及操作

    由于时间关系简单的架构图就先不展示了.后续的更新会贴上... 部署glance 安装memcache服务 yum install memcached python-memcached systemct ...

  4. glance系列一:glance基础

    一 什么是glance glance即image service,是为虚拟机的创建提供镜像的服务 二 为何要有glance 我们基于openstack是构建基本的Iaas平台对外提供虚拟机,而虚拟机在 ...

  5. MySQL 系列(二) 你不知道的数据库操作

    第一篇:MySQL 系列(一) 生产标准线上环境安装配置案例及棘手问题解决 第二篇:MySQL 系列(二) 你不知道的数据库操作 本章内容: 查看\创建\使用\删除 数据库 用户管理及授权实战 局域网 ...

  6. DocX开源WORD操作组件的学习系列二

    DocX学习系列 DocX开源WORD操作组件的学习系列一 : http://www.cnblogs.com/zhaojiedi1992/p/zhaojiedi_sharp_001_docx1.htm ...

  7. windows下mongodb基础玩法系列二CURD操作(创建、更新、读取和删除)

    windows下mongodb基础玩法系列 windows下mongodb基础玩法系列一介绍与安装 windows下mongodb基础玩法系列二CURD操作(创建.更新.读取和删除) windows下 ...

  8. Redis系列(二):Redis的数据类型及命令操作

    原文链接(转载请注明出处):Redis系列(二):Redis的数据类型及命令操作 Redis 中常用命令 Redis 官方的文档是英文版的,当然网上也有大量的中文翻译版,例如:Redis 命令参考.这 ...

  9. 5 云计算系列之glance镜像服务安装

    preface 在上节中我们了解了keystone服务,下面就看看glance管理镜像的服务吧. glance组成 glance有两部分组成: glance-api 接受云系统镜像的创建,删除,读取请 ...

随机推荐

  1. Spinner的简单使用

    <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android=&quo ...

  2. git上传中的排除的配置文件, git实际的操作代码;

    git上传中的排除的配置文件: git实际的操作 在主目录建立.gitignore文件并输入以下保存: *.class #package file *.war *.ear #kdiff3 ignore ...

  3. 没有服务商如何购买ERP的序列号?

    一.试用期(未过期) 站点版购买: 门店版购买: 二.试用期(使用时间<=15天) 三.试用期(已过期) 登录时会弹出以下弹窗 剩下的购买步骤与未过期时购买步骤一致 四.续费 剩下步骤与未过期时 ...

  4. Scrapy实现腾讯招聘网信息爬取【Python】

    一.腾讯招聘网 二.代码实现 1.spider爬虫 # -*- coding: utf-8 -*- import scrapy from Tencent.items import TencentIte ...

  5. mysql----Nested SELECT Quiz

     Nested SELECT quiz bbc name region area population gdp Afghanistan South Asia 652225 26000000   Alb ...

  6. MyBatis笔记----(2017年)最新的报错:Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name 'dataSource' defined in class path resource [com/ij34/mybatis/applicationContext.xml]; nested e

    四月 05, 2017 4:56:11 下午 org.springframework.context.support.ClassPathXmlApplicationContext prepareRef ...

  7. jsp include 报错:illegal to have multiple occurrences of contentType with different values (old: text/html; charset=UTF-8, new: text/html; carset=UTF-8)

    严重: Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: /jsp.jsp(1, ...

  8. SQL Server基础之表级触发器

    触发器分为两种,一种与数据表绑定,响应数据表指定动作(insert.delete或update),此处称为表级:一种与数据库本身绑定,响应数据定义语句(主要是CREATE.ALTER 和 DROP 开 ...

  9. Jenkins2.32用户和权限管理策略

    前言 在使用jenkins的过程中,需要为不同的角色分配相应的权限,如果jenkins的用户数据能和公司现在的帐号系统结合起来那会更好. 关于如何为用户分组,我推荐使用 role based auth ...

  10. perl语言中的.pm文件和.pl文件区别

    perl...呵呵呵 按照惯例,.pm 应该保存 Perl Module,也就是 Perl 模块.例如 Socket.pm.pl 应该保存 Perl Library,也就是 Perl 库文件.例如 p ...