镜像服务image service(glance)的安装还是在控制节点上进行:

1、前提条件,数据库为glance创建库和账户密码来连接数据库
# mysql -u root -p
MariaDB [(none)]> CREATE DATABASE glance;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY 'glance';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%'IDENTIFIED BY 'glance';

2、在为glance在keystone上创建用户项目等时,需要先连接keystone,这里使用keystone的admin账号来登录

# source  admin-openrc

然后在创建glance用户:

# openstack user create --domain default --password-prompt glance

输入密码:glance

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

为glance创建服务实体:

# openstack service create --name glance --description "OpenStack Image" image

为镜像服务创建API endpoints:
# openstack endpoint create --region RegionOne image public http://192.168.101.10:9292
# openstack endpoint create --region RegionOne image internal http://192.168.101.10:9292
# openstack endpoint create --region RegionOne image admin http://192.168.101.10:9292

安装和配置glance:

# yum install openstack-glance

修改配置文件:/etc/glance/glance-api.conf,在[database]部分:

connection = mysql+pymysql://glance:glance@192.168.101.10/glance

在[keystone_authtoken]和[paste_deploy]分别做如下设置:

[keystone_authtoken]
auth_uri = http://192.168.101.10:5000
auth_url = http://192.168.101.10:35357
memcached_servers = 192.168.101.10:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = glance [paste_deploy]
flavor = keystone

在[glance_store]部分设置一个本地文件系统用来存储本地镜像:

[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:glance@192.168.101.10/glance

在[keystone_authtoken]和[paste_deploy]配置如下内容:

[keystone_authtoken]
auth_uri = http://192.168.101.10:5000
auth_url = http://192.168.101.10:35357
memcached_servers = 192.168.101.10:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = glance [paste_deploy]
flavor = keystone

向glance库导入填充数据:

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

  Ignore any deprecation messages in this output.

验证glance是否有table?

最后开启glance服务:
# systemctl enable openstack-glance-api.service openstack-glance-registry.service
# systemctl start openstack-glance-api.service openstack-glance-registry.service

校验glance:校验image service是否安装成功?

# source admin-openrc
# wget http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img
# openstack image create "cirros" --file cirros-0.3.5-x86_64-disk.img --disk-format qcow2 --container-format bare --public

上传镜像到镜像服务上,使用格式qcow2磁盘格式,权限为public,所有的项目都能访问它

# openstack image list    查看镜像列表

至此glance的image service组件安装成功

贴出glance两个配置文件的配置:

1、/etc/glance/glance-api.conf

[root@node1 ~]# egrep -v "^$|^#" /etc/glance/glance-api.conf
[DEFAULT]
[cors]
[database]
connection = mysql+pymysql://glance:glance@192.168.101.10/glance
[glance_store]
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images/
[image_format]
[keystone_authtoken]
auth_uri = http://192.168.101.10:5000
auth_url = http://192.168.101.10:35357
memcached_servers = 192.168.101.10:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = glance
[matchmaker_redis]
[oslo_concurrency]
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_messaging_zmq]
[oslo_middleware]
[oslo_policy]
[paste_deploy]
flavor = keystone
[profiler]
[store_type_location_strategy]
[task]
[taskflow_executor]

2、配置文件/etc/glance/glance-registry.conf

[root@node1 ~]# egrep -v "^$|^#" /etc/glance/glance-registry.conf
[DEFAULT]
[database]
connection = mysql+pymysql://glance:glance@192.168.101.10/glance
[keystone_authtoken]
auth_uri = http://192.168.101.10:5000
auth_url = http://192.168.101.10:35357
memcached_servers = 192.168.101.10:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = glance
[matchmaker_redis]
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_messaging_zmq]
[oslo_policy]
[paste_deploy]
flavor = keystone
[profiler]

