OpenStack Swift:PID文件不对应于正在运行的进程' PID的;无法重启服务 - 端口已经绑定

时间:2016-01-21 12:06:17

标签: openstack openstack-swift

我在CentOS 7主机上使用Swift(" Swift all-in-one")运行Docker容器。我注意到/var/run/swift/*.pid文件中的PID与系统中运行的实际PID不同:

root@5293f4890016:/var/run/swift# for pidfile in `ls`; do echo $pidfile: `cat $pidfile`; done
account-auditor.pid: 219
account-reaper.pid: 285
account-replicator.pid: 291
account-server.pid: 274
container-auditor.pid: 264
container-replicator.pid: 256
container-server.pid: 267
container-sync.pid: 288
container-updater.pid: 216
object-auditor.pid: 259
object-replicator.pid: 222
object-server.pid: 297
object-updater.pid: 294
proxy-server.pid: 225
root@5293f4890016:/var/run/swift# ps ax | egrep "account|container|object|proxy"
   21 ?        S      0:00 /usr/bin/python /usr/bin/swift-container-server /etc/swift/container-server.conf
   22 ?        S      0:00 /usr/bin/python /usr/bin/swift-account-reaper /etc/swift/account-server.conf
   23 ?        Sl     0:00 /usr/bin/python /usr/bin/swift-object-replicator /etc/swift/object-server.conf
   24 ?        S      0:00 /usr/bin/python /usr/bin/swift-account-auditor /etc/swift/account-server.conf
   25 ?        S      0:00 /usr/bin/python /usr/bin/swift-object-server /etc/swift/object-server.conf
   27 ?        S      0:00 /usr/bin/python /usr/bin/swift-account-replicator /etc/swift/account-server.conf
   28 ?        S      0:00 /usr/bin/python /usr/bin/swift-account-server /etc/swift/account-server.conf
   30 ?        S      0:00 /usr/bin/python /usr/bin/swift-proxy-server /etc/swift/proxy-server.conf
   31 ?        S      0:00 /usr/bin/python /usr/bin/swift-object-updater /etc/swift/object-server.conf
   81 ?        S      0:00 /usr/bin/python /usr/bin/swift-object-server /etc/swift/object-server.conf
   82 ?        S      0:00 /usr/bin/python /usr/bin/swift-container-server /etc/swift/container-server.conf
   83 ?        S      0:00 /usr/bin/python /usr/bin/swift-account-server /etc/swift/account-server.conf
   84 ?        S      0:00 /usr/bin/python /usr/bin/swift-proxy-server /etc/swift/proxy-server.conf
  114 ?        S      0:00 /usr/bin/python /usr/bin/swift-container-sync /etc/swift/container-server.conf
  135 ?        S+     0:00 egrep account|container|object|proxy

我在尝试(重新)配置Swift代理服务器并因此重新启动时遇到问题。似乎swift-init查找PID 225(参见上面的输出)并且它无法找到它(因为那不是实际的PID)然后尝试启动代理服务器但是端口显然已经绑定了。

我错过了什么,或者我的设置可能有问题?

root@5293f4890016:/# swift-init proxy-server restart
Signal proxy-server  pid: 225  signal: 15
No proxy-server running
WARNING: Unable to modify file descriptor limit.  Running as non-root?
Starting proxy-server...(/etc/swift/proxy-server.conf)
Traceback (most recent call last):
  File "/usr/bin/swift-proxy-server", line 23, in <module>
    sys.exit(run_wsgi(conf_file, 'proxy-server', default_port=8080, **options))
  File "/usr/lib/python2.7/dist-packages/swift/common/wsgi.py", line 381, in run_wsgi
    sock = get_socket(conf, default_port=kwargs.get('default_port', 8080))
  File "/usr/lib/python2.7/dist-packages/swift/common/wsgi.py", line 173, in get_socket
    bind_addr[0], bind_addr[1], bind_timeout))
Exception: Could not bind to 0.0.0.0:8080 after trying for 30 seconds

1 个答案:

答案 0 :(得分:0)

我不确定我的Swift安装有什么问题,但我重新安装它,一切正常。如果遇到同样的问题,请尝试重新安装Swift。