Glance安装以及验证

Glance安装以及验证一 Glance 搭建步骤 1 安装 Glance 包 2 初始化数据库 3 配置 Glance nbsp nbsp 数据库 nbsp nbsp keystone 认证信息 4 启动 Glance 二验证 keystone 可用 root controller0 keystonerc root controller0 keystonetoke get 如果输出正常 则 keystone 正常 三安装 Glance 包 root c

一 Glance搭建步骤
1 安装Glance包
2 初始化数据库
3 配置Glance
    数据库
    keystone认证信息
4 启动Glance

二 验证keystone可用
[root@controller0 ~]# . keystonerc [root@controller0 ~]# keystone token-get
如果输出正常,则keystone正常。

三 安装Glance包
[root@controller0 ~]# yum install openstack-glance python-glanceclient -y


四 配置Glance连接数据库
[root@controller0 ~]# openstack-config --set /etc/glance/glance-api.conf DEFAULT sql_connection mysql://glance:openstack@controller0/glance [root@controller0 ~]# openstack-config --set /etc/glance/glance-registry.conf DEFAULT sql_connection mysql://glance:openstack@controller0/glance


五 初始化Glance 数据库
[root@controller0 ~]# openstack-db --init --service glance --password openstack Please enter the password for the 'root' MySQL user: Verified connectivity to MySQL. Creating 'glance' database. Updating 'glance' database password in /etc/glance/glance-registry.conf /etc/glance/glance-api.conf Initializing the glance database, please wait... /usr/lib64/python2.6/site-packages/Crypto/Util/number.py:57: PowmInsecureWarning: Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability. _warn("Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.", PowmInsecureWarning) Complete!


六 创建glance用户
[root@controller0 ~]# keystone user-create --name=glance --pass=glance --email= +----------+----------------------------------+ | Property | Value | +----------+----------------------------------+ | email |  | | enabled | True | | id | e9f8d113c0c341a2b7d81099f004c122 | | name | glance | | username | glance | +----------+----------------------------------+ [root@controller0 ~]# keystone user-list +----------------------------------+--------+---------+--------------------+ | id | name | enabled | email | +----------------------------------+--------+---------+--------------------+ | 6efb8d6615b84cacb7cbdf0591a66bb7 | admin | True |  | | e9f8d113c0c341a2b7d81099f004c122 | glance | True |  | +----------------------------------+--------+---------+--------------------+


七 分配角色
[root@controller0 ~]# keystone user-role-add --user=glance --tenant=service --role=admin


八 创建glance服务
[root@controller0 ~]# keystone service-create --name=glance --type=image --description="Glance Image Service" +-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | description | Glance Image Service | | enabled | True | | id | 04555caea1674cc0bc17e69fa0f9ff38 | | name | glance | | type | image | +-------------+----------------------------------+ [root@controller0 ~]# keystone service-list +----------------------------------+----------+----------+---------------------------+ | id | name | type | description | +----------------------------------+----------+----------+---------------------------+ | 04555caea1674cc0bc17e69fa0f9ff38 | glance | image | Glance Image Service | | b8860e4213ef4b828e5c81b1b9e4d0bb | keystone | identity | Keystone Identity Service | +----------------------------------+----------+----------+---------------------------+


九 创建keystone的endpoint
[root@controller0 ~]# keystone endpoint-create \ > --service-id=$(keystone service-list | awk '/ image / {print $2}') \ > --publicurl=http://controller0:9292 \ > --internalurl=http://controller0:9292 \ > --adminurl=http://controller0:9292 +-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | adminurl | http://controller0:9292 | | id | 6be86cd7eaf94f3a90b5664a | | internalurl | http://controller0:9292 | | publicurl | http://controller0:9292 | | region | regionOne | | service_id | 04555caea1674cc0bc17e69fa0f9ff38 | +-------------+----------------------------------+ [root@controller0 ~]# keystone endpoint-list +----------------------------------+-----------+------------------------------+------------------------------+-------------------------------+----------------------------------+ | id | region | publicurl | internalurl | adminurl | service_id | +----------------------------------+-----------+------------------------------+------------------------------+-------------------------------+----------------------------------+ | 08feefcf9185e748d14d9214 | regionOne | http://controller0:5000/v2.0 | http://controller0:5000/v2.0 | http://controller0:35357/v2.0 | b8860e4213ef4b828e5c81b1b9e4d0bb | | 6be86cd7eaf94f3a90b5664a | regionOne | http://controller0:9292 | http://controller0:9292 | http://controller0:9292 | 04555caea1674cc0bc17e69fa0f9ff38 | +----------------------------------+-----------+------------------------------+------------------------------+-------------------------------+----------------------------------+


