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

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

[复制链接]

尚未签到

发表于 2016-1-9 08:28:56 | 显示全部楼层 |阅读模式
Swift升级的一般流程
  Swift升级的一般流程见参考文档,摘抄如下:

As always, a production Swift cluster can be upgraded live, with no downtime for clients. The normal upgrade path is:
Stop the background processes
Upgrade the packages
Reload the processes (eg swift-init object reload)
Start the background processes
A normal upgrade process will upgrade one storage server in one zone (a "canary node") to check if any unforseen issue arise.
After than node is upgraded, upgrade the other storage nodes in that zone. Next, upgrade each of the remaining zones in turn.
Finally, upgrade each of your proxy servers (one at time).

F版对依赖库的变化
  F版对依赖库的变化主要是添加了一个新的依赖python-swiftclient,另外放宽Webob的版本要求为>=1.0.8,<1.3,详情如下:

[ugyn@localhost swift]$ git diff origin/stable/essex:tools/pip-requires origin/stable/folsom:tools/pip-requires > diff
[ugyn@localhost swift]$ cat diff
diff --git a/origin/stable/essex:tools/pip-requires b/origin/stable/folsom:tools/pip-requires
index f9ea5f2..28bc426 100644
--- a/origin/stable/essex:tools/pip-requires
+++ b/origin/stable/folsom:tools/pip-requires
@@ -1,4 +1,4 @@
-WebOb==1.0.8
+WebOb>=1.0.8,<1.3
configobj==4.7.1
eventlet==0.9.15
greenlet==0.3.1
@@ -6,3 +6,6 @@ netifaces==0.6
pastedeploy==1.3.3
simplejson==2.0.9
xattr==0.4
+
+# Install python-swiftclient from git
+https://github.com/openstack/python-swiftclient/zipball/master#egg=python-swiftclient

升级存储节点
  停止现有服务,并备份配置文件

[iyunv@store1 update_swift]# ../swift-helper stop
Signal object-server  pid: 4016  signal: 15
object-server (4016) appears to have stopped
Signal object-replicator  pid: 4032  signal: 15
object-replicator (4032) appears to have stopped
Signal object-updater  pid: 4059  signal: 15
object-updater (4059) appears to have stopped
Signal object-auditor  pid: 4068  signal: 15
object-auditor (4068) appears to have stopped
Signal container-server  pid: 4090  signal: 15
container-server (4090) appears to have stopped
Signal container-replicator  pid: 4109  signal: 15
container-replicator (4109) appears to have stopped
Signal container-updater  pid: 4115  signal: 15
container-updater (4115) appears to have stopped
Signal container-auditor  pid: 4123  signal: 15
container-auditor (4123) appears to have stopped
Signal account-server  pid: 4129  signal: 15
account-server (4129) appears to have stopped
Signal account-replicator  pid: 4137  signal: 15
account-replicator (4137) appears to have stopped
Signal account-auditor  pid: 4143  signal: 15
account-auditor (4143) appears to have stopped
[iyunv@store1 update_swift]# cp -R /etc/swift ./
  下载并安装相关软件

[iyunv@store1 update_swift]# pip install -d ./ --no-install python-swiftclient
Downloading/unpacking python-swiftclient
Downloading python-swiftclient-1.2.0.tar.gz (46Kb): 46Kb downloaded
Saved ./python-swiftclient-1.2.0.tar.gz
Running setup.py egg_info for package python-swiftclient
Downloading/unpacking simplejson (from python-swiftclient)
Downloading simplejson-2.6.2.tar.gz (53Kb): 53Kb downloaded
Saved ./simplejson-2.6.2.tar.gz
Running setup.py egg_info for package simplejson
Successfully downloaded python-swiftclient simplejson
Cleaning up...
[iyunv@store1 update_swift]# pip install --upgrade simplejson-2.6.2.tar.gz python-swiftclient-1.2.0.tar.gz
[iyunv@store1 update_swift]# wget https://github.com/openstack/swift/archive/stable/folsom.zip
[iyunv@store1 update_swift]# unzip folsom
[iyunv@store1 update_swift]# cd swift-stable-folsom/
[iyunv@store1 swift-stable-folsom]# python setup.py install

  修改配置文件,我的最终的配置文件如下,这里要注意的是前两个配置文件中的db_preallocation项,对于采用SSD盘的应当采用默认的关闭,对于一般的硬盘应当打开,相关说明见这里

