我在 ubuntu 20.04 上使用 openstack Yoga 尝试创建私有云,当我启动 swift 代理服务时,我在控制器节点上遇到了问题,它总是失败,这阻止了我启动 swift 节点! 这是错误:
root@controller:/home/oussema# systemctl status swift-proxy
swift-proxy.service - OpenStack Swift proxy server
Loaded: loaded (/lib/systemd/system/swift-proxy.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2023-12-19 08:14:35 PST; 6min ago
Docs: man:swift-proxy-server(1)
Process: 7973 ExecStart=/usr/bin/swift-proxy-server /etc/swift/proxy-server.conf (code=exited, status=1/FAILURE)
Main PID: 7973 (code=exited, status=1/FAILURE)
Dec 19 08:14:35 controller systemd[1]: swift-proxy.service: Scheduled restart job, restart counter is at 5.
Dec 19 08:14:35 controller systemd[1]: Stopped OpenStack Swift proxy server.
Dec 19 08:14:35 controller systemd[1]: swift-proxy.service: Start request repeated too quickly.
Dec 19 08:14:35 controller systemd[1]: swift-proxy.service: Failed with result 'exit-code'.
Dec 19 08:14:35 controller systemd[1]: Failed to start OpenStack Swift proxy server.
这是 swift-proxy.conf 文件:
[DEFAULT]
bind_port = 8080
user = swift
swift_dir = /etc/swift
expose_info = true
[pipeline:main]
pipeline = catch_errors gatekeeper healthcheck proxy-logging cache container_sync bulk ratelimit authtoken keystoneauth container-quotas account-quotas slo dlo versioned_writes proxy-logging proxy-server
[app:proxy-server]
account_autocreate = True
[filter:tempauth]
user_admin_admin = admin .admin .reseller_admin
user_admin_auditor = admin_ro .reseller_reader
user_test_tester = testing .admin
user_test_tester2 = testing2 .admin
user_test_tester3 = testing3
user_test2_tester2 = testing2 .admin
user_test5_tester5 = testing5 service
[filter:authtoken]
paste.filter_factory = keystonemiddleware.auth_token:filter_factory
www_authenticate_uri = http://10.0.0.11:5000
auth_url = http://10.0.0.11:5000
memcached_servers = 10.0.0.11:11211
auth_type = password
project_domain_id = default
user_domain_id = default
project_name = service
username = swift
password = root
delay_auth_decision = True
[filter:keystoneauth]
operator_roles = admin,user
[filter:s3token]
reseller_prefix = AUTH_
delay_auth_decision = False
auth_uri = http://keystonehost:5000/v3
http_timeout = 10.0
[filter:cache]
memcache_servers = 10.0.0.11:11211
[filter:keymaster]
meta_version_to_write = 2
encryption_root_secret = changeme
当我尝试运行 swift-init 时,所有这些都从对象存储节点开始 我得到这个输出:
account-replicator running (3459 - /etc/swift/account-server.conf)
account-replicator already started...
Unable to locate config for container-reconciler
object-reconstructor running (3461 - /etc/swift/object-server.conf)
object-reconstructor already started...
Starting container-server...(/etc/swift/container-server.conf)
Starting account-server...(/etc/swift/account-server.conf)
account-auditor running (3456 - /etc/swift/account-server.conf)
account-auditor already started...
account-reaper running (3460 - /etc/swift/account-server.conf)
account-reaper already started...
container-auditor running (3457 - /etc/swift/container-server.conf)
container-auditor already started...
container-updater running (3454 - /etc/swift/container-server.conf)
container-updater already started...
container-replicator running (3463 - /etc/swift/container-server.conf)
container-replicator already started...
container-sharder running (3464 - /etc/swift/container-server.conf)
container-sharder already started...
object-auditor running (3453 - /etc/swift/object-server.conf)
object-auditor already started...
Starting object-server...(/etc/swift/object-server.conf)
object-updater running (3455 - /etc/swift/object-server.conf)
object-updater already started...
container-sync running (3462 - /etc/swift/container-server.conf)
container-sync already started...
object-replicator running (3458 - /etc/swift/object-server.conf)
object-replicator already started...
Traceback (most recent call last):
File "/usr/bin/swift-container-server", line 23, in <module>
sys.exit(run_wsgi(conf_file, 'container-server', **options))
File "/usr/lib/python3/dist-packages/swift/common/wsgi.py", line 864, in run_wsgi
for sock, sock_info in strategy.new_worker_socks():
File "/usr/lib/python3/dist-packages/swift/common/wsgi.py", line 565, in new_worker_socks
yield get_socket(self.conf), None
File "/usr/lib/python3/dist-packages/swift/common/wsgi.py", line 206, in get_socket
raise Exception(_('Could not bind to %(addr)s:%(port)s '
Exception: Could not bind to 10.0.0.42:6201 after trying for 30 seconds
Traceback (most recent call last):
File "/usr/bin/swift-account-server", line 23, in <module>
sys.exit(run_wsgi(conf_file, 'account-server', **options))
File "/usr/lib/python3/dist-packages/swift/common/wsgi.py", line 864, in run_wsgi
for sock, sock_info in strategy.new_worker_socks():
File "/usr/lib/python3/dist-packages/swift/common/wsgi.py", line 565, in new_worker_socks
yield get_socket(self.conf), None
File "/usr/lib/python3/dist-packages/swift/common/wsgi.py", line 206, in get_socket
raise Exception(_('Could not bind to %(addr)s:%(port)s '
Exception: Could not bind to 10.0.0.42:6202 after trying for 30 seconds
Traceback (most recent call last):
File "/usr/bin/swift-object-server", line 25, in <module>
sys.exit(run_wsgi(conf_file, 'object-server',
File "/usr/lib/python3/dist-packages/swift/common/wsgi.py", line 864, in run_wsgi
for sock, sock_info in strategy.new_worker_socks():
File "/usr/lib/python3/dist-packages/swift/common/wsgi.py", line 565, in new_worker_socks
yield get_socket(self.conf), None
File "/usr/lib/python3/dist-packages/swift/common/wsgi.py", line 206, in get_socket
raise Exception(_('Could not bind to %(addr)s:%(port)s '
Exception: Could not bind to 10.0.0.42:6200 after trying for 30 seconds
这是我的 swift.conf 文件:
[swift-hash]
swift_hash_path_suffix = Secretprefix
swift_hash_path_prefix = Secretsuffix
[storage-policy:0]
name = Policy-0
default = yes
aliases = yellow, orange
我按照文档完成了所有这些步骤。 如果有更多问题,我将不胜感激,我确实需要帮助:) .
我尝试检查端口 8080 是否已被占用,但事实并非如此, 我不知道我可能会错过什么,因为我遵循了文档的每个步骤。
当我尝试时:它无法识别 .conf 属性!!
> $sudo /usr/bin/swift-proxy-server /etc/swift/proxy-server.conf
The option "bind_port" is not known to keystonemiddleware
The option "user" is not known to keystonemiddleware
The option "swift_dir" is not known to keystonemiddleware
The option "log_name" is not known to keystonemiddleware
The option "auth_url" is not known to keystonemiddleware
The option "project_domain_id" is not known to keystonemiddleware
The option "user_domain_id" is not known to keystonemiddleware
The option "project_name" is not known to keystonemiddleware
The option "username" is not known to keystonemiddleware
The option "password" is not known to keystonemiddleware
The option "__name__" is not known to keystonemiddleware
Traceback (most recent call last):
File "/usr/bin/swift-proxy-server", line 23, in <module>
sys.exit(run_wsgi(conf_file, 'proxy-server', **options))
File "/usr/lib/python3/dist-packages/swift/common/wsgi.py", line 896, in run_wsgi
raise Exception(
Exception: worker did not start normally: b''
听起来您正在尝试设置一个 Swift 对象存储集群。 Swift代理服务负责将请求路由到适当的存储节点并提供高可用性。如果失败,可能会阻止 swift 节点启动。
导致 swift 代理服务失败的原因可能有多种,例如配置错误、网络问题或依赖问题。
要解决此问题,您可以尝试以下步骤:
检查 swift 代理服务的日志是否有任何错误或警告。默认情况下,您可以在 /var/log/swift/proxy-server.log 中找到日志。
验证 swift 代理服务是否已启用并正在运行。您可以使用命令 systemctl status swift-proxy 来检查服务的状态。
确保 swift 代理服务配置文件 (/etc/swift/proxy-server.conf) 正确且与文档相符。请注意 [DEFAULT]、[pipeline:main] 和 [filter:keystoneauth] 部分。
确保 swift 代理服务可以与其他 OpenStack 服务(例如 Keystone、Glance 和 Nova)通信。您可以使用命令 openstack端点列表来检查服务的端点并使用curl或ping测试连接。
更新部署主机的系统包和内核。这可以帮助解决任何兼容性或安全问题。
您可以使用命令 sudo apt update && sudo apt Upgrade 来更新软件包,并使用 sudo restart 来重新启动主机..
凯雷姆·切利克 // 云架构主管