close

如果參考社區的文檔,在Redhat7.1系統上安裝swift,會發現陷入到無窮無盡的 can not access directory or file, Permission Denied 什麽原因呢,實際上是selinux context導致的權限問題。 這個是社區的文檔 http://docs.openstack.org/kilo/install-guide/install/yum/content/swift-install-storage-node.html Step6 中, Ensure proper ownership of the mount point directory structure: # chown -R swift:swift /srv/node 實際上這樣的權限是 #ls -Z /srv/node drwxr-xr-x. swift swift system_u:object_r:unlabeled_t:s0 sdb1 需要執行: #restorecon -R /srv/node 然後再查看: #ls -Z /srv/node drwxr-xr-x. swift swift system_u:object_r:swift_data_t:s0 sdb1 這樣就不會出現問題了,對於/var/cache/swift 同樣適用 下面我做了另外一個實驗,不使用本地的實際硬盤,創建一個loop device,使用xfs進行格式化。然後掛載來作為swift的back storage。關於如何開機自動掛載loop device可以參考【3】 比如, xfs loop,noatime,nodiratime,nobarrier,logbufs=8 0 0 測試發現,如果 的前綴path是/srv/node 開始的,這樣是沒有問題的,但是如果換做其他的path,比如/etc/swift 就會出現Permission Denied問題(restorecon 無法解決) 據cschwede說,everything under /srv and /var/run/swift should work 我沒有測試/var/run/swift,但是/etc/swift是有問題的,後來ho建議了一個增加mount option的方法, xfs loop,noatime,nodiratime,nobarrier,logbufs=8,context=system_u:object_r:swift_data_t:s0 0 0 這樣就解決問題了。

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 愛在屋簷下 的頭像
    愛在屋簷下

    愛在屋簷下的部落格

    愛在屋簷下 發表在 痞客邦 留言(0) 人氣()