openstack-swift-object.service等服务重启不成功

[[email protected] swift]

# systemctl status openstack-swift-object.service openstack-swift-object-auditor.service openstack-swift-object-replicator.service openstack-swift-object-updater.service -l
● openstack-swift-object.service – OpenStack Object Storage (swift) – Object Server
Loaded: loaded (/usr/lib/systemd/system/openstack-swift-object.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2019-02-19 00:20:53 EST; 3s ago
Main PID: 24340 (swift-object-se)
Tasks: 4
CGroup: /system.slice/openstack-swift-object.service
├─24340 /usr/bin/python2 /usr/bin/swift-object-server /etc/swift/object-server.conf
├─24376 /usr/bin/python2 /usr/bin/swift-object-server /etc/swift/object-server.conf
├─24378 /usr/bin/python2 /usr/bin/swift-object-server /etc/swift/object-server.conf
└─24379 /usr/bin/python2 /usr/bin/swift-object-server /etc/swift/object-server.conf

Feb 19 00:20:53 object1 systemd[1]: Started OpenStack Object Storage (swift) – Object Server.
Feb 19 00:20:53 object1 object-server[24340]: Started child 24376
Feb 19 00:20:53 object1 object-server[24340]: Started child 24378
Feb 19 00:20:53 object1 object-server[24340]: Started child 24379

● openstack-swift-object-auditor.service – OpenStack Object Storage (swift) – Object Auditor
Loaded: loaded (/usr/lib/systemd/system/openstack-swift-object-auditor.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2019-02-19 00:20:53 EST; 3s ago
Main PID: 24337 (swift-object-au)
Tasks: 2
CGroup: /system.slice/openstack-swift-object-auditor.service
└─24337 /usr/bin/python2 /usr/bin/swift-object-auditor /etc/swift/object-server.conf

Feb 19 00:20:53 object1 systemd[1]: Started OpenStack Object Storage (swift) – Object Auditor.
Feb 19 00:20:53 object1 object-auditor[24337]: Exception dumping recon cache: #012Traceback (most recent call last):#012 File “/usr/lib/python2.7/site-packages/swift/common/utils.py”, line 2597, in dump_recon_cache#012 with lock_file(cache_file, lock_timeout, unlink=False) as cf:#012 File “/usr/lib64/python2.7/contextlib.py”, line 17, in enter#012 return self.gen.next()#012 File “/usr/lib/python2.7/site-packages/swift/common/utils.py”, line 1877, in lock_file#012 fd = os.open(filename, flags)#012OSError: [Errno 13] Permission denied: ‘/var/cache/swift/object.recon’
Feb 19 00:20:53 object1 object-auditor[24337]: Exception dumping recon cache: #012Traceback (most recent call last):#012 File “/usr/lib/python2.7/site-packages/swift/common/utils.py”, line 2597, in dump_recon_cache#012 with lock_file(cache_file, lock_timeout, unlink=False) as cf:#012 File “/usr/lib64/python2.7/contextlib.py”, line 17, in enter#012 return self.gen.next()#012 File “/usr/lib/python2.7/site-packages/swift/common/utils.py”, line 1877, in lock_file#012 fd = os.open(filename, flags)#012OSError: [Errno 13] Permission denied: ‘/var/cache/swift/object.recon’
Feb 19 00:20:53 object1 object-auditor[24372]: Begin object audit “forever” mode (ZBF)
Feb 19 00:20:53 object1 object-auditor[24372]: Object audit (ZBF) “forever” mode completed: 0.00s. Total quarantined: 0, Total errors: 0, Total files/sec: 0.00, Total bytes/sec: 0.00, Auditing time: 0.00, Rate: 0.00
Feb 19 00:20:53 object1 object-auditor[24373]: Begin object audit “forever” mode (ALL)
Feb 19 00:20:53 object1 object-auditor[24373]: Object audit (ALL) “forever” mode completed: 0.00s. Total quarantined: 0, Total errors: 0, Total files/sec: 0.00, Total bytes/sec: 0.00, Auditing time: 0.00, Rate: 0.00

● openstack-swift-object-replicator.service – OpenStack Object Storage (swift) – Object Replicator
Loaded: loaded (/usr/lib/systemd/system/openstack-swift-object-replicator.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2019-02-19 00:20:53 EST; 3s ago
Main PID: 24338 (swift-object-re)
Tasks: 1
CGroup: /system.slice/openstack-swift-object-replicator.service
└─24338 /usr/bin/python2 /usr/bin/swift-object-replicator /etc/swift/object-server.conf

Feb 19 00:20:53 object1 systemd[1]: Started OpenStack Object Storage (swift) – Object Replicator.
Feb 19 00:20:53 object1 object-replicator[24338]: Starting object replicator in daemon mode.
Feb 19 00:20:53 object1 object-replicator[24338]: Starting object replication pass.
Feb 19 00:20:53 object1 object-replicator[24338]: Nothing replicated for 0.00165200233459 seconds.
Feb 19 00:20:53 object1 object-replicator[24338]: Object replication complete. (0.00 minutes)
Feb 19 00:20:53 object1 object-replicator[24338]: Exception dumping recon cache: #012Traceback (most recent call last):#012 File “/usr/lib/python2.7/site-packages/swift/common/utils.py”, line 2597, in dump_recon_cache#012 with lock_file(cache_file, lock_timeout, unlink=False) as cf:#012 File “/usr/lib64/python2.7/contextlib.py”, line 17, in enter#012 return self.gen.next()#012 File “/usr/lib/python2.7/site-packages/swift/common/utils.py”, line 1877, in lock_file#012 fd = os.open(filename, flags)#012OSError: [Errno 13] Permission denied: ‘/var/cache/swift/object.recon’

● openstack-swift-object-updater.service – OpenStack Object Storage (swift) – Object Updater
Loaded: loaded (/usr/lib/systemd/system/openstack-swift-object-updater.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2019-02-19 00:20:53 EST; 3s ago
Main PID: 24342 (swift-object-up)
Tasks: 1
CGroup: /system.slice/openstack-swift-object-updater.service
└─24342 /usr/bin/python2 /usr/bin/swift-object-updater /etc/swift/object-server.conf

Feb 19 00:20:53 object1 systemd[1]: Started OpenStack Object Storage (swift) – Object Updater.

重启以上服务均报错(systemctl restart openstack-swift-object.service openstack-swift-object-auditor.service openstack-swift-object-replicator.service openstack-swift-object-updater.service)

报错如下

Feb 19 00:20:53 object1 object-auditor[24337]: Exception dumping recon cache: #012Traceback (most recent call last):#012 File “/usr/lib/python2.7/site-packages/swift/common/utils.py”, line 2597, in dump_recon_cache#012 with lock_file(cache_file, lock_timeout, unlink=False) as cf:#012 File “/usr/lib64/python2.7/contextlib.py”, line 17, in enter#012 return self.gen.next()#012 File “/usr/lib/python2.7/site-packages/swift/common/utils.py”, line 1877, in lock_file#012 fd = os.open(filename, flags)#012OSError: [Errno 13] Permission denied: ‘/var/cache/swift/object.recon’

解决方法参考https://bugs.launchpad.net/openstack-manuals/+bug/1569878

at the place of the command “chown -R root:swift /var/cache/swift”, we need also execute the command “chmod -R 775 /var/cache/swift”, as when we make dir (as root user) with command “mkdir -p /var/cache/swift”, the access permission of dir /var/cache/swift will be 755(as rwxr-xr-x), which means “swift” user can not write file in this dir. so the exception like below will occur in the log /var/log/messages.”[Errno 13] Permission denied: ‘/var/cache/swift/object.recon'”
—————————
Apr 13 20:36:27 kvm-sz-004-003 object-auditor: Exception dumping recon cache: #012Traceback (most recent call last):#012 File “/usr/lib/python2.7/site-packages/swift/common/utils.py”, line 2597, in dump_recon_cache#012 with lock_file(cache_file, lock_timeout, unlink=False) as cf:#012 File “/usr/lib64/python2.7/contextlib.py”, line 17, in __enter__#012 return self.gen.next()#012 File “/usr/lib/python2.7/site-packages/swift/common/utils.py”, line 1877, in lock_file#012 fd = os.open(filename, flags)#012OSError: [Errno 13] Permission denied: ‘/var/cache/swift/object.recon’
—————————-
if we execute the command “chmod -R 775 /var/cache/swift”, this kind of exception will not occur.

———————————–
Release: 0.1 on 2016-04-13 06:51
SHA: 97286840e4879e0e0ec745b9c813d396f218f032
Source: http://git.openstack.org/cgit/openstack/openstack-manuals/tree/doc/install-guide/source/swift-storage-install.rst
URL: http://docs.openstack.org/liberty/install-guide-rdo/swift-storage-install.html

也就是将/var/cache/swift 配置权限为755,即使你看到是755也要使用chmod命令设置一次,然后再重启服务,一切正常了。

此条目发表在OpenStack分类目录,贴了标签。将固定链接加入收藏夹。

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注