Ubuntu16.10安装Ocata之3:Glance

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
云数据库 RDS PostgreSQL,集群系列 2核4GB
简介:

1、创建Glance数据库

root@controller:~/ocata# mysql -uroot -p -e "CREATE DATABASE glance"

Enter password:

root@controller:~/ocata# mysql -uroot -p -e "GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY 'zoomtech'"

Enter password:

root@controller:~/ocata# mysql -uroot -p -e "GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY 'zoomtech'"

Enter password:


2、创建Glance用户、

root@controller:~/ocata# source admin-openrc

root@controller:~/ocata# openstack user create --domain default --password-prompt glance

User Password:

Repeat User Password:

+---------------------+----------------------------------+

| Field               | Value                            |

+---------------------+----------------------------------+

| domain_id           | default                          |

| enabled             | True                             |

| id                  | 077fa99f355f43389d28bf476e1c4549 |

| name                | glance                           |

| options             | {}                               |

| password_expires_at | None                             |

+---------------------+----------------------------------+

root@controller:~/ocata# openstack role add --project service --user glance admin


3、创建glance服务

root@controller:~/ocata# openstack service create --name glance \

   --description "OpenStack Image" image

+-------------+----------------------------------+

| Field       | Value                            |

+-------------+----------------------------------+

| description | OpenStack Image                  |

| enabled     | True                             |

| id          | 86a9f0234e4846bdac32c10b553a41f5 |

| name        | glance                           |

| type        | image                            |

+-------------+----------------------------------+


4、创建glance API端点

root@controller:~/ocata# openstack endpoint create --region RegionOne \

   image public http://controller:9292

+--------------+----------------------------------+

| Field        | Value                            |

+--------------+----------------------------------+

| enabled      | True                             |

| id           | 47bce25719a24321980283481d751374 |

| interface    | public                           |

| region       | RegionOne                        |

| region_id    | RegionOne                        |

| service_id   | 86a9f0234e4846bdac32c10b553a41f5 |

| service_name | glance                           |

| service_type | image                            |

| url          | http://controller:9292           |

+--------------+----------------------------------+

root@controller:~/ocata# openstack endpoint create --region RegionOne \

   image internal http://controller:9292

+--------------+----------------------------------+

| Field        | Value                            |

+--------------+----------------------------------+

| enabled      | True                             |

| id           | 53e7ab3597ad4543bde2d85e780d3736 |

| interface    | internal                         |

| region       | RegionOne                        |

| region_id    | RegionOne                        |

| service_id   | 86a9f0234e4846bdac32c10b553a41f5 |

| service_name | glance                           |

| service_type | image                            |

| url          | http://controller:9292           |

+--------------+----------------------------------+

root@controller:~/ocata# openstack endpoint create --region RegionOne \

>   image admin http://controller:9292

+--------------+----------------------------------+

| Field        | Value                            |

+--------------+----------------------------------+

| enabled      | True                             |

| id           | 4fc7c8f3208a4159a34ee23e733e5115 |

| interface    | admin                            |

| region       | RegionOne                        |

| region_id    | RegionOne                        |

| service_id   | 86a9f0234e4846bdac32c10b553a41f5 |

| service_name | glance                           |

| service_type | image                            |

| url          | http://controller:9292           |

+--------------+----------------------------------+

root@controller:~/ocata#


5、配置glance api

root@controller:~/ocata# vim /etc/glance/glance-api.conf

[database]

connection = mysql+pymysql://glance:zoomtech@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 = zoomtech

[paste_deploy]

flavor = keystone

[glance_store]

stores = file,http

default_store = file

filesystem_store_datadir = /var/lib/glance/images/


6、配置glance registry

root@controller:~/ocata# vim /etc/glance/glance-registry.conf

[database]

connection = mysql+pymysql://glance:zoomtech@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 = zoomtech

[paste_deploy]

flavor = keystone


7、同步数据库

root@controller:~/ocata# su -s /bin/sh -c "glance-manage db_sync" glance

8、启动glance

root@controller:~/ocata# service glance-registry restart

root@controller:~/ocata# service glance-api restart

root@controller:~/ocata# service glance-registry status

root@controller:~/ocata# service glance-api status


9、测试images

root@controller:~/ocata# wget wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img

root@controller:~/ocata# openstack image create "cirros"    --file cirros-0.3.4-x86_64-disk.img    --disk-format qcow2 --container-format bare    --public

+------------------+------------------------------------------------------+

| Field            | Value                                                |

+------------------+------------------------------------------------------+

| checksum         | ee1eca47dc88f4879d8a229cc70a07c6                     |

| container_format | bare                                                 |

| created_at       | 2017-02-28T05:53:02Z                                 |

| disk_format      | qcow2                                                |

| file             | /v2/images/9b51b435-c6ed-4c8d-814b-760cda0d813e/file |

| id               | 9b51b435-c6ed-4c8d-814b-760cda0d813e                 |

| min_disk         | 0                                                    |

| min_ram          | 0                                                    |

| name             | cirros                                               |

| owner            | 56d3f276e94d48ffb014a6fe5776d0e5                     |

| protected        | False                                                |

| schema           | /v2/schemas/image                                    |

| size             | 13287936                                             |

| status           | active                                               |

| tags             |                                                      |

| updated_at       | 2017-02-28T05:53:02Z                                 |

