1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > -12-13 云计算平台基础架构 swift

-12-13 云计算平台基础架构 swift

时间:2019-02-24 02:07:31

相关推荐

-12-13 云计算平台基础架构 swift

班级:20网络3

学号:30

姓名:徐鑫

swift操作截图

设置后端存储截图

[root@xiandian ~]# source /etc/keystone/admin-openrc.sh [root@xiandian ~]# openstack role list+----------------------------------+------------------+| ID | Name |+----------------------------------+------------------+| 384c446de0dc4c80bc4ef187c555dacd | user || 5adf91f71f7646cb89917e2f975aa68d | heat_stack_owner || 710e4f3907264eb3b65e97e27990f30b | admin || 8229ef312d194bbda9aceefa4b8362cd | heat_stack_user || c83aed0bc3784e4abe7dbf1f095b51e4 | ResellerAdmin |+----------------------------------+------------------+[root@xiandian ~]# openstack service list+----------------------------------+------------+----------------+| ID | Name | Type |+----------------------------------+------------+----------------+| 07b314e21ad44d1e8c38466d4be75a4c | ceilometer | metering || 1af6174c6dd043bf8f16adcb97bbad28 | nova | compute || 25b8eef99c70400ab16266cd795bcc02 | aodh | alarming || 2b73f27e09ef4f0fa717153f88f8ac8c | keystone | identity || 32b9a24cda164a6a806308246197a476 | cinder| volume || 6793669d2ea74fcd832aa2661558587a | cinderv2 | volumev2 || 68805ded3673497e9f9e98737a1c6a32 | heat-cfn | cloudformation || 7d25ec1551f349fab321db31b029acbc | glance| image|| 959540c2be1a40d9b7f790d87d9377b0 | neutron | network || 9e24529c11a04ffa96e32c57fb0f5186 | heat | orchestration || b40175bd02224fb78e1a1e26f810587e | swift| object-store |+----------------------------------+------------+----------------+[root@xiandian ~]# #查看swift组件[root@xiandian ~]# openstack-service list | grep swiftopenstack-swift-account-auditoropenstack-swift-account-reaperopenstack-swift-account-replicatoropenstack-swift-accountopenstack-swift-container-auditoropenstack-swift-container-replicatoropenstack-swift-container-updateropenstack-swift-containeropenstack-swift-object-auditoropenstack-swift-object-replicatoropenstack-swift-object-updateropenstack-swift-objectopenstack-swift-proxy[root@xiandian ~]# #1,创建容器,上传下载和删除对象;2.上传大容量文件;容器管理,设置权限;4将swift 设置为glance.cinder的后端存储[root@xiandian ~]# #查看当前平台的容器[root@xiandian ~]# openstack container list[root@xiandian ~]# #查看swift容器[root@xiandian ~]# swift list[root@xiandian ~]# #创建swift容器[root@xiandian ~]# swift post test30[root@xiandian ~]# openstack container list+--------+| Name |+--------+| test30 |+--------+[root@xiandian ~]# swift listtest30[root@xiandian ~]# #查看容器内部对象情况[root@xiandian ~]# swift list test30[root@xiandian ~]# #上传对象到容器,首先在当前目录下创建一个文件,然后上传到test30[root@xiandian ~]# touch one.txt[root@xiandian ~]# lsone.txt[root@xiandian ~]# swift upload test30 one.txtone.txt[root@xiandian ~]# swift list test30one.txt[root@xiandian ~]# #上传目录[root@xiandian ~]# mkdir file30[root@xiandian ~]# lsfile30 one.txt[root@xiandian ~]# swift upload test30 file30/file30/[root@xiandian ~]# swift list test30file30/one.txt[root@xiandian ~]# #上传文件到指定容器目录下[root@xiandian ~]# touch two.doc[root@xiandian ~]# touch three.png[root@xiandian ~]# swift upload test30/file30 two.docfile30/two.doc[root@xiandian ~]# swift list test30file30/file30/two.docone.txt[root@xiandian ~]# swift upload test30/file30 three.png file30/three.png[root@xiandian ~]# swift list test30file30/file30/three.pngfile30/two.docone.txt[root@xiandian ~]# #查看容器具体状态[root@xiandian ~]# swift stat test30Account: AUTH_0ab2dbde4f754b699e22461426cd0774Container: test30Objects: 4Bytes: 0Read ACL:Write ACL:Sync To:Sync Key:Accept-Ranges: bytesX-Storage-Policy: Policy-0X-Timestamp: 1639387112.48490X-Trans-Id: tx76005d2cc8d1434dae2e3-0061b711f3Content-Type: text/plain; charset=utf-8[root@xiandian ~]# #查看当前account下的swift的装填[root@xiandian ~]# swift statAccount: AUTH_0ab2dbde4f754b699e22461426cd0774Containers: 1Objects: 3Bytes: 0Containers in policy "policy-0": 1Objects in policy "policy-0": 3Bytes in policy "policy-0": 0X-Account-Project-Domain-Id: 3ac89594c8e944a9b5bb567fca4e75aaX-Timestamp: 1639387112.46752X-Trans-Id: tx8830d43e00e1410582d93-0061b71234Content-Type: text/plain; charset=utf-8Accept-Ranges: bytes[root@xiandian ~]# swift post test[root@xiandian ~]# swift statAccount: AUTH_0ab2dbde4f754b699e22461426cd0774Containers: 2Objects: 4Bytes: 0Containers in policy "policy-0": 2Objects in policy "policy-0": 4Bytes in policy "policy-0": 0X-Account-Project-Domain-Id: 3ac89594c8e944a9b5bb567fca4e75aaX-Timestamp: 1639387112.46752X-Trans-Id: txed49d21ab154445bb71c7-0061b7129fContent-Type: text/plain; charset=utf-8Accept-Ranges: bytes[root@xiandian ~]# #从容器中下载对象[root@xiandian ~]# swift download test30 file30/two.docfile30/two.doc [auth 0.390s, headers 0.658s, total 0.658s, 0.000 MB/s][root@xiandian ~]# lsfile30 one.txt three.png two.doc[root@xiandian ~]# ls file30/two.doc[root@xiandian ~]# #从容器中删除对象[root@xiandian ~]# swift delete test30 file30/two.doc file30/two.doc[root@xiandian ~]# swift list test30file30/file30/three.pngone.txt[root@xiandian ~]# #2,上传>1gb大容量文件[root@xiandian ~]# #创建1gb大小的文件[root@xiandian ~]# dd if=/dev/zero of=file30/example30-1Gb bs=1M count=10241024+0 records in1024+0 records out1073741824 bytes (1.1 GB) copied, 1.69548 s, 633 MB/s[root@xiandian ~]# ls file30/example30-1Gb two.doc[root@xiandian ~]# swift upload teat30 -S 102400000 file30/example30-1Gb file30/example30-1Gb segment 0file30/example30-1Gb segment 3file30/example30-1Gb segment 6file30/example30-1Gb segment 9file30/example30-1Gb segment 5file30/example30-1Gb segment 2file30/example30-1Gb segment 1file30/example30-1Gb segment 10file30/example30-1Gb segment 7file30/example30-1Gb segment 8file30/example30-1Gb segment 4file30/example30-1Gb[root@xiandian ~]# swift list file30Container u'file30' not found[root@xiandian ~]# swift list test30[root@xiandian ~]# #3.设置容器权限[root@xiandian ~]# openstack user list+----------------------------------+-------------------+| ID | Name |+----------------------------------+-------------------+| 020cce9b69a44aef984fa8aba5135f3f | heat_domain_admin || 2c8b1e282f804fc58bc8cdfe7518d80f | neutron || 372c371d6c4a4d5aa099376499fa21ef | aodh || 413c222a0c0d476fa77e3a096f9da216 | heat || 46faed53c3534611a83f586d55951246 | glance || 53a1cf0ad2924532aa4b7b0750dec282 | admin || 73191a8367e4410da4bf764263ade04c | demo || 95f197fef75a490cbe926350d2688512 | cinder || 97dcfcb9a3b84dd5a47d40c01425e8f5 | swift || a0024f4b405745b999aaa1276844dec6 | nova || d46602d109214aea92ec4f9f0e4223e2 | ceilometer |+----------------------------------+-------------------+[root@xiandian ~]# #设置用户demo对test30具有可读权限[root@xiandian ~]# swift post -r demo test30[root@xiandian ~]# #设置用户glance对test30具有可读可写的权限[root@xiandian ~]# swift post -r glance -w glance test30[root@xiandian ~]# #4.将swift设置为glance的后端存储[root@xiandian ~]# vi /etc/glance/glance-api.conf [root@xiandian ~]# systemctl restart openstack-glance-api.confFailed to restart openstack-glance-api.conf.service: Unit openstack-glance-api.conf.service failed to load: No such file or directory.[root@xiandian ~]# [root@xiandian ~]# systemctl restart openstack-glance-api.confFailed to restart openstack-glance-api.conf.service: Unit openstack-glance-api.conf.service failed to load: No such file or directory.[root@xiandian ~]# vi /etc/glance/glance-api.conf [root@xiandian ~]# systemctl restart openstack-glance-api.confFailed to restart openstack-glance-api.conf.service: Unit openstack-glance-api.conf.service failed to load: No such file or directory.[root@xiandian ~]# systemctl restart openstack-glance-api.service[root@xiandian ~]# systemctl restart openstack-glance-registry.service[root@xiandian ~]# swift post RD_Republic[root@xiandian ~]# swift post IT_Private[root@xiandian ~]# mkdimkdict mkdir [root@xiandian ~]# mkdir netwrok30[root@xiandian ~]# touch iaas.txt[root@xiandian ~]# touch pass.doc[root@xiandian ~]# swift upload IT_Private network/Local file 'network/' not found^[[A[root@xiandian swift upload IT_Private network30/Local file 'network30/' not found[root@xiandian ~]# lsexample30-1Gb file30 iaas.txt netwrok30 one.txt pass.doc three.png two.doc[root@xiandian ~]# mkdir network30[root@xiandian ~]# swift upload IT_Private network30/network30/[root@xiandian ~]# swift upload IT_Private/network30 iaas.txt network30/iaas.txt[root@xiandian ~]# swift upload IT_Private/network30 pass.doc network30/pass.doc[root@xiandian ~]# swift upload RD_Republic one.txt one.txt[root@xiandian ~]# swift post -r demo -w demo IT_Private[root@xiandian ~]# swift post -r demo RD_Republic[root@xiandian ~]# swift stat RD_RepublicAccount: AUTH_0ab2dbde4f754b699e22461426cd0774Container: RD_RepublicObjects: 1Bytes: 0Read ACL: demoWrite ACL:Sync To:Sync Key:Accept-Ranges: bytesX-Trans-Id: txf0b5267e674b4f6eb2b83-0061b722c6X-Storage-Policy: Policy-0X-Timestamp: 1639391384.76476Content-Type: text/plain; charset=utf-8[root@xiandian ~]# swift list IT_Privatenetwork30/network30/iaas.txtnetwork30/pass.doc[root@xiandian ~]# #**属性设置**vi /etc/glance/glance-api.conf [DEFAULT]rpc_backend = rabbitdefault_store = swiftstores = glance.store.swift.Store, glance.store.filesystem.Storeswift_store_auth_version = 3swift_store_auth_address = http://xiandian:5000/v3swift_store_user = service:swiftswift_store_key = 000000swift_store_container = glanceswift_store_create_container_put = Trueswift_store_large_object_size = 5120swift_store_large_object_chunk_size = 200

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。