每天进步一点点——/srv/node不存在导致object-updater和container-updater崩溃(Swift Bug)

转载请说明出处:http://blog.csdn.net/cywosp/article/details/23850893    

   最近在开发过程中遇到了swift中合理的bug,为什么说合理呢?且看bug的场景描述。
    现在有两台服务器A和B用于配制swift集群,由于某种原因A上的磁盘都没有被加入到ring文件中,只有B中的磁盘被加入了进来,但是A和B的/etc/swift/目录中所有ring文件都是对应相同的,如果当前A上的/srv/node目录不存在,此时分别去开启两太机器所有的swift服务,那么B将没有任何错误而A机器上将会报如下错误:
Apr 15 02:35:23 localhost object-updater UNCAUGHT EXCEPTION#012Traceback (most recent call last):#012 File "/usr/bin/swift-object-updater", line 23, in #012 run_daemon(ObjectUpdater, conf_file, **options)#012 File "/usr/lib/python2.6/site-packages/swift/common/daemon.py", line 110, in run_daemon#012 klass(conf).run(once=once, **kwargs)#012 File "/usr/lib/python2.6/site-packages/swift/common/daemon.py", line 57, in run#012 self.run_forever(**kwargs)#012 File "/usr/lib/python2.6/site-packages/swift/obj/updater.py", line 73, in run_forever#012 for device in os.listdir(self.devices):#012OSError: [Errno 2] No such file or directory: '/srv/node'

Apr 15 02:33:10 localhost container-updater UNCAUGHT EXCEPTION#012Traceback (most recent call last):#012 File "/usr/bin/swift-container-updater", line 23, in #012 run_daemon(ContainerUpdater, conf_file, **options)#012 File "/usr/lib/python2.6/site-packages/swift/common/daemon.py", line 110, in run_daemon#012 klass(conf).run(once=once, **kwargs)#012 File "/usr/lib/python2.6/site-packages/swift/common/daemon.py", line 57, in run#012 self.run_forever(**kwargs)#012 File "/usr/lib/python2.6/site-packages/swift/container/updater.py", line 123, in run_forever#012    for path in self.get_paths():#012 File "/usr/lib/python2.6/site-packages/swift/container/updater.py", line 80, in get_paths#012 for device in os.listdir(self.devices):#012OSError: [Errno 2] No such file or directory: '/srv/node'
通过上面的日志我们可以知道object-updater和container-updater两个进程都发生未知异常,从而奔溃了。

    从上面的描述可以解释为什么该问题是合理的了,因为A服务器上没有任何存储设备,因此,所有数据都不会被写到该节点上,该节点只相当于一个proxy部署节点,除了proxy服务外其他所有服务都可以关闭,所以object-updater和container-updater停止了,将是对系统资源的释放。


你可能感兴趣的:(OpenStack,openstack,swift)