Ubuntu16.10安装Ocata之3:Glance

本文涉及的产品
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
RDS MySQL Serverless 高可用系列,价值2615元额度,1个月
简介:

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
目录
打赏
0
0
0
0
265
分享
相关文章
|
22天前
|
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`则是一个功能强大的下载工具,适用于各种下载任务。在实际使用中,根据系统类型和任务需求选择合适的工具,可以大大提高工作效率和系统管理的便利性。
116 25
在 Ubuntu 20.04 上安装和配置 Redis
在 Ubuntu 20.04 上安装和配置 Redis 的步骤如下:首先更新系统包,然后通过 `apt` 安装 Redis。安装后,启用并启动 Redis 服务,检查其运行状态。可选配置包括修改绑定 IP、端口等,并确保防火墙设置允许外部访问。最后,使用 `redis-cli` 测试 Redis 功能,如设置和获取键值对。
15 1
ubuntu22 编译安装docker,和docker容器方式安装 deepseek
本脚本适用于Ubuntu 22.04,主要功能包括编译安装Docker和安装DeepSeek模型。首先通过Apt源配置安装Docker,确保网络稳定(建议使用VPN)。接着下载并配置Docker二进制文件,创建Docker用户组并设置守护进程。随后拉取Debian 12镜像,安装系统必备工具,配置Ollama模型管理器,并最终部署和运行DeepSeek模型,提供API接口进行交互测试。
360 15
如何在Ubuntu 20.04系统中安装Docker
安装 Docker 引擎的步骤如下:首先更新系统包索引 (`sudo apt update`),安装必要依赖包 (`apt-transport-https` 等),添加 Docker 官方 GPG 密钥及 APT 仓库。接着再次更新包索引并安装 Docker 引擎及相关工具 (`docker-ce` 等)。最后启动 Docker 服务并设置开机自启,通过 `docker --version` 和运行测试容器 (`sudo docker run hello-world`) 验证安装是否成功。
42 0
OS-Copilot-ubuntu镜像版本的具体测试使用(安装方式有单独注明)
作为一名个人开发者,我主要负责云资源的运维和管理。在使用OS Copilot的过程中,我遇到了一些配置问题,特别是在ECS实例中设置AccessKey时,但最终成功解决了。通过使用OS Copilot的-t/-f/管道功能,我大大提升了效率,减少了命令编写的工作量,特别是在搭建Java运行环境时效果显著。此外,| 功能帮助我快速理解文档,整体体验非常流畅,推荐给其他开发者使用。
61 6
ubuntu 22安装lua环境&&编译lua cjson模块
通过上述步骤,可以在 Ubuntu 22.04 系统上成功安装 Lua 环境,并使用 LuaRocks 或手动编译的方式安装 lua-cjson 模块。本文详细介绍了每一步的命令和操作,确保每一步都能顺利完成,适合需要在 Ubuntu 系统上配置 Lua 开发环境的开发者参考和使用。
268 13
Ubuntu24.04安装Librenms
此指南介绍了在Linux系统上安装和配置LibreNMS网络监控系统的步骤。主要内容包括:安装所需软件包、创建用户、克隆LibreNMS仓库、设置文件权限、安装PHP依赖、配置时区、设置MariaDB数据库、调整PHP-FPM与Nginx配置、配置SNMP及防火墙、启用命令补全、设置Cron任务和日志配置,最后通过网页完成安装。整个过程确保LibreNMS能稳定运行并提供有效的网络监控功能。
Ubuntu安装homebrew的完整教程
本文介绍了如何在没有公网的情况下安装 Homebrew。首先访问 Homebrew 官网,然后通过阿里云的镜像克隆安装脚本,并创建普通用户进行安装。接着修改 `install.sh` 文件指向国内镜像,执行安装命令。最后配置环境变量并更换 Homebrew 源为国内镜像,确保安装顺利。
925 50
Ubuntu22.04上Docker的安装
通过以上详细的安装步骤和命令,您可以在Ubuntu 22.04系统上顺利安装
1531 12
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等