openstack安装(liberty)--安装对象存储服务(swift)

前端之家收集整理的这篇文章主要介绍了openstack安装(liberty)--安装对象存储服务(swift)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

九、安装对象存储服务(swift),不使用控制節點數據庫服務,而於各存儲節點使用分布式sqlite數據庫。

9.1对象存储服务包括的组件

Proxy servers (swift-proxy-server)代理服務,接收API或HTTP請求,執行上傳文件修改源數據、WEB瀏覽時列表文件和創建容器等操作。通常使用CACHE技術(memcache)提高性能

Account servers (swift-account-server)賬戶服務,管理對象存儲中的賬戶定義。

Container servers (swift-container-server)容器服務,在對象存儲中管理容器或文件夾映……

Object servers (swift-object-server)對象服務,在存儲節點管理實際的對象,比如文件

VarIoUs periodic processes執行各種週期性任務,比如複製服務確保群集中數據一致性和可用性。其他包括審計、更新、以及資源回收等。

WSGI middleware處理認證,通常使用OPENSTACK Identity

swift client為用戶提供命令行接口使用REST API

swift-init初始化和構建RING文件腳本

swift-recon一個命令行工具,用於檢索群集的各種度量和測試信息。

swift-ring-builder存儲RING構建和再平衡工具


9.2控制节点安裝配置代理服務(proxy service),用於處理用戶、容器以及對象操作請求,可以部署多個節點提高性能和冗余。可以不基於OPENSTACK其他組件安裝,自身可提供認證機制。

9.2.1創建用戶以及API訪問點

  1. [root@comtroller1~]#.admin-openrc.sh
  2. [root@comtroller1~]#openstackusercreate--domaindefault--password-promptswift
  3. UserPassword:
  4. RepeatUserPassword:
  5. +-----------+----------------------------------+
  6. |Field|Value|
  7. +-----------+----------------------------------+
  8. |domain_id|default|
  9. |enabled|True|
  10. |id|9f9d73e380ac4db0af601604ee45ea02|
  11. |name|swift|
  12. +-----------+----------------------------------+
  13. [root@comtroller1~]#openstackroleadd--projectservice--userswiftadmin
  14. [root@comtroller1~]#openstackservicecreate--nameswift--description"OpenStackObjectStorage"object-store
  15. +-------------+----------------------------------+
  16. |Field|Value|
  17. +-------------+----------------------------------+
  18. |description|OpenStackObjectStorage|
  19. |enabled|True|
  20. |id|6cbf871fbf5f4cb192a1e1337e59e5ed|
  21. |name|swift|
  22. |type|object-store|
  23. +-------------+----------------------------------+
  24. [root@comtroller1~]#openstackendpointcreate--regionRegionOneobject-storepublichttp://controller1:8080/v1/AUTH_%\(tenant_id\)s
  25. +--------------+-----------------------------------------------+
  26. |Field|Value|
  27. +--------------+-----------------------------------------------+
  28. |enabled|True|
  29. |id|9850ec8e31b7434090cca0d881355b46|
  30. |interface|public|
  31. |region|RegionOne|
  32. |region_id|RegionOne|
  33. |service_id|6cbf871fbf5f4cb192a1e1337e59e5ed|
  34. |service_name|swift|
  35. |service_type|object-store|
  36. |url|http://controller1:8080/v1/AUTH_%(tenant_id)s|
  37. +--------------+-----------------------------------------------+
  38. [root@comtroller1~]#openstackendpointcreate--regionRegionOneobject-storeinternalhttp://controller1:8080/v1/AUTH_%\(tenant_id\)s
  39. +--------------+-----------------------------------------------+
  40. |Field|Value|
  41. +--------------+-----------------------------------------------+
  42. |enabled|True|
  43. |id|11a006619fc24414accc7117a4daabc9|
  44. |interface|internal|
  45. |region|RegionOne|
  46. |region_id|RegionOne|
  47. |service_id|6cbf871fbf5f4cb192a1e1337e59e5ed|
  48. |service_name|swift|
  49. |service_type|object-store|
  50. |url|http://controller1:8080/v1/AUTH_%(tenant_id)s|
  51. +--------------+-----------------------------------------------+
  52. [root@comtroller1~]#openstackendpointcreate--regionRegionOneobject-storeadminhttp://controller1:8080/v1
  53. +--------------+----------------------------------+
  54. |Field|Value|
  55. +--------------+----------------------------------+
  56. |enabled|True|
  57. |id|4d52cf1cf9ab4eab8e14c5db7a564960|
  58. |interface|admin|
  59. |region|RegionOne|
  60. |region_id|RegionOne|
  61. |service_id|6cbf871fbf5f4cb192a1e1337e59e5ed|
  62. |service_name|swift|
  63. |service_type|object-store|
  64. |url|http://controller1:8080/v1|
  65. +--------------+----------------------------------+


