openstack安装newton版本Glance部署(二)
一、部署Glance
1、Glance 安装
[root@linux-node1 ~]#yum install openstack-glance python-glance python-glanceclient -y
2、配置:修改glance-api和glance-registry的配置文件,同步数据库
[root@linux-node1 ~]# vi /etc/glance/glance-api.conf
[database]
connection = mysql://glance:glance@172.22.0.218/glance
[root@linux-node1 ~]# vi /etc/glance/glance-registry.conf
[database]
connection = mysql://glance:glance@172.22.0.218/glance
3、同步数据库并检查数据库:
[root@linux-node1 ~]# su -s /bin/sh -c "glance-manage db_sync" glance
检查导入glance库的表情况:
MariaDB [(none)]> use glance
Database changed
MariaDB [glance]>
MariaDB [glance]> show tables;
+----------------------------------+
| Tables_in_glance |
+----------------------------------+
| artifact_blob_locations |
| artifact_blobs |
| artifact_dependencies |
| artifact_properties |
| artifact_tags |
| artifacts |
| image_locations |
| image_members |
| image_properties |
| image_tags |
| images |
| metadef_namespace_resource_types |
| metadef_namespaces |
| metadef_objects |
| metadef_properties |
| metadef_resource_types |
| metadef_tags |
| migrate_version |
| task_info |
| tasks |
+----------------------------------+
rows in set (0.00 sec)
4、配置glance连接keystone,对于keystone,每个服务都要有一个用户连接keystone
[root@linux-node1 ~]# source admin-openrc.sh
[root@linux-node1 ~]# openstack user create --domain default --password=glance glance
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | d21d0715890447fb87f72e85dce6d4be |
| enabled | True |
| id | add8d7512b3a4af78236d75e5154978e |
| name | glance |
| password_expires_at | None |
+---------------------+----------------------------------+
[root@linux-node1 ~]# openstack role add --project service --user glance admin
5、修改glance-api配置文件,结合keystone和mysql
[root@linux-node1 ~]# vi /etc/glance/glance-api.conf
verbose = true
[keystone_authtoken]
auth_uri = http://172.22.0.218:5000
auth_url = http://172.22.0.218:35357
auth_plugin = password
project_domain_id = d21d0715890447fb87f72e85dce6d4be
user_domain_id = d21d0715890447fb87f72e85dce6d4be
project_name = service
username = glance
password = glance
[paste_deploy]
flavor = keystone
[oslo_messaging_notifications]
# The Drivers(s) to handle sending notifications. Possible values are messaging,
# messagingv2, routing, log, test, noop (multi valued)
# Deprecated group/name - [DEFAULT]/notification_driver
driver = noop
[glance_store]
default_store = file
filesystem_store_datadir = /var/lib/glance/images
6、修改glance-registry配置文件,结合keystone和mysql
[root@linux-node1 ~]# vi /etc/glance/glance-registry.conf
verbose=True
[oslo_messaging_notifications]
# The Drivers(s) to handle sending notifications. Possible values are messaging,
# messagingv2, routing, log, test, noop (multi valued)
# Deprecated group/name - [DEFAULT]/notification_driver
driver = noop
[keystone_authtoken]
auth_uri = http://172.22.0.218:5000
auth_url = http://172.22.0.218:35357
auth_plugin = password
project_domain_id = d21d0715890447fb87f72e85dce6d4be
user_domain_id = d21d0715890447fb87f72e85dce6d4be
project_name = service
username = glance
password = glance
[paste_deploy]
flavor = keystone
7、配置检查:
[root@linux-node1 ~]# grep -n '^[a-z]' /etc/glance/glance-api.conf
:verbose = true
:connection = mysql://glance:glance@172.22.0.218/glance
:default_store = file
:filesystem_store_datadir = /var/lib/glance/images
:auth_uri = http://172.22.0.218:5000
:auth_url = http://172.22.0.218:35357
:auth_plugin = password
:project_domain_id = d21d0715890447fb87f72e85dce6d4be
:user_domain_id = d21d0715890447fb87f72e85dce6d4be
:project_name = service
:username = glance
:password = glance
:driver = noop
:flavor = keystone
[root@linux-node1 ~]# grep -n '^[a-z]' /etc/glance/glance-registry.conf
:connection = mysql://glance:glance@172.22.0.218/glance
:auth_uri = http://172.22.0.218:5000
:auth_url = http://172.22.0.218:35357
:auth_plugin = password
:project_domain_id = d21d0715890447fb87f72e85dce6d4be
:user_domain_id = d21d0715890447fb87f72e85dce6d4be
:project_name = service
:username = glance
:password = glance
:driver = noop
:flavor = keystone
二、启动glance
1、设置开机启动并启动glance服务检查服务:
[root@linux-node1 ~]# systemctl enable openstack-glance-api
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-glance-api.service to /usr/lib/systemd/system/openstack-glance-api.service.
[root@linux-node1 ~]# systemctl enable openstack-glance-registry
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-glance-registry.service to /usr/lib/systemd/system/openstack-glance-registry.service.
查看galnce占用端口情况,其中9191是registry占用端口,9292是api占用端口
[root@linux-node1 ~]# netstat -lntup|egrep "9191|9292"
tcp 0.0.0.0: 0.0.0.0:* LISTEN /python2
tcp 0.0.0.0: 0.0.0.0:* LISTEN /python2
[root@linux-node1 ~]# ps aux | grep
glance 4.6 6.4 ? Ss : : /usr/bin/python2 /usr/bin/glance-api
root 0.0 0.0 pts/ R+ : : grep --color=auto
[root@linux-node1 ~]# ps aux | grep
glance 1.7 6.4 ? Ss : : /usr/bin/python2 /usr/bin/glance-registry
root 0.0 0.0 pts/ S+ : : grep --color=auto
2、glance服务在keystone上注册,才可以允许其他服务调用glance
[root@linux-node1 ~]# openstack service create --name glance --description "OpenStack Image service" image
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Image service |
| enabled | True |
| id | b08581e2a35a4ed982ddfac797050ae1 |
| name | glance |
| type | image |
+-------------+----------------------------------+
[root@linux-node1 ~]# openstack endpoint create --region RegionOne image public http://172.22.0.218:9292
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | af6c4a21691344d7adfd6ec3e2d3674e |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | b08581e2a35a4ed982ddfac797050ae1 |
| service_name | glance |
| service_type | image |
| url | http://172.22.0.218:9292 |
+--------------+----------------------------------+
[root@linux-node1 ~]# openstack endpoint create --region RegionOne image internal http://172.22.0.218:9292
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 2646c93f3cda442fb062887f6c510343 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | b08581e2a35a4ed982ddfac797050ae1 |
| service_name | glance |
| service_type | image |
| url | http://172.22.0.218:9292 |
+--------------+----------------------------------+
[root@linux-node1 ~]# openstack endpoint create --region RegionOne image admin http://172.22.0.218:9292
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 5cc3112ed5944f04935805467ad36ec8 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | b08581e2a35a4ed982ddfac797050ae1 |
| service_name | glance |
| service_type | image |
| url | http://172.22.0.218:9292 |
+--------------+----------------------------------+
3、在admin和demo中加入glance的环境变量,告诉其他服务glance使用的环境变量,一定要在admin-openrc.sh的路径下执行
[root@linux-node1 ~]# echo "export OS_IMAGE_API_VERSION=2" | tee -a admin-openrc.sh demo-openrc.sh
export OS_IMAGE_API_VERSION=
[root@linux-node1 ~]# tail - admin-openrc.sh
export OS_IMAGE_API_VERSION=
[root@linux-node1 ~]# tail - demo-openrc.sh
export OS_IMAGE_API_VERSION=
三、检查是否安装部署正确
1、如果出现以下情况,表示glance配置成功,由于没有镜像,所以看不到
[root@linux-node1 ~]# glance image-list
+----+------+
| ID | Name |
+----+------+
+----+------+
2、下载一个镜像:
[root@linux-node1 ~]#wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
3、上传镜像到glance,要在上一步所下载的镜像当前目录执行:
[root@linux-node1 ~]# glance image-create --name "cirros" --file cirros-0.3.-x86_64-disk.img --disk-format qcow2 --container-format bare --visibility public --progress
[=============================>] %
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | ee1eca47dc88f4879d8a229cc70a07c6 |
| container_format | bare |
| created_at | --06T03::50Z |
| disk_format | qcow2 |
| id | 8f5837b4-bbec-4ef5-96f6-aba989c27206 |
| min_disk | |
| min_ram | |
| name | cirros |
| owner | 503b0eab0420454e909a46e476bf1ede |
| protected | False |
| size | |
| status | active |
| tags | [] |
| updated_at | --06T03::50Z |
| virtual_size | None |
| visibility | public |
+------------------+--------------------------------------+
4、查看上传镜像:
[root@linux-node1 ~]# glance image-list
+--------------------------------------+--------+
| ID | Name |
+--------------------------------------+--------+
| 8f5837b4-bbec-4ef5-96f6-aba989c27206 | cirros |
+--------------------------------------+--------+
[root@linux-node1 ~]# cd /var/lib/glance/images/
[root@linux-node1 images]# ls
8f5837b4-bbec-4ef5-96f6-aba989c27206
完成部署!部署成功!
openstack安装newton版本Glance部署(二)的更多相关文章
- openstack安装newton版本keyston部署(一)
一.部署环境: 两台centos7, 内存2G 控制计算节点: Hostname1: ip:172.22.0.218 计算节点及存储节点 Hostnam ...
- openstack安装newton版本Nova部署(三)
一.控制节点安装部署Nova Nova 包含API(负责接收相应外部请求,支持OpenStackAPI,EC2API):cert:负责身份认证:schedule:用于云主机调度(虚拟机创建在哪台主机上 ...
- openstack安装newton版本neutron服务部署(四)
一.管理节点部署服务: 1.安装neutron: [root@linux-node1 ~]# yum install openstack-neutron openstack-neutron-ml2 o ...
- openstack安装newton版本dashboard+cinder(六)
一.dashboard 1.安装dashboard及配置 [root@linux-node1 ~]# yum install openstack-dashboard -y #可以装任何地方只要能连接 ...
- openstack安装newton版本创建虚拟机(五)
一.创建网络: 1.在控制节点上创建一个单一扁平网络(名字:flat),网络类型为flat,网络适共享的(share),网络提供者:physnet1,它是和eth0关联起来的 [root@linux- ...
- 安装Newton版Glance
Image Service 本文介绍在controller节点上安装.配置Image服务 glance,镜像存储在本地文件系统 安装准备 controller 节点 ip:192.168.81.11 ...
- OpenStack kilo版(4) Glance部署
Glance简介 Glance-api:接受云系统镜像的构建.删除.读取请求 Glance-Registry:云系统的镜像注册服务 部署在controller节点 配置数据库 MariaDB [(no ...
- OpenStack Newton版本Ceph集成部署记录
2017年2月,OpenStack Ocata版本正式release,就此记录上一版本 Newton 结合Ceph Jewel版的部署实践.宿主机操作系统为CentOS 7.2 . 初级版: 192. ...
- devstack安装openstack newton版本
准备使用devstack安装openstack N版,搞一套开发环境出来.一连整了4天,遇到各种问题,各种错误,一直到第4天下午4点多才算完成. 在这个过程中感觉到使用devstack搭建openst ...
随机推荐
- EVC入门之二: 在未被加载的DLL中设置断点 (虽然没有遇到这个问题,不过先摘抄下来)
问题: 这个问题居然也郁闷了我一段时间. 我们假设在EVC里建立了一个project, 里面有SubProject_1(以下简称SB1,嘿嘿), 编译生成一个EXE; SubProject_2(以下简 ...
- POJ2763 Housewife Wind(树剖+线段树)
After their royal wedding, Jiajia and Wind hid away in XX Village, to enjoy their ordinary happy lif ...
- 【Lintcode】106.Convert Sorted List to Balanced BST
题目: Given a singly linked list where elements are sorted in ascending order, convert it to a height ...
- 洛谷 1344 [USACO4.4]追查坏牛奶Pollutant Control——最大流
题目:https://www.luogu.org/problemnew/show/P1344 那个边数的限制,只要把边权乘1001再+1即可.乘1001是因为有1000条边,这样流量小的不会因为边数多 ...
- In-App Purchase Configuration Guide for iTunes Connect---(一)----Introduction
Introduction In-App Purchase is an Apple technology that allows your users to purchase content and s ...
- 《精通Spring4.X企业应用开发实战》读后感第四章(BeanFactory生命周期)
package com.smart; import org.springframework.beans.BeansException; import org.springframework.beans ...
- MVC 中dapper的日志功能+程序报错修改
由于之前的项目说最好要有日志功能,正好之前看过几篇这方面的文章就弄了点东西. 这是EF日志受启发很大的一个原文: http://www.cnblogs.com/GuZhenYin/p/5556732. ...
- C#—反射(反射类型、方法、构造函数、属性、实现可配置可扩展、数据库访问类反射封装)
反射是.NET中的重要机制,通过反射,可以在运行时获得程序或程序集中每一个类型(包括类.结构.委托.接口和枚举等)的成员和成员的信息.有了反射,即可对每一个类型了如指掌.另外我还可以直接创建对象,即使 ...
- Tcp编程demo之三部曲
下面的demo的目的是通过代码来快速的了解tcp编程的步骤 1首先呢,对InetAddress类简单了解其作用 public static void main(String[] args) throw ...
- 使用Unity实现动态2D水效果
http://forum.china.unity3d.com/thread-16044-1-1.html 在这片教程里面我们将会用简单的物理效果来模拟动态的2D水效果.我们将会使用Line Rende ...