OpenStack 安装:glance 安装
接上一篇keystone, 这一篇介绍glance服务:
- 在开始操作之前,先用source环境变量,然后创建glance 用户,并设置密码为glance
[root@linux-node1 ~]#openstack user create --domain default --password-prompt glance
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | 31a0d9b7dd5f47b4b30ed4a77500a307 |
| name | glance |
| options | {} |
| password_expires_at | None |
+---------------------+----------------------------------+
- 添加admin角色到glance用户和service project
[root@linux-node1 ~]# openstack role add --project service --user glance admin
[root@linux-node1 ~]#
- 编辑/etc/glance/glance-registry.conf 如下所示
[database]
# ...
connection = mysql+pymysql://glance:glance@192.168.56.11/glance
[keystone_authtoken] auth_uri = http://192.168.56.11:5000
auth_url = http://192.168.56.11:35357
memcached_servers = 192.168.56.11:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = glance
[paste_deploy]
flavor = keystone
- 编辑/etc/glance/glance-api.conf 如下所示:
[database]
connection = mysql+pymysql://glance:glance@192.168.56.11/glance
[keystone_authtoken]
auth_uri = http://192.168.56.11:5000
auth_url = http://192.168.56.11:35357
memcached_servers = 192.168.56.11: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]
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images
- 同步glance数据库
[root@linux-node1 ~]# su -s /bin/sh -c "glance-manage db_sync" glance
- 验证数据库是否同步
[root@linux-node1 ~]# mysql -h 192.168.56.11 -uglance -pglance -e "use glance;show tables"
+----------------------------------+
| Tables_in_glance |
+----------------------------------+
| alembic_version |
| image_locations |
| image_members |
| image_properties | i
|mage_tags|
| metadef_namespaces |
| metadef_objects |
| metadef_properties |
| metadef_resource_types |
| metadef_tags |
| images |
| metadef_namespace_resource_types |
| migrate_version |
| task_info |
| tasks |
+----------------------------------+
- 启动memcached并设置开机启动
[root@linux-node1 ~]# systemctl enable memcached
[root@linux-node1 ~]# systemctl start memcached
- 启动glance服务并设置开机启动
systemctl enable openstack-glance-api.service \
openstack-glance-registry.service
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-glance-api.service
to /usr/lib/systemd/system/openstack-glance-api.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-glance-registry.service to /usr/lib/systemd/system/openstack-glance-registry.service.
systemctl start openstack-glance-api.service \
openstack-glance-registry.service
- 创建glance实例
openstack service create --name glance \
--description "OpenStack Image" image
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Image |
| enabled | True |
| id | 4c4dd5eb35324b568cd9722f174a632b |
| name | glance |
| type | image |
+-------------+----------------------------------+
- 创建glance服务API 端点
openstack endpoint create --region RegionOne \
image public http://192.168.56.11:9292
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 47e8d9659f70422487cf600405f518bf |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 4c4dd5eb35324b568cd9722f174a632b |
| service_name | glance |
| service_type | image |
| url | http://192.168.56.11:9292 |
+--------------+----------------------------------+openstack endpoint create --region RegionOne \
image internal http://192.168.56.11:9292
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 859936e9632642d58517d9ac6a2c3176 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 4c4dd5eb35324b568cd9722f174a632b |
| service_name | glance |
| service_type | image |
| url | http://192.168.56.11:9292 |
+--------------+----------------------------------+openstack endpoint create --region RegionOne \
image admin http://192.168.56.11:9292
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 223775040aaf460da4f275ebbcd01ae1 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 4c4dd5eb35324b568cd9722f174a632b |
| service_name | glance |
| service_type | image |
| url | http://192.168.56.11:9292 |
+--------------+----------------------------------+
- 验证创建,现在是两个服务的六个端点
[root@linux-node1 ~]# openstack endpoint list
+----------------------------------+-----------+--------------+--------------+---------+-----------+--------------------------------+
| ID | Region | Service Name | Service Type | Enabled | Interface | URL |
+----------------------------------+-----------+--------------+--------------+---------+-----------+--------------------------------+
| 16964c23761c428b909e9a8617d8146e | RegionOne | keystone | identity | True | internal | http://192.168.56.11:5000/v3/ |
| 223775040aaf460da4f275ebbcd01ae1 | RegionOne | glance | image | True | admin | http://192.168.56.11:9292 |
| 36fb4b5b955d471783a982ea455cf58d | RegionOne | keystone | identity | True | public | http://192.168.56.11:5000/v3/ |
| 47e8d9659f70422487cf600405f518bf | RegionOne | glance | image | True | public | http://192.168.56.11:9292 |
| 62766176a40f43bbbb40d4b986b4400e | RegionOne | keystone | identity | True | admin | http://192.168.56.11:35357/v3/ |
| 859936e9632642d58517d9ac6a2c3176 | RegionOne | glance | image | True | internal | http://192.168.56.11:9292 |
+----------------------------------+-----------+--------------+--------------+---------+-----------+--------------------------------+
- 这个时候,输入openstack image list,如果没有报错,即证明上面的操作是对的
[root@linux-node1 ~]# openstack image list
[root@linux-node1 ~]#
- 下面我们用一个小镜像来验证一下,首先先获取这个镜像
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.-x86_64-disk.img \
--disk-format qcow2 --container-format bare \
--public
+------------------+------------------------------------------------------+
| Field | Value |
+------------------+------------------------------------------------------+
| checksum | f8ab98ff5e73ebab884d80c9dc9c7290 |
| container_format | bare |
| created_at | --12T08::52Z |
| disk_format | qcow2 |
| file | /v2/images/24a1486b-d1b5--b2cc-3397fdf295cf/file |
| id | 24a1486b-d1b5--b2cc-3397fdf295cf |
| min_disk | |
| min_ram | |
| name | cirros |
| owner | fb6761ab3d3d43569d5fdfafcdfa5e28 |
| protected | False |
| schema | /v2/schemas/image |
| size | |
| status | active |
| tags | |
| updated_at | --12T08::52Z |
| virtual_size | None |
| visibility | public |
+------------------+------------------------------------------------------+
[root@linux-node1 ~]# openstack image list
+--------------------------------------+--------+--------+
| ID | Name | Status |
+--------------------------------------+--------+--------+
| 24a1486b-d1b5--b2cc-3397fdf295cf | cirros | active |
+--------------------------------------+--------+--------+
至此,glance部分创建完毕
OpenStack 安装:glance 安装的更多相关文章
- openstack之~glance安装部署
接着部署完keystone后,接着部署glance 第一:部署安装glance glance关于数据库的操作: [root@controller /]# mysql -u root -p Enter ...
- openstack学习-glance安装(三)
glance在openstack负责镜像相关管理的,对外提供标准的api提供服务,glance有两个服务,一个是glance-api接受云系统镜像的创建.删除.读取请求.glance-registry ...
- OpenStack:安装Glance
>安装Glance1. 安装# apt-get install glance python-glanceclient删除sqlite文件rm -f /var/lib/glance/glance. ...
- CentOS7安装OpenStack(Rocky版)-03.安装Glance镜像服务组件(控制节点)
上篇文章分享了keystone的安装配置,本文接着分享openstack的镜像服务glance. --------------- 完美的分割线 ---------------- 3.0.glance概 ...
- openstack Glance安装与配置
一.实验目的: 1.理解glance镜像服务在OpenStack框架中的作用 2.掌握glance服务安装的基本方法 3.掌握glance的配置基本方法 二.实验步骤: 1.在controller节点 ...
- OpenStack Train版-3.安装glance镜像服务
安装glance镜像服务 创建数据库并授权 mysql -u root create database glance; GRANT ALL PRIVILEGES ON glance.* TO 'gla ...
- (四)OpenStack---M版---双节点搭建---Glance安装和配置
↓↓↓↓↓↓↓↓视频已上线B站↓↓↓↓↓↓↓↓ >>>>>>传送门 1.创建glance数据库 2.获得 admin 凭证来获取只有管理员能执行的命令的访问权限 3 ...
- 安装glance
在控制节点上执行 controllerHost='controller' MYSQL_PASSWD='m4r!adbOP' GLANCE_PASSWD='glance1234!' 1.创建数据库 my ...
- openstack June all-in-one 安装手册
by lt,hyc 1.安全规范 表1:openstack用户和密码值设置 用户名 含义 本文的设置值 Admin openstack管理员用户 ADMIN_PASS Keystone openst ...
随机推荐
- js调用app启动页
第一步:添加js $(function () { var ua = window.navigator.userAgent.toLowerCase(); //微信 if(ua.match(/MicroM ...
- PHP 框架
LARAVEL/LUMEN, CI ,THINKPHP, YII ,SYMFONY YAF, PHALCON ,ICE FRAMEWORK
- 我的代码-cleaning
# coding: utf-8 # In[18]: import pandas as pdimport numpy as npfrom sklearn import treefrom sklearn. ...
- LeetCode - Online Election
In an election, the i-th vote was cast for persons[i] at time times[i]. Now, we would like to implem ...
- 配置SSH使用秘钥登录
使用密码远程登录ssh还是有比较大的风险的,比较安全的方法是使用秘钥登录 配置步骤如下 首先生成秘钥 ssh-keygen (直接默认回车也可以,生成的秘钥和公钥默认防止在/root/.ssh/文件 ...
- 黄聪:什么是XSS攻击
XSS是一种经常出现在web应用中的计算机安全漏洞,它允许恶意web用户将代码植入到提供给其它用户使用的页面中.比如这些代码包括HTML代码和客户端脚本.攻击者利用XSS漏洞旁路掉访问控制——例如同源 ...
- js源生ajax
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- *浅解嵌入式中的BootLoader
本文只作为本人学习过程中的记录及时不时的突发奇想偶记.鄙人菜鸟一只,文中如有错误或疏漏,若读者肯不吝赐教,在下感激零涕.文章一直不断更新中 一.何为Bootloader 在嵌入式系统中,Bootloa ...
- ORM的多表查询详述
ORM的多表查询 ORM最核心与用的最多的地方就是跨表查询了.这里的"跨表查询"分为以下几种:基于对象的跨表查询.基于双下划线的跨表查询.聚合查询.F与Q查询以及分组查询. 下面就 ...
- 知识点:SQL中char、varchar、text区别
Char为定长,varchar,text为变长. 1.CHAR.CHAR存储定长数据很方便,CHAR字段上的索引效率级高,比如定义char(10),那么不论你存储的数据是否达到了10个字节,都要占去1 ...