9.2.2安裝配置組件

  1. [root@comtroller1~]#yuminstallopenstack-swift-proxypython-swiftclientpython-keystoneclientpython-keystonemiddlewarememcached-y
  2. [root@comtroller1~]#curl-o/etc/swift/proxy-server.confhttps://git.openstack.org/cgit/openstack/swift/plain/etc/proxy-server.conf-sample?h=stable/liberty
  3. %Total%Received%XferdAverageSpeedTimeTimeTimeCurrent
  4. DloadUploadTotalSpentLeftSpeed
  5. 1002965510029655001419400:00:020:00:02--:--:--14188
  6. [root@comtroller1~]#vi/etc/swift/proxy-server.conf
  7. [DEFAULT]
  8. bind_port=8080
  9. user=swift
  10. swift_dir=/etc/swift
  11. [pipeline:main]
  12. pipeline=catch_errorsgatekeeperhealthcheckproxy-loggingcachecontainer_syncbulkratelimitauthtokenkeystoneauthcontainer-quotasaccount-quotasslodloversioned_writesproxy-loggingproxy-server
  13. [app:proxy-server]
  14. use=egg:swift#proxy
  15. account_autocreate=true
  16. [filter:keystoneauth]此项也需要取消注释
  17. use=egg:swift#keystoneauth
  18. operator_roles=admin,user
  19. [filter:authtoken]移除或註釋此配置組下其他項目
  20. paste.filter_factory=keystonemiddleware.auth_token:filter_factory
  21. auth_uri=http://controller1:5000
  22. auth_url=http://controller1:35357
  23. auth_plugin=password
  24. project_domain_id=default
  25. user_domain_id=default
  26. project_name=service
  27. username=swift
  28. password=swift
  29. delay_auth_decision=true
  30. [filter:cache]
  31. use=egg:swift#memcache
  32. memcache_servers=127.0.0.1:11211


9.3安裝配置存儲節點

9.3.1準備存儲節點:支持所有具備extended attributes (xattr)文件系統,推薦使用XFS文件系統。###在兩節點均執行如下準備操作。

  1. [root@object1~]#yuminstallxfsprogsrsync-y
  2. [root@object1~]#ls/dev/sd*
  3. /dev/sda/dev/sda1/dev/sda2/dev/sdb/dev/sdc
  4. [root@object1~]#mkfs.xfs/dev/sdb
  5. Meta-data=/dev/sdbisize=256agcount=4,agsize=8388608blks
  6. =sectsz=512attr=2,projid32bit=1
  7. =crc=0finobt=0
  8. data=bsize=4096blocks=33554432,imaxpct=25
  9. =sunit=0swidth=0blks
  10. naming=version2bsize=4096ascii-ci=0ftype=0
  11. log=internallogbsize=4096blocks=16384,version=2
  12. =sectsz=512sunit=0blks,lazy-count=1
  13. realtime=noneextsz=4096blocks=0,rtextents=0
  14. [root@object1~]#mkfs.xfs/dev/sdc
  15. Meta-data=/dev/sdcisize=256agcount=4,rtextents=0
  16. [root@object1~]#mkdir-p/srv/node/sdb
  17. [root@object1~]#mkdir-p/srv/node/sdc
  18. [root@object1~]#vi/etc/fstab
  19. /dev/sdb/srv/node/sdbxfsnoatime,nodiratime,nobarrier,logbufs=802
  20. /dev/sdc/srv/node/sdcxfsnoatime,logbufs=802
  21. [root@object1~]#mount/srv/node/sdb
  22. [root@object1~]#mount/srv/node/sdc
  23. [root@object1~]#vi/etc/rsyncd.conf
  24. uid=swift
  25. gid=swift
  26. logfile=/var/log/rsyncd.log
  27. pidfile=/var/run/rsyncd.pid
  28. address=10.0.0.51###對應存儲節點IP地址
  29. [account]
  30. maxconnections=2
  31. path=/srv/node/
  32. readonly=false
  33. lockfile=/var/lock/account.lock
  34. [container]
  35. maxconnections=2
  36. path=/srv/node/
  37. readonly=false
  38. lockfile=/var/lock/container.lock
  39. [object]
  40. maxconnections=2
  41. path=/srv/node/
  42. readonly=false
  43. lockfile=/var/lock/object.lock
  44. [root@object1~]#systemctlenablersyncd.service
  45. Createdsymlinkfrom/etc/systemd/system/multi-user.target.wants/rsyncd.serviceto/usr/lib/systemd/system/rsyncd.service.
  46. [root@object1~]#systemctlstartrsyncd.service
  47. [root@object1~]#systemctlstatusrsyncd.service