十 修改glance api和register相关配置
openstack-config --set /etc/glance/glance-api.conf DEFAULT debug True openstack-config --set /etc/glance/glance-api.conf DEFAULT verbose True openstack-config --set /etc/glance/glance-api.conf keystone_authtoken auth_uri http://controller0:5000 openstack-config --set /etc/glance/glance-api.conf keystone_authtoken auth_host controller0 openstack-config --set /etc/glance/glance-api.conf keystone_authtoken auth_port 35357 openstack-config --set /etc/glance/glance-api.conf keystone_authtoken auth_protocol http openstack-config --set /etc/glance/glance-api.conf keystone_authtoken admin_tenant_name service openstack-config --set /etc/glance/glance-api.conf keystone_authtoken admin_user glance openstack-config --set /etc/glance/glance-api.conf keystone_authtoken admin_password glance openstack-config --set /etc/glance/glance-api.conf paste_deploy flavor keystone openstack-config --set /etc/glance/glance-registry.conf DEFAULT debug True openstack-config --set /etc/glance/glance-registry.conf DEFAULT verbose True openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken auth_uri http://controller0:5000 openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken auth_host controller0 openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken auth_port 35357 openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken auth_protocol http openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken admin_tenant_name service openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken admin_user glance openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken admin_password glance openstack-config --set /etc/glance/glance-registry.conf paste_deploy flavor keystone


十一 启动相关服务
[root@controller0 ~]# service openstack-glance-api start Starting openstack-glance-api: [ OK ] [root@controller0 ~]# service openstack-glance-registry start Starting openstack-glance-registry: [ OK ] [root@controller0 ~]# chkconfig openstack-glance-api on [root@controller0 ~]# chkconfig openstack-glance-registry on [root@controller0 ~]# ps -ef|grep glance glance 2979 1 0 11:15 ? 00:00:00 /usr/bin/python /usr/bin/glance-api glance 2987 2979 0 11:15 ? 00:00:00 /usr/bin/python /usr/bin/glance-api glance 3009 1 1 11:16 ? 00:00:00 /usr/bin/python /usr/bin/glance-registry glance 3015 3009 0 11:16 ? 00:00:00 /usr/bin/python /usr/bin/glance-registry root 3022 2207 0 11:17 pts/0 00:00:00 grep glance [root@controller0 ~]# cat /var/log/glance/api.log [root@controller0 ~]# cat /var/log/glance/registry.log