| virtual_size     | None                                                 |

| visibility       | public                                               |

+------------------+------------------------------------------------------+

root@controller:~/ocata# openstack image list

+--------------------------------------+--------+--------+

| ID                                   | Name   | Status |

+--------------------------------------+--------+--------+

| 9b51b435-c6ed-4c8d-814b-760cda0d813e | cirros | active |

+--------------------------------------+--------+--------+




本文转自 OpenStack2015 51CTO博客,原文链接:http://blog.51cto.com/andyliu/1902054,如需转载请自行联系原作者
相关实践学习
如何快速连接云数据库RDS MySQL
本场景介绍如何通过阿里云数据管理服务DMS快速连接云数据库RDS MySQL,然后进行数据表的CRUD操作。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
1月前
|
Ubuntu NoSQL JavaScript
在Ubuntu上安装MEAN Stack的4个步骤
本指南介绍了在Ubuntu上安装MEAN Stack的四个步骤。MEAN Stack是一种基于JavaScript的开发堆栈,包含MongoDB、ExpressJS、AngularJS和NodeJS。步骤包括:1. 更新系统并准备安装MEAN;2. 从官方源安装最新版MongoDB;3. 安装NodeJS、Git和NPM;4. 克隆mean.io仓库并使用NPM安装剩余依赖项。通过这些步骤,您可以快速搭建基于MEAN Stack的应用开发环境。
45 2
|
2天前
|
Ubuntu Linux 编译器
在Ubuntu Linux系统下如何搭建并安装EDK2
以上就是在Ubuntu Linux系统下搭建并安装EDK2的过程。这个过程可能会有些复杂,但只要按照步骤一步步来,应该不会有太大问题。如果在过程中遇到任何问题,都可以在网上找到相应的解决方案。希望这个指南能对你有所帮助!
36 17
|
10天前
|
Ubuntu 关系型数据库 MySQL
在Ubuntu系统的Docker上安装MySQL的方法
以上的步骤就是在Ubuntu系统的Docker上安装MySQL的详细方法,希望对你有所帮助!
74 12
|
24天前
|
Ubuntu 安全 调度
在Ubuntu下安装Debian包:dpkg与apt命令的深度解构。
安装Debian包的知识,就像掌握了海上的航行技术,虽然起初会让人感到陌生甚至困惑,但只要你积累熟练,就能在Ubuntu的世界里畅游无阻。就像每一位成功的航海家,掌握好这些工具,去探索属于你的Ubuntu新世界吧!
81 21
|
16天前
|
Ubuntu Linux
Ubuntu中dpkg和apt命令:debian包安装详解
希望这让你对于Ubuntu中的dpkg和apt命令有了更为清晰的理解。下次你面对软件包安装的问题,就可以轻松应对,优雅地在你的Linux系统中游刃有余了。
128 10
|
22天前
|
Ubuntu 关系型数据库 MySQL
容器技术实践:在Ubuntu上使用Docker安装MySQL的步骤。
通过以上的操作,你已经步入了Docker和MySQL的世界,享受了容器技术给你带来的便利。这个旅程中你可能会遇到各种挑战,但是只要你沿着我们划定的路线行进,你就一定可以达到目的地。这就是Ubuntu、Docker和MySQL的灵魂所在,它们为你开辟了一条通往新探索的道路,带你亲身感受到了技术的力量。欢迎在Ubuntu的广阔大海中探索,用Docker技术引领你的航行,随时准备感受新技术带来的震撼和乐趣。
74 16
|
30天前
|
Ubuntu Linux Shell
Ubuntu gnome WhiteSur-gtk-theme类mac主题正确安装和卸载方式
通过这个过程,用户不仅可以定制自己的桌面外观,还可以学习到更多关于 Linux 系统管理的知识,从而更好地掌握系统配置和主题管理的技巧。
96 12
|
2月前
|
缓存 Ubuntu Linux
Linux中yum、rpm、apt-get、wget的区别,yum、rpm、apt-get常用命令,CentOS、Ubuntu中安装wget
通过本文,我们详细了解了 `yum`、`rpm`、`apt-get`和 `wget`的区别、常用命令以及在CentOS和Ubuntu中安装 `wget`的方法。`yum`和 `apt-get`是高层次的包管理器,分别用于RPM系和Debian系发行版,能够自动解决依赖问题;而 `rpm`是低层次的包管理工具,适合处理单个包;`wget`则是一个功能强大的下载工具,适用于各种下载任务。在实际使用中,根据系统类型和任务需求选择合适的工具,可以大大提高工作效率和系统管理的便利性。
234 25
|
1月前
|
NoSQL Ubuntu 网络安全
在 Ubuntu 20.04 上安装和配置 Redis
在 Ubuntu 20.04 上安装和配置 Redis 的步骤如下:首先更新系统包,然后通过 `apt` 安装 Redis。安装后,启用并启动 Redis 服务,检查其运行状态。可选配置包括修改绑定 IP、端口等,并确保防火墙设置允许外部访问。最后,使用 `redis-cli` 测试 Redis 功能,如设置和获取键值对。
49 1
|
1月前
|
Ubuntu TensorFlow 算法框架/工具
如何在Ubuntu上安装TensorFlow 24.04
如何在Ubuntu上安装TensorFlow 24.04
72 1