openstack swift節點安裝手冊3-最後的安裝配置及驗證

來源:互聯網
上載者:User

標籤:contain   upd   查看   enable   chown   date   資訊   建立目錄   name   

以下步驟都在controller節點上執行

1、遠程擷取/etc/swift/swift.conf檔案:

curl -o /etc/swift/swift.conf https://git.openstack.org/cgit/openstack/swift/plain/etc/swift.conf-sample?h=stable/newton

2、修改/etc/swift/swift.conf設定檔:

[swift-hash]...swift_hash_path_suffix = HASH_PATH_SUFFIXswift_hash_path_prefix = HASH_PATH_PREFIX
[storage-policy:0]name = Policy-0default = yes
注意:storage-policy:0這個配置項下面只保留上述幾行,其他的注釋掉

3、把/etc/swift/swift.conf這個檔案從controller節點拷貝到每一個swift節點,然後在各個swift節點上執行以下命令:

 chown -R root:swift /etc/swift

4、啟動服務:
在controller節點執行:

systemctl enable openstack-swift-proxy.service memcached.service# systemctl start openstack-swift-proxy.service memcached.service

在swift節點執行:

systemctl enable openstack-swift-account.service openstack-swift-account-auditor.service openstack-swift-account-reaper.service openstack-swift-account-replicator.servicesystemctl start openstack-swift-account.service openstack-swift-account-auditor.service openstack-swift-account-reaper.service openstack-swift-account-replicator.servicesystemctl enable openstack-swift-container.service openstack-swift-container-auditor.service openstack-swift-container-replicator.service openstack-swift-container-updater.servicesystemctl start openstack-swift-container.service openstack-swift-container-auditor.service openstack-swift-container-replicator.service openstack-swift-container-updater.servicesystemctl enable openstack-swift-object.service openstack-swift-object-auditor.service openstack-swift-object-replicator.service openstack-swift-object-updater.servicesystemctl start openstack-swift-object.service openstack-swift-object-auditor.service openstack-swift-object-replicator.service openstack-swift-object-updater.service

安裝驗證:

先給節點賦予許可權 chcon -R system_u:object_r:swift_data_t:s0 /srv/node
然後在controller節點執行source /root/demo-openrc.sh ,初始化相關的環境變數
再執行swift stat命令,查看是否有相關資訊
執行openstack container create container1查看是否可以建立目錄,如果失敗,可以查看swift節點上的log。
如果遇到提示說是無許可權,在swift節點執行restorecon -R /srv/node命令然後重啟服務即可
 


openstack swift節點安裝手冊3-最後的安裝配置及驗證

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.