9.3.2安裝配置組件

  1. [root@object1~]#yuminstallopenstack-swift-accountopenstack-swift-containeropenstack-swift-object-y
  2. [root@object1~]#curl-o/etc/swift/account-server.confhttps://git.openstack.org/cgit/openstack/swift/plain/etc/account-server.conf-sample?h=stable/liberty
  3. %Total%Received%XferdAverageSpeedTimeTimeTimeCurrent
  4. DloadUploadTotalSpentLeftSpeed
  5. 1006147100614700434400:00:010:00:01--:--:--4347
  6. [root@object1~]#curl-o/etc/swift/container-server.confhttps://git.openstack.org/cgit/openstack/swift/plain/etc/container-server.conf-sample?h=stable/liberty
  7. %Total%Received%XferdAverageSpeedTimeTimeTimeCurrent
  8. DloadUploadTotalSpentLeftSpeed
  9. 100697610069760051600:00:130:00:13--:--:--2087
  10. [root@object1~]#
  11. [root@object1~]#curl-o/etc/swift/object-server.confhttps://git.openstack.org/cgit/openstack/swift/plain/etc/object-server.conf-sample?h=stable/liberty
  12. %Total%Received%XferdAverageSpeedTimeTimeTimeCurrent
  13. DloadUploadTotalSpentLeftSpeed
  14. 100118191001181900923400:00:010:00:01--:--:--9240
  15. [root@object1~]#vi/etc/swift/account-server.conf
  16. [DEFAULT]
  17. bind_ip=10.0.0.51
  18. bind_port=6002
  19. user=swift
  20. swift_dir=/etc/swift
  21. devices=/srv/node
  22. mount_check=true
  23. [pipeline:main]
  24. pipeline=healthcheckreconaccount-server
  25. [filter:recon]
  26. use=egg:swift#recon
  27. recon_cache_path=/var/cache/swift
  28. [root@object1~]#vi/etc/swift/container-server.conf
  29. [DEFAULT]
  30. bind_ip=10.0.0.51
  31. bind_port=6001
  32. user=swift
  33. swift_dir=/etc/swift
  34. devices=/srv/node
  35. mount_check=true
  36. [pipeline:main]
  37. pipeline=healthcheckreconcontainer-server
  38. [filter:recon]
  39. use=egg:swift#recon
  40. recon_cache_path=/var/cache/swift
  41. [root@object1~]#vi/etc/swift/object-server.conf
  42. [DEFAULT]
  43. bind_ip=10.0.0.51
  44. bind_port=6000
  45. user=swift
  46. swift_dir=/etc/swift
  47. devices=/srv/node
  48. mount_check=true
  49. [pipeline:main]
  50. pipeline=healthcheckreconobject-server
  51. [filter:recon]
  52. use=egg:swift#recon
  53. recon_cache_path=/var/cache/swift
  54. recon_lock_path=/var/lock
  55. [root@object1~]#chown-Rswift:swift/srv/node
  56. [root@object1~]#mkdir-p/var/cache/swift
  57. [root@object1~]#chown-Rroot:swift/var/cache/swift


