博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Openstack安装(2)——glance安装与配置
阅读量:5874 次
发布时间:2019-06-19

本文共 2855 字,大约阅读时间需要 9 分钟。

hot3.png

一、glance安装(controller)

1.安装

nova与glance yum install  openstack-glance

2.数据库建立与配置

mysql -u root –p

mysql> CREATE DATABASE glance;

mysql> GRANT ALL ON glance.* TO 'glance'@'%' IDENTIFIED BY '[YOUR_GLANCEDB_PASSWORD]';

mysql> GRANT ALL ON glance.* TO 'glance'@'localhost' IDENTIFIED BY '[YOUR_GLANCEDB_PASSWORD]';

mysql> quit

用户名 glance 密码 glanceadmin

二、glance配置

1.配置文件

glance-api.conf

2.让glance-api服务支持OpenStack Images API的两个版本。

enable_v1_api=True

enable_v2_api=True

3.官方文档指出,如果要支持V2 API,还需要一些配置。

In order to use the v2 API, you must copy the necessary SQL configuration from your glance-registry service to your glance-api configuration file.

4.配置认证(keystone)

/etc/glance/glance-api-paste.ini

[filter:authtoken]
admin_tenant_name = service
admin_user = glance
admin_password = glance

5.添加keyStone支持

/etc/glance/glance-api.conf 

[keystone_authtoken]

auth_host = 127.0.0.1
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = glance

[paste_deploy]

# Name of the paste configuration file that defines the available pipelines
config_file = /etc/glance/glance-api-paste.ini

# Partial name of a pipeline in your paste configuration file with the

# service name removed. For example, if your paste section name is
# [pipeline:glance-api-keystone], you would configure the flavor below
# as 'keystone'.
flavor=keystone

6.重启服务

service openstack-glance-api restart

7.配置glance-registry

文件/etc/glance/glance-registry.conf

[keystone_authtoken]
auth_host = 127.0.0.1
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = glance

[paste_deploy]

# Name of the paste configuration file that defines the available pipelines
config_file = /etc/glance/glance-registry-paste.ini

# Partial name of a pipeline in your paste configuration file with the

# service name removed. For example, if your paste section name is
# [pipeline:glance-api-keystone], you would configure the flavor below
# as 'keystone'.
flavor=keystone

8支持keystone

更新文件/etc/glance/glance-registry-paste.ini

# Use this pipeline for keystone auth
[pipeline:glance-registry-keystone]
pipeline = authtoken context registryapp

9.数据库 /etc/glance/glance-registry.conf

sql_connection = mysql://glance:[YOUR_GLANCEDB_PASSWORD]@192.168.206.130/glance

10.初始化数据库

glance-manage db_sync

11.重启动服务

service openstack-glance-api restart 

service openstack-glance-registry restart

12.异常处理,查看日志

/var/log/glance/registry.log

/var/log/glance/api.log

13.环境变量

export OS_USERNAME=admin

export OS_TENANT_NAME=openstackDemo
export OS_PASSWORD=keystoneadmin
export OS_AUTH_URL=
export OS_REGION_NAME=RegionOne

14.使用

glance image-create --name=cirros-0.3.0-x86_64 --disk-format=qcow2 --container-format=bare < stackimages/cirros.img

Added new image with ID: f4addd24-4e8a-46bb-b15d-fae2591f1a35

转载于:https://my.oschina.net/hjswust/blog/119919

你可能感兴趣的文章
Hibernate原理
查看>>
SlidingMenu+Fragment实现当前最流行的侧滑
查看>>
我是如何写作一本软件+哲学式的书籍的(下)
查看>>
Spring——AOP配置时的jar包异常
查看>>
HBase修改压缩格式及Snappy压缩实测分享
查看>>
Minimit Anima – 硬件加速的 CSS3 动画插件
查看>>
HDUOJ-------The Hardest Problem Ever
查看>>
学习嵌入式—导火线
查看>>
hdu 1217 Arbitrage (最小生成树)
查看>>
Bash Shell字符串操作小结
查看>>
sourceinsight技巧
查看>>
ASP.NET 解决URL中文乱码的解决
查看>>
el表达式跟ognl表达式的区别(用法和页面取值) 转
查看>>
解决java获取系统时间差8个小时 专题
查看>>
c#删除list中的元素
查看>>
Ubuntu 12.10安装QQ2012
查看>>
Ubuntu 13.04有线连接异常
查看>>
loj 1036(dp)
查看>>
javascript语法
查看>>
最遥远的距离
查看>>