镜像服务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. 【BZOJ3831】[Poi2014]Little Bird 单调队列

    [BZOJ3831][Poi2014]Little Bird Description In the Byteotian Line Forest there are   trees in a row. ...

  2. linux下如何启动nginx?

    命令: /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf ........... [root@localhost sbin ...

  3. 简单的纯css重置input单选多选按钮的样式--利用伪类

    由于input单选多选的原生样式通常都不符合需求,所以在实现功能时通常都需要美化按钮 html <input type="radio" /> <input typ ...

  4. PAT 甲级 1104 sum of Number Segments

    1104. Sum of Number Segments (20) 时间限制 200 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CAO, Pen ...

  5. Socket连接何时需要断开

    socket连接没有正常断开,导致无法下次无法进行连接.

  6. Python实现HMM(隐马尔可夫模型)

    1. 前言 隐马尔科夫HMM模型是一类重要的机器学习方法,其主要用于序列数据的分析,广泛应用于语音识别.文本翻译.序列预测.中文分词等多个领域.虽然近年来,由于RNN等深度学习方法的发展,HMM模型逐 ...

  7. python基础-第五篇-5.3装饰器

    小白发呆的看着窗外,同事们陆陆续续的地来到公司,想起算法,小白就飘飘然了.突然后面传来一声呼唤,原来是小刘! 小刘:不好意思啊!堵车了,就来晚了点,不耽误你的时间,咱们就开启的今天的培训内容吧! 小白 ...

  8. mysql设置远程访问之后 远程访问非常缓慢 解决办法!

    在mysql配置文件的 选项下添加设置. [mysqld] skip-name-resolve skip-name-resolve

  9. J.U.C Atomic(二)基本类型原子操作

    java.util.concurrent.atomic包中对基本类型进行原子操作的类有:AtomicInteger.AtomicBoolean.AtomicLong. 下面通过一个测试程序来验证一下A ...

  10. 闪回事务(Flashback Transaction)

    到目前为止,介绍的所有功能均不会直接将数据恢复为“以前”的样子.闪回查询只是查看,闪回数据归档只是延伸了闪回查询的时间窗口,闪回事务查询虽然提供了撤销SQL,但是否执行及如何执行还需要管理员进一步手动 ...