9.4創建和分發initial rings(在控制節點執行,安裝有proxy service)

9.4.1創建賬戶RING

  1. [root@comtroller1~]#cd/etc/swift/##切換目錄
  2. [root@comtroller1swift]#swift-ring-builderaccount.buildercreate1031###沒有輸出
  3. [root@comtroller1swift]#swift-ring-builderaccount.builderadd--region1--zone1--ip10.0.0.51--port6002--devicesdb--weight100###將各個存儲節點硬盤添加到RING
  4. Deviced0r1z1-10.0.0.51:6002R10.0.0.51:6002/sdb_""with100.0weightgotid0
  5. [root@comtroller1swift]#swift-ring-builderaccount.builderadd--region1--zone2--ip10.0.0.51--port6002--devicesdc--weight100
  6. Deviced1r1z2-10.0.0.51:6002R10.0.0.51:6002/sdc_""with100.0weightgotid1
  7. [root@comtroller1swift]#swift-ring-builderaccount.builderadd--region1--zone3--ip10.0.0.52--port6002--devicesdb--weight100
  8. Deviced2r1z3-10.0.0.52:6002R10.0.0.52:6002/sdb_""with100.0weightgotid2
  9. [root@comtroller1swift]#swift-ring-builderaccount.builderadd--region1--zone4--ip10.0.0.52--port6002--devicesdc--weight100
  10. Deviced3r1z4-10.0.0.52:6002R10.0.0.52:6002/sdc_""with100.0weightgotid3
  11. [root@comtroller1swift]#swift-ring-builderaccount.builder##驗證RING配置
  12. account.builder,buildversion4
  13. 1024partitions,3.000000replicas,1regions,4zones,4devices,100.00balance,0.00dispersion
  14. Theminimumnumberofhoursbeforeapartitioncanbereassignedis1
  15. Theoverloadfactoris0.00%(0.000000)
  16. Devices:idregionzoneipaddressportreplicationipreplicationportnameweightpartitionsbalanceMeta
  17. 01110.0.0.51600210.0.0.516002sdb100.000-100.00
  18. 11210.0.0.51600210.0.0.516002sdc100.000-100.00
  19. 21310.0.0.52600210.0.0.526002sdb100.000-100.00
  20. 31410.0.0.52600210.0.0.526002sdc100.000-100.00
  21. [root@comtroller1swift]#swift-ring-builderaccount.builderrebalance##再平衡RING
  22. Reassigned1024(100.00%)partitions.Balanceisnow0.00.Dispersionisnow0.00



9.4.2創建容器RING

  1. [root@comtroller1~]#cd/etc/swift/
  2. [root@comtroller1swift]#swift-ring-buildercontainer.buildercreate1031
  3. [root@comtroller1swift]#swift-ring-buildercontainer.builderadd--region1--zone1--ip10.0.0.51--port6001--devicesdb--weight100
  4. Deviced0r1z1-10.0.0.51:6001R10.0.0.51:6001/sdb_""with100.0weightgotid0
  5. [root@comtroller1swift]#swift-ring-buildercontainer.builderadd--region1--zone2--ip10.0.0.51--port6001--devicesdc--weight100
  6. Deviced1r1z2-10.0.0.51:6001R10.0.0.51:6001/sdc_""with100.0weightgotid1
  7. [root@comtroller1swift]#swift-ring-buildercontainer.builderadd--region1--zone3--ip10.0.0.52--port6001--devicesdb--weight100
  8. Deviced2r1z3-10.0.0.52:6001R10.0.0.52:6001/sdb_""with100.0weightgotid2
  9. [root@comtroller1swift]#swift-ring-buildercontainer.builderadd--region1--zone4--ip10.0.0.52--port6001--devicesdc--weight100
  10. Deviced3r1z4-10.0.0.52:6001R10.0.0.52:6001/sdc_""with100.0weightgotid3
  11. [root@comtroller1swift]#swift-ring-buildercontainer.builder
  12. container.builder,0.00dispersion
  13. Theminimumnumberofhoursbeforeapartitioncanbereassignedis1
  14. Theoverloadfactoris0.00%(0.000000)
  15. Devices:idregionzoneipaddressportreplicationipreplicationportnameweightpartitionsbalanceMeta
  16. 01110.0.0.51600110.0.0.516001sdb100.000-100.00
  17. 11210.0.0.51600110.0.0.516001sdc100.000-100.00
  18. 21310.0.0.52600110.0.0.526001sdb100.000-100.00
  19. 31410.0.0.52600110.0.0.526001sdc100.000-100.00
  20. [root@comtroller1swift]#swift-ring-buildercontainer.builderrebalance
  21. Reassigned1024(100.00%)partitions.Balanceisnow0.00.Dispersionisnow0.00



