设为首页 收藏本站
查看: 1034|回复: 0

[经验分享] OpenStack版本升级之Glance

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2016-1-9 08:27:20 | 显示全部楼层 |阅读模式
F版的一些变化
  对依赖库的变化主要是添加了一个jsonschema并去掉了对xattr、pysendfile及swift1.4.8的依赖,如果采用swift作为存储后端需要有python-swiftclient,另外还需要F版的Keystone。配置方面主要把认证中间件的配置从paste配置中移到了server配置中。功能上添加了V2版的api接口。

备份与安装
  停止现有服务,并备份数据

[iyunv@stackcc update_glance]# service glance-api stop
[iyunv@stackcc update_glance]# service glance-registry stop
[iyunv@stackcc update_glance]# cp -R /etc/glance ./glance-etc
[iyunv@stackcc update_glance]# mysqldump -uglance -p glance > glance.sql

  下载并安装相关软件,因为我之前已经升级完了Keystone及Swift,这里只要安装jsonschema及Glance就可以了。

[iyunv@stackcc update_glance]# pip install jsonschema
[iyunv@stackcc update_glance]# git clone git://github.com/openstack/glance.git
[iyunv@stackcc update_glance]# cd glance
[iyunv@stackcc glance]# git checkout -b folsom origin/stable/folsom
[iyunv@stackcc glance]# python setup.py install > install.info
  补充:如果还要在这台服务器上安装python-glanceclient的话,这里用pip install jsonschema==0.2安装就好,不然也会被删除重装的。原本采用以下方式安装glance的,安装后版本号不对成了0.0.0,我提了个bug在这(详情)

[iyunv@stackcc update_glance]# wget https://github.com/openstack/glance/archive/stable/folsom.zip
[iyunv@stackcc update_glance]# unzip folsom
[iyunv@stackcc update_glance]# cd glance-stable-folsom/
[iyunv@stackcc glance-stable-folsom]# python setup.py install
[iyunv@stackcc glance-stable-folsom]# ll /usr/lib/python2.6/site-packages/ | grep glance
drwxr-xr-x 4 root root 4096 Nov 14 17:00 glance-0.0.0-py2.6.egg
drwxr-xr-x. 4 root root 4096 Jun 2 21:56 glance-2012.1-py2.6.egg

配置Glance
  将F的配置文件拷入到/etc/glance下替换掉原来的文件并修改相关配置,我的修改如下:

[iyunv@stackcc etc]# for file in *; do diff -u $file /etc/glance/$file; done
--- glance-api.conf 2012-11-14 19:12:12.011623218 +0800
+++ /etc/glance/glance-api.conf 2012-11-16 09:44:37.534701521 +0800
@@ -9,7 +9,7 @@
# in a request to add a new image to Glance? Known schemes are determined
# by the known_stores option below.
# Default: 'file'
-default_store = file
+default_store = swift
# List of which store classes and store class locations are
# currently known to glance at startup.
@@ -46,7 +46,7 @@
# SQLAlchemy connection string for the reference implementation
# registry server. Any valid SQLAlchemy connection string is fine.
# See: http://www.sqlalchemy.org/docs/05/reference/sqlalchemy/connections.html#sqlalchemy.create_engine
-sql_connection = sqlite:///glance.sqlite
+sql_connection = mysql://glance:glance@localhost/glance
# Period in seconds after which SQLAlchemy should reestablish its connection
# to the database.
@@ -137,7 +137,7 @@
# There are three methods of sending notifications, logging (via the
# log_file directive), rabbit (via a rabbitmq queue), qpid (via a Qpid
# message queue), or noop (no notifications sent, the default)
-notifier_strategy = noop
+notifier_strategy = qpid
# Configuration options if sending notifications via rabbitmq (these are
# the defaults)
@@ -192,7 +192,7 @@
# If you use Swift authentication service, set it to 'account':'user'
# where 'account' is a Swift storage account and 'user'
# is a user in that account
-swift_store_user = jdoe:jdoe
+swift_store_user = service:glance
# Auth key for the user authenticating against the
# Swift authentication service
@@ -203,7 +203,7 @@
swift_store_container = glance
# Do we create the container if it does not exist?
-swift_store_create_container_on_put = False
+swift_store_create_container_on_put = True
# What size, in MB, should Glance start chunking image files
# and do a large object manifest in Swift? By default, this is
@@ -311,16 +311,16 @@
auth_host = 127.0.0.1
auth_port = 35357
auth_protocol = http
-admin_tenant_name = %SERVICE_TENANT_NAME%
-admin_user = %SERVICE_USER%
-admin_password = %SERVICE_PASSWORD%
+admin_tenant_name = service
+admin_user = glance
+admin_password = service123
[paste_deploy]
# Name of the paste configuration file that defines the available pipelines
-#config_file = glance-api-paste.ini
+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=
+flavor=keystone
--- glance-registry.conf 2012-11-14 19:10:51.688606629 +0800
+++ /etc/glance/glance-registry.conf 2012-11-14 19:48:43.600719378 +0800
@@ -25,7 +25,7 @@
# SQLAlchemy connection string for the reference implementation
# registry server. Any valid SQLAlchemy connection string is fine.
# See: http://www.sqlalchemy.org/docs/05/reference/sqlalchemy/connections.html#sqlalchemy.create_engine
-sql_connection = sqlite:///glance.sqlite
+sql_connection = mysql://glance:glance@localhost/glance
# Period in seconds after which SQLAlchemy should reestablish its connection
# to the database.
@@ -71,16 +71,16 @@
auth_host = 127.0.0.1
auth_port = 35357
auth_protocol = http
-admin_tenant_name = %SERVICE_TENANT_NAME%
-admin_user = %SERVICE_USER%
-admin_password = %SERVICE_PASSWORD%
+admin_tenant_name = service
+admin_user = glance
+admin_password = service123
[paste_deploy]
# Name of the paste configuration file that defines the available pipelines
-#config_file = glance-registry-paste.ini
+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-registry-keystone], you would configure the flavor below
# as 'keystone'.
-#flavor=
+flavor=keystone

  注意这里的config_file文件的路径要写绝对路径,不然在用glance index命令时就只出了个标题行,就没其它内容了,也不返回。

同步数据库并启动相关服务

[iyunv@stackcc glance]# glance-manage db_sync
[iyunv@stackcc glance]# glance-manage db_version
15
[iyunv@stackcc glance]# service glance-api start
[iyunv@stackcc glance]# service glance-registry start
[iyunv@stackcc glance]# service glance-api status
glance-api (pid  13218) is running...
[iyunv@stackcc glance]# service glance-registry status
glance-registry (pid  13331) is running...
  测试命令glance index发现有警告,可以通过pip install python-glanceclient安装新版的glanceclient并且会依赖安装python-keystoneclient,替换我刚安装的jsonschema为0.2版本,升级prettytable==0.6.1,如果机器上安装有E版的novaclient会冲突,可以用pip uninstall python-novaclient直接卸载再用pip install python-novaclient安装新版(这里我尝试不卸载老版直接安装没有反应)。最后如果要使用v2版api还需要调整Keystone中的endpoint。
  北方工业大学 |
云计算研究中心 | 姜永

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-162042-1-1.html 上篇帖子: openstack安全组规则 下篇帖子: OpenStack版本升级之Swift
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表