十二 验证
1 准备Cirros
[root@controller0 ~]# ll cirros-0.3.2-x86_64-disk.img -rw-r--r-- 1 root root  Feb 25 11:31 cirros-0.3.2-x86_64-disk.img
2 安装镜像
[root@controller0 ~]# glance image-create --progress --name="CirrOS 0.3.1" --disk-format=qcow2 --container-format=ovf --is-public=true < cirros-0.3.2-x86_64-disk.img [=============================>] 100% +------------------+--------------------------------------+ | Property | Value | +------------------+--------------------------------------+ | checksum | 64d7c1cd2b6f60c92ccb7913 | | container_format | ovf | | created_at | 2018-02-25T03:35:29 | | deleted | False | | deleted_at | None | | disk_format | qcow2 | | id | 2e4303e2-ac60-45ba-af59-aefb57 | | is_public | True | | min_disk | 0 | | min_ram | 0 | | name | CirrOS 0.3.1 | | owner | 4e845b494bf74cbf89213bf552db8599 | | protected | False | | size |  | | status | active | | updated_at | 2018-02-25T03:35:30 | | virtual_size | None | +------------------+--------------------------------------+ [root@controller0 ~]# glance image-list +--------------------------------------+--------------+-------------+------------------+----------+--------+ | ID | Name | Disk Format | Container Format | Size | Status | +--------------------------------------+--------------+-------------+------------------+----------+--------+ | 2e4303e2-ac60-45ba-af59-aefb57 | CirrOS 0.3.1 | qcow2 | ovf |  | active | +--------------------------------------+--------------+-------------+------------------+----------+--------+ [root@controller0 ~]# glance image-show 2e4303e2-ac60-45ba-af59-aefb57 /usr/lib64/python2.6/site-packages/Crypto/Util/number.py:57: PowmInsecureWarning: Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability. _warn("Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.", PowmInsecureWarning) +------------------+--------------------------------------+ | Property | Value | +------------------+--------------------------------------+ | checksum | 64d7c1cd2b6f60c92ccb7913 | | container_format | ovf | | created_at | 2018-02-25T03:35:29 | | deleted | False | | disk_format | qcow2 | | id | 2e4303e2-ac60-45ba-af59-aefb57 | | is_public | True | | min_disk | 0 | | min_ram | 0 | | name | CirrOS 0.3.1 | | owner | 4e845b494bf74cbf89213bf552db8599 | | protected | False | | size |  | | status | active | | updated_at | 2018-02-25T03:35:30 | +------------------+--------------------------------------+ [root@controller0 ~]# glance member-add 2e4303e2-ac60-45ba-af59-aefb57 6efb8d6615b84cacb7cbdf0591a66bb7 [root@controller0 ~]# glance member-list --image-id 2e4303e2-ac60-45ba-af59-aefb57 +--------------------------------------+----------------------------------+-----------+ | Image ID | Member ID | Can Share | +--------------------------------------+----------------------------------+-----------+ | 2e4303e2-ac60-45ba-af59-aefb57 | 6efb8d6615b84cacb7cbdf0591a66bb7 | | +--------------------------------------+----------------------------------+-----------+



版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/232817.html原文链接:https://javaforall.net

(0)
上一篇 2025年9月12日 上午9:01
下一篇 2025年9月12日 上午9:22


相关推荐

  • goland2021破解激活码【在线注册码/序列号/破解码】「建议收藏」

    goland2021破解激活码【在线注册码/序列号/破解码】,https://javaforall.net/100143.html。详细ieda激活码不妨到全栈程序员必看教程网一起来了解一下吧!

    2022年3月20日
    122
  • 如何mock数据

    如何mock数据如何 mock 数据在之前前后端不分离的情况下 很多时候都要等到后端写好接口 前端很多功能才能开发 而前后端分离 前端无需等待 可以与后端并行开发 前端需要的数据可以 mock 出来 利用 nodejs 再生成接口 可以直接调用 等后端开发出接口再来更换 在 build 的 webpack dev conf js 里修改 1 导入 expressconst require express

    2026年3月20日
    3
  • MyEclipse+Tomcat配置详解[通俗易懂]

    MyEclipse+Tomcat配置详解[通俗易懂](尊重劳动成果,转载请注明出处:http://blog.csdn.NET/qq_25827845/article/details/53982209冷血之心的博客)关注微信公众号(文强的技术小屋),学习更多技术知识,一起遨游知识海洋~目录一、Tomcat1 Tomcat概述2 安装、启动、配置Tomcat2.1 Tomcat目录结构2.2 启动和关闭Tomca…

    2022年5月3日
    72
  • 浅谈时间轮算法[通俗易懂]

    浅谈时间轮算法[通俗易懂]时间轮在计算机世界中,只有待解决的问题变得大规模后,算法的价值才能够最大化的体现。时间轮算法可以将插入和删除操作的时间复杂度都降为O(1),在大规模问题下还能够达到非常好的运行效果。如果我们要实现一个定时任务该如何实现呢?最简单的方式就是使用一个任务队列来完成定时任务。具体实现细节下面详细展开。

    2026年4月16日
    4
  • linux重启nginx服务_centos7重启服务器命令

    linux重启nginx服务_centos7重启服务器命令连接服务器输入以下命令,如果要重启其他服务把nginx替换即可。servicenginxrestart出现以下页面即为成功

    2022年8月13日
    7
  • 微信小程序云开发|个人博客小程序

    微信小程序云开发|个人博客小程序这篇文章详细的介绍了个人博客小程序的云开发流程 包括博客展示页面 添加博客页面的创建 以及云函数的上传 数据库的创建和使用 同时使用到了 form text 等组件以及使用富文本添加博客 本程序所有数据都存储在云开发里面 不需要开发者自己的服务器 功能包括云数据库 云函数 云存储等 欢迎大家学习

    2026年3月19日
    1

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号