9.4.3創建對象RING

  1. [root@comtroller1~]#cd/etc/swift/
  2. [root@comtroller1swift]#swift-ring-builderobject.buildercreate1031
  3. [root@comtroller1swift]#swift-ring-builderobject.builderadd--region1--zone1--ip10.0.0.51--port6000--devicesdb--weight100
  4. Deviced0r1z1-10.0.0.51:6000R10.0.0.51:6000/sdb_""with100.0weightgotid0
  5. [root@comtroller1swift]#swift-ring-builderobject.builderadd--region1--zone2--ip10.0.0.51--port6000--devicesdc--weight100
  6. Deviced1r1z2-10.0.0.51:6000R10.0.0.51:6000/sdc_""with100.0weightgotid1
  7. [root@comtroller1swift]#swift-ring-builderobject.builderadd--region1--zone3--ip10.0.0.52--port6000--devicesdb--weight100
  8. Deviced2r1z3-10.0.0.52:6000R10.0.0.52:6000/sdb_""with100.0weightgotid2
  9. [root@comtroller1swift]#swift-ring-builderobject.builderadd--region1--zone4--ip10.0.0.52--port6000--devicesdc--weight100
  10. Deviced3r1z4-10.0.0.52:6000R10.0.0.52:6000/sdc_""with100.0weightgotid3
  11. [root@comtroller1swift]#swift-ring-builderobject.builder
  12. object.builder,0.00dispersion
  13. Theminimumnumberofhoursbeforeapartitioncanbereassignedis1
  14. Theoverloadfactoris0.00%(0.000000)
  15. Devices:idregionzoneipaddressportreplicationipreplicationportnameweightpartitionsbalanceMeta
  16. 01110.0.0.51600010.0.0.516000sdb100.000-100.00
  17. 11210.0.0.51600010.0.0.516000sdc100.000-100.00
  18. 21310.0.0.52600010.0.0.526000sdb100.000-100.00
  19. 31410.0.0.52600010.0.0.526000sdc100.000-100.00
  20. [root@comtroller1swift]#swift-ring-builderobject.builderrebalance
  21. Reassigned1024(100.00%)partitions.Balanceisnow0.00.Dispersionisnow0.00


9.4.4分發RING配置文件:拷貝account.ring.gz,container.ring.gz,and object.ring.gz到每個存儲節點或運行proxy service節點的/etc/swift/目錄下

  1. [root@comtroller1swift]#ll*.ring.gz
  2. -rw-r--r--1rootroot1445Aug411:28account.ring.gz
  3. -rw-r--r--1rootroot1443Aug411:34container.ring.gz
  4. -rw-r--r--1rootroot1438Aug411:37object.ring.gz
  5. [root@comtroller1swift]#scp*.ring.gzroot@10.0.0.51:/etc/swift/
  6. Theauthenticityofhost'10.0.0.51(10.0.0.51)'can'tbeestablished.
  7. ECDSAkeyfingerprintisce:93:44:a9:4d:03:93:c7:df:bf:6a:c0:a4:7e:13:8a.
  8. Areyousureyouwanttocontinueconnecting(yes/no)?yes
  9. Warning:Permanentlyadded'10.0.0.51'(ECDSA)tothelistofknownhosts.
  10. root@10.0.0.51'spassword:
  11. account.ring.gz100%14451.4KB/s00:00
  12. container.ring.gz100%14431.4KB/s00:00
  13. object.ring.gz100%14381.4KB/s00:00
  14. [root@comtroller1swift]#scp*.ring.gzroot@10.0.0.52:/etc/swift/
  15. Theauthenticityofhost'10.0.0.52(10.0.0.52)'can'tbeestablished.
  16. ECDSAkeyfingerprintis12:a5:46:52:af:56:1c:1a:f1:f7:ae:04:ee:f4:4c:05.
  17. Areyousureyouwanttocontinueconnecting(yes/no)?yes
  18. Warning:Permanentlyadded'10.0.0.52'(ECDSA)tothelistofknownhosts.
  19. root@10.0.0.52'spassword:
  20. account.ring.gz100%14451.4KB/s00:00
  21. container.ring.gz100%14431.4KB/s00:00
  22. object.ring.gz100%14381.4KB/s00:00