[iyunv@store1 etc]# cat account-server.conf
[DEFAULT]
workers = 2
db_preallocation = on
[pipeline:main]
pipeline = recon account-server
[app:account-server]
use = egg:swift#account
[filter:recon]
use = egg:swift#recon
[account-replicator]
[account-auditor]
[account-reaper]
[iyunv@store1 etc]# cat container-server.conf
[DEFAULT]
workers = 4
db_preallocation = on
[pipeline:main]
pipeline = recon container-server
[app:container-server]
use = egg:swift#container
[filter:recon]
use = egg:swift#recon
[container-replicator]
[container-updater]
[container-auditor]
[container-sync]
[iyunv@store1 etc]# cat object-server.conf
[DEFAULT]
workers = 8
[pipeline:main]
pipeline = recon object-server
[app:object-server]
use = egg:swift#object
[filter:recon]
use = egg:swift#recon
[object-replicator]
[object-updater]
[object-auditor]

  创建缓存目录

[iyunv@store1 etc]# mkdir /var/cache/swift
[iyunv@store1 etc]# chown swift:swift /var/cache/swift
  启动相关服务

[iyunv@store1 etc]# swift-init object container account reload
No container-server running
Starting container-server...(/etc/swift/container-server.conf)
No account-server running
Starting account-server...(/etc/swift/account-server.conf)
No object-server running
Starting object-server...(/etc/swift/object-server.conf)
[iyunv@store1 ~]# ./swift-helper restart
Signal object-server  pid: 7320  signal: 15
object-server (7320) appears to have stopped
Starting object-server...(/etc/swift/object-server.conf)
No object-replicator running
Starting object-replicator...(/etc/swift/object-server.conf)
No object-updater running
Starting object-updater...(/etc/swift/object-server.conf)
No object-auditor running
Starting object-auditor...(/etc/swift/object-server.conf)
Signal container-server  pid: 7305  signal: 15
container-server (7305) appears to have stopped
Starting container-server...(/etc/swift/container-server.conf)
No container-replicator running
Starting container-replicator...(/etc/swift/container-server.conf)
No container-updater running
Starting container-updater...(/etc/swift/container-server.conf)
No container-auditor running
Starting container-auditor...(/etc/swift/container-server.conf)
Signal account-server  pid: 7312  signal: 15
account-server (7312) appears to have stopped
Starting account-server...(/etc/swift/account-server.conf)
No account-replicator running
Starting account-replicator...(/etc/swift/account-server.conf)
No account-auditor running
Starting account-auditor...(/etc/swift/account-server.conf)

  升级完成一个存储节点后再按照升级流程依次完成其它存储节点的升级。

升级代理节点
  升级代理节点基本同上面存储节点的升级,停止代理服务,安装相关软件,修改代理服务配置文件,启动代理服务。升级的时候需要注意几点,一是swift3已经从swift项目里移出了,有需要的话得另外安装(详情)。二是F版可以使用新的或旧的rings而E版只可以使用旧的rings,如果要考虑降级的话先不要更新rings(详情)。三是缓存的平滑过度问题(详情)。最后贴一下我修改后的配置:

[iyunv@stackcc ~]# cat /etc/swift/proxy-server.conf
[DEFAULT]
bind_port = 8888
[pipeline:main]
pipeline = catch_errors healthcheck cache ratelimit formpost tempurl authtoken keystoneauth staticweb proxy-logging name_check proxy-server
[app:proxy-server]
use = egg:swift#proxy
account_autocreate = true
[filter:authtoken]
paste.filter_factory = keystone.middleware.auth_token:filter_factory
auth_host = localhost
auth_port = 35357
auth_protocol = http
auth_uri = http://localhost:5000/
admin_tenant_name = service
admin_user = swift
admin_password = service123
delay_auth_decision = 1
signing_dir = /etc/swift
[filter:keystoneauth]
use = egg:swift#keystoneauth
operator_roles = admin, swiftoperator
[filter:healthcheck]
use = egg:swift#healthcheck
[filter:cache]
use = egg:swift#memcache
[filter:ratelimit]
use = egg:swift#ratelimit
[filter:catch_errors]
use = egg:swift#catch_errors
[filter:staticweb]
use = egg:swift#staticweb
[filter:tempurl]
use = egg:swift#tempurl
[filter:formpost]
use = egg:swift#formpost
[filter:name_check]
use = egg:swift#name_check
[filter:proxy-logging]
use = egg:swift#proxy_logging

  北方工业大学 |
云计算研究中心 | 姜永

运维网声明 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-162043-1-1.html 上篇帖子: OpenStack版本升级之Glance 下篇帖子: 大话openstack之资源刷新
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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

扫描微信二维码查看详情

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


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


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


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



合作伙伴: 青云cloud

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