glance創建鏡像失敗

在devstack中,默認的glance後端存儲是放在swift中的.

[glance_store]
stores = file, http, swift
default_swift_reference = ref1
swift_store_config_file = /etc/glance/glance-swift-store.conf
swift_store_create_container_on_put = True
default_store = swift
filesystem_store_datadir = /opt/stack/data/glance/images/
在創建鏡像時,會報錯,命令行會提示:

502 Bad Gateway: Bad Gateway: The proxy server received an invalid: response from an upstream server.: Apache/2.4.18 (Ubuntu) Server at 10.12.32.44 Port 80 (HTTP 502)

查看日誌:

Jan 11 19:41:18 localhost account-server: ERROR __call__ error with PUT /sdb1/418/AUTH_070816cc2bc64f67a3df77039136ea5c : #012Traceback (most recent call last):#012  File "/opt/stack/swift/swift/account/server.py", line 268, in __call__#012    res = getattr(self, req.method)(req)#012  File "/opt/stack/swift/swift/common/utils.py", line 1658, in _timing_stats#012    resp = func(ctrl, *args, **kwargs)#012  File "/opt/stack/swift/swift/account/server.py", line 142, in PUT#012    broker.initialize(timestamp.internal)#012  File "/opt/stack/swift/swift/common/db.py", line 240, in initialize#012    mkdirs(self.db_dir)#012  File "/opt/stack/swift/swift/common/utils.py", line 1183, in mkdirs#012    os.makedirs(path)#012  File "/usr/lib/python2.7/os.py", line 150, in makedirs#012    makedirs(head, mode)#012  File "/usr/lib/python2.7/os.py", line 150, in makedirs#012    makedirs(head, mode)#012  File "/usr/lib/python2.7/os.py", line 150, in makedirs#012    makedirs(head, mode)#012  File "/usr/lib/python2.7/os.py", line 150, in makedirs#012    makedirs(head, mode)#012  File "/usr/lib/python2.7/os.py", line 157, in makedirs#012    mkdir(name, mode)#012OSError: [Errno 2] No such file or directory: '/opt/stack/data/swift/1/sdb1' (txn: txe87bf4d181524afbb06b6-005a582e5e)
根本原因是沒有/opt/stack/data/swift/1/這個目錄,因此到環境中去創建這個目錄,並chown stack:stack 1,然後重啓glance-api即可.



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章