9.5結束安裝並啟動服務

9.5.1取得配置文件

  1. [root@comtroller1~]#curl-o/etc/swift/swift.confhttps://git.openstack.org/cgit/openstack/swift/plain/etc/swift.conf-sample?h=stable/liberty

9.5.2配置HASH_PATH_SUFFIX和HASH_PATH_PREFIX

  1. [root@comtroller1~]#vi/etc/swift/swift.conf
  2. swift_hash_path_suffix=openstack
  3. swift_hash_path_prefix=openstack


9.5.2配置默认存储策略

  1. [storage-policy:0]
  2. name=Policy-0
  3. default=yes


9.5.3将配置文件拷贝到各个存储节点

  1. [root@comtroller1~]#scp/etc/swift/swift.confroot@10.0.0.51:/etc/swift/
  2. root@10.0.0.51'spassword:
  3. swift.conf100%72027.0KB/s00:00
  4. [root@comtroller1~]#scp/etc/swift/swift.confroot@10.0.0.52:/etc/swift/
  5. root@10.0.0.52'spassword:
  6. swift.conf


9.5.4变更文件文件夹权限

  1. [root@comtroller1~]#chown-Rroot:swift/etc/swift
  2. [root@object1~]#chown-Rroot:swift/etc/swift
  3. [root@object2~]#chown-Rroot:swift/etc/swift

9.5.5启动控制节点的SWIFT代理服务

  1. [root@comtroller1~]#systemctlenableopenstack-swift-proxy.servicememcached.service
  2. Createdsymlinkfrom/etc/systemd/system/multi-user.target.wants/openstack-swift-proxy.serviceto/usr/lib/systemd/system/openstack-swift-proxy.service.
  3. [root@comtroller1~]#systemctlstartopenstack-swift-proxy.servicememcached.service


9.5.6启动各存储节点服务

  1. [root@object1~]#systemctlenableopenstack-swift-account.serviceopenstack-swift-account-auditor.serviceopenstack-swift-account-reaper.serviceopenstack-swift-account-replicator.service
  2. [root@object1~]#systemctlstartopenstack-swift-account.serviceopenstack-swift-account-auditor.serviceopenstack-swift-account-reaper.serviceopenstack-swift-account-replicator.service
  3. [root@object1~]#systemctlenableopenstack-swift-container.serviceopenstack-swift-container-auditor.serviceopenstack-swift-container-replicator.serviceopenstack-swift-container-updater.service
  4. [root@object1~]#systemctlstartopenstack-swift-container.serviceopenstack-swift-container-auditor.serviceopenstack-swift-container-replicator.serviceopenstack-swift-container-updater.service
  5. [root@object1~]#systemctlenableopenstack-swift-object.serviceopenstack-swift-object-auditor.serviceopenstack-swift-object-replicator.serviceopenstack-swift-object-updater.service
  6. [root@object1~]#systemctlstartopenstack-swift-object.serviceopenstack-swift-object-auditor.serviceopenstack-swift-object-replicator.serviceopenstack-swift-object-updater.service
  7. [root@object2~]#systemctlenableopenstack-swift-account.serviceopenstack-swift-account-auditor.serviceopenstack-swift-account-reaper.serviceopenstack-swift-account-replicator.service
  8. [root@object2~]#systemctlstartopenstack-swift-account.serviceopenstack-swift-account-auditor.serviceopenstack-swift-account-reaper.serviceopenstack-swift-account-replicator.service
  9. [root@object2~]#systemctlenableopenstack-swift-container.serviceopenstack-swift-container-auditor.serviceopenstack-swift-container-replicator.serviceopenstack-swift-container-updater.service
  10. [root@object2~]#systemctlstartopenstack-swift-container.serviceopenstack-swift-container-auditor.serviceopenstack-swift-container-replicator.serviceopenstack-swift-container-updater.service
  11. [root@object2~]#systemctlenableopenstack-swift-object.serviceopenstack-swift-object-auditor.serviceopenstack-swift-object-replicator.serviceopenstack-swift-object-updater.service
  12. [root@object2~]#systemctlstartopenstack-swift-object.serviceopenstack-swift-object-auditor.serviceopenstack-swift-object-replicator.serviceopenstack-swift-object-updater.service