照着官网来安装openstack pike之glance安装的更多相关文章

  1. 照着官网来安装openstack pike之nova安装

    nova组件安装分为控制节点和计算节点,还是先从控制节点安装 1.前提条件,数据库为nova创建库和账户密码来连接数据库 # mysql -u root -p MariaDB [(none)]> ...

  2. 照着官网来安装openstack pike之keystone安装

    openstack基础环境安装完成后,现在开启安装keystone服务(在控制节点上执行下面所有操作) 1.为keystone创建数据库 mysql -u root -p MariaDB [(none ...

  3. 照着官网来安装openstack pike之neutron安装

    neutron组件安装分为控制节点和计算节点,还是先从控制节点安装 1.前提条件,数据库为nova创建库和账户密码来连接数据库 # mysql -u root -p MariaDB [(none)]& ...

  4. 照着官网来安装openstack pike之创建并启动instance

    有了之前组件(keystone.glance.nova.neutron)的安装后,那么就可以在命令行创建并启动instance了 照着官网来安装openstack pike之environment设置 ...

  5. openstack pike 单机 一键安装 shell

    #openstack pike 单机  centos 一键安装 shell #openstack pike 集群高可用  安装部署 汇总 http://www.cnblogs.com/elvi/p/7 ...

  6. 照着官网来安装openstack pike之environment设置

    安装openstack前的准备环境: 两个centos7系统的环境:192.168.101.10 node1,192.168.101.11 node2 控制节点node1,计算节点node2 1.统一 ...

  7. 照着官网来安装openstack pike之安装dashboard

    上文提到了利用命令行下使用openstack的命令来创建虚拟机,这里选择安装dashboard来安装基于web界面的openstack平台 利用dashboard界面来创建虚拟机 dashboard这 ...

  8. Devstack 安装OpenStack Pike版本(单机环境)

    问题背景 最近在研究OpenStack的时候,需要对其源代码进行调试,公司服务器上部署的OpenStack环境又不能随意的进行折腾,为了研究的持续性和方便性,就决定再自己的虚拟机上面使用Devstac ...

  9. CentOS7安装OpenStack(Rocky版)-05.安装一个nova计算节点实例

    上一篇文章分享了控制节点的nova计算服务的安装方法,在实际生产环境中,计算节点通常会安装一些单独的节点提供服务,本文分享单独的nova计算节点的安装方法 ----------------  完美的分 ...

随机推荐

  1. 目前最火的php框架

    1.yii 作者:宗霖链接:https://www.zhihu.com/question/25023032/answer/75085250来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业 ...

  2. python--常用的十进制、16进制、字符串、字节串之间的转换

      进行协议解析时,总是会遇到各种各样的数据转换的问题,从二进制到十进制,从字节串到整数等等 整数之间的进制转换: 10进制转16进制: hex(16)  ==>  0x10 16进制转10进制 ...

  3. Python全栈day20(装饰器基本理论)

    一,什么是装饰器 装饰器:本质就是函数,功能是为其他函数添加附加功能 原则 1,不修改被修饰函数的源代码 2,不修改被修饰函数的调用方式 举例说明:有一个求和函数要求就算出函数的运行时间 正常代码应该 ...

  4. poj2826 An Easy Problem?!【计算几何】

    含[三点坐标计算面积].[判断两线段是否有交点].[求线段交点]模板   An Easy Problem?! Time Limit: 1000MS   Memory Limit: 65536K Tot ...

  5. http协议----->请求头和响应头

    http实用头字段-----Range 如果请求里有这个range头,那么响应里也有 1.首先在webroot下放好a.txt 内容如下: 2.然后在本地有个下载未完成的a.txt 本地a.txt内容 ...

  6. 牛客网_Wannafly模拟赛1

    A.矩阵 题目链接:https://www.nowcoder.com/acm/contest/submit/f8363c912a4c48a28b80f47e7102b6b8?ACMContestId= ...

  7. C#网页单页小偷源码

    这个软件是因为工作需要(偷模版哈哈)而专门对这个网站(cainiaoapp.cn)定制开发的单页小偷软件,因为仅仅是满足我个人的使用需求,没完善,比如CSS里面的图片不会判断下载,只下载http:// ...

  8. python的@classmethod和@staticmethod

    本文是对StackOverflow上的一篇高赞回答的不完全翻译,原文链接:meaning-of-classmethod-and-staticmethod-for-beginner Python面向对象 ...

  9. 转载(web app变革之rem)

    rem这是个低调的css单位,近一两年开始崭露头角,有许多同学对rem的评价不一,有的在尝试使用,有的在使用过程中遇到坑就弃用了.但是我对rem综合评价是用来做web app它绝对是最合适的人选之一. ...

  10. ssh无密码登录设置

    为啥要设置ssh无密码登录? 我们先来看一下分布式系统的一键启动流程, 在matser机器上运行脚本,脚本检测有多少slavers,然后通过ssh登录到slavers,进入到相同的目录(或者通过$XX ...