【Centos7系列】Openstack Swift 分片存储

Iceboundnana 发布于 2023-08-09 1.06k 次阅读


1、使用CRT或mobaXterm连接controller控制节点

2、查询swift状态

[root@controller ~]# source /etc/keystone/admin-openrc.sh
[root@controller ~]# swift stat
               Account: AUTH_e96675bf91f040c784decc439ab2dc64
            Containers: 0
               Objects: 0
                 Bytes: 0
       X-Put-Timestamp: 1617103571.86069
           X-Timestamp: 1617103571.86069
            X-Trans-Id: txd1796f75493c475499e70-0060630ad3
          Content-Type: text/plain; charset=utf-8
X-Openstack-Request-Id: txd1796f75493c475499e70-0060630ad3

3、创建容器并查看

[root@controller ~]# swift post test
[root@controller ~]# swift stat test
               Account: AUTH_e96675bf91f040c784decc439ab2dc64
             Container: test
               Objects: 0
                 Bytes: 0
              Read ACL:
             Write ACL:
               Sync To:
              Sync Key:
         Accept-Ranges: bytes
      X-Storage-Policy: Policy-0
         Last-Modified: Tue, 30 Mar 2021 11:27:03 GMT
           X-Timestamp: 1617103622.23764
            X-Trans-Id: tx83f0f124151c4f0081d88-0060630b1e
          Content-Type: application/json; charset=utf-8
X-Openstack-Request-Id: tx83f0f124151c4f0081d88-0060630b1e

4、将提供的cirros-0.3.4-x86_64-disk.img镜像上传至controller节点的/root目录下,并使用命令上传至test容器中,进行分片存储,每个片段的大小为10M

[root@controller ~]# swift upload test -S 10000000 cirros-0.3.4-x86_64-disk.img

5、查看cirros镜像的存储路径

[root@controller ~]# swift stat test cirros-0.3.4-x86_64-disk.img
               Account: AUTH_e96675bf91f040c784decc439ab2dc64
             Container: test
                Object: cirros-0.3.4-x86_64-disk.img
          Content Type: application/octet-stream
        Content Length: 13287936
         Last Modified: Tue, 30 Mar 2021 11:28:48 GMT
                  ETag: "cca17a689bfcd70118fabc833af0d033"
              Manifest: test_segments/cirros-0.3.4-x86_64-disk.img/1501723496.000000/13287936/10000000/
            Meta Mtime: 1501723496.000000
         Accept-Ranges: bytes
           X-Timestamp: 1617103727.53769
            X-Trans-Id: tx783ad516d1704189b864a-0060630bb9
X-Openstack-Request-Id: tx783ad516d1704189b864a-0060630bb9

6、查看存储路径中的数据片

[root@controller ~]# swift list test_segments
cirros-0.3.4-x86_64-disk.img/1501723496.000000/13287936/10000000/00000000
cirros-0.3.4-x86_64-disk.img/1501723496.000000/13287936/10000000/00000001
此作者没有提供个人介绍。
最后更新于 2023-08-09