9.6驗證

  1. [root@comtroller1~]#echo"exportOS_AUTH_VERSION=3"|tee-aadmin-openrc.shdemo-openrc.sh
  2. [root@comtroller1~]#echo"exportOS_REGION_NAME=RegionOne"|tee-aadmin-openrc.shdemo-openrc.sh###解决错误/usr/lib/python2.7/site-packages/keystoneclient/service_catalog.py:196:UserWarning:Providingattrwithoutfilter_valuetoget_urls()isdeprecatedasofthe1.7.0releaseandmayberemovedinthe2.0.0release.Eitherbothshouldbeprovidedorneithershouldbeprovided.
  3. [root@comtroller1~]#.demo-openrc.sh
  4. [root@comtroller1~]#swiftstat##查看swift状态
  5. Account:AUTH_db6bcde12cc947119ecab8c211fa4f35
  6. Containers:1
  7. Objects:1
  8. Bytes:13287936
  9. Containersinpolicy"policy-0":1
  10. Objectsinpolicy"policy-0":1
  11. Bytesinpolicy"policy-0":13287936
  12. X-Account-Project-Domain-Id:default
  13. X-Timestamp:1470286741.05862
  14. X-Trans-Id:txa608922c24224805bfd25-0057a2e160
  15. Content-Type:text/plain;charset=utf-8
  16. Accept-Ranges:bytes
  17. [root@comtroller1~]#swiftlist##查看swift中的容器
  18. container1
  19. [root@comtroller1~]#swiftlistcontainer1##查看swift容器中的对象
  20. cirros-0.3.4-x86_64-disk.img
  21. [root@comtroller1~]#swiftdeletecontainer1cirros-0.3.4-x86_64-disk.img##删除容器中对象
  22. cirros-0.3.4-x86_64-disk.img
  23. [root@comtroller1~]#swiftlistcontainer1
  24. [root@comtroller1~]#swiftuploadcontainer1cirros-0.3.4-x86_64-disk.img##上传对象到容器
  25. cirros-0.3.4-x86_64-disk.img
  26. [root@comtroller1~]#ls
  27. admin-openrc.shanaconda-ks.cfgcirros-0.3.4-x86_64-disk.imgdemo-openrc.sh--os-project-domain-id--os-project-nametoken
  28. [root@comtroller1~]#rmcirros-0.3.4-x86_64-disk.img
  29. rm:removeregularfilecirros-0.3.4-x86_64-disk.img’?y
  30. [root@comtroller1~]#swiftdownloadcontainer1cirros-0.3.4-x86_64-disk.img##从容器中下载对象
  31. cirros-0.3.4-x86_64-disk.img[auth0.637s,headers0.682s,total1.000s,36.568MB/s]
  32. [root@comtroller1~]#ls
  33. admin-openrc.shanaconda-ks.cfgcirros-0.3.4-x86_64-disk.imgdemo-openrc.sh--os-project-domain-id--os-project-nametoken
  34. [root@comtroller1~]#swiftposttest_container##建立容器
  35. [root@comtroller1~]#swiftlist
  36. container1
  37. test_container
  38. [root@comtroller1~]#swiftdeletetest_container##删除容器
  39. test_container
  40. [root@comtroller1~]#swiftlist
  41. container1

猜你在找的Swift相关文章