[root@openstack1 ~]# source keystonerc_admin
[root@openstack1 ~(keystone_admin)]# swift list #查看存储容器
[root@openstack1 ~(keystone_admin)]# swift stat #查看容器状态
Account: AUTH_f310702c6c3d43fba127d1c3b66eaae6
Containers: 0
Objects: 0
Bytes: 0
Transfer-Encoding: chunked
X-Put-Timestamp: 1562900997.18262
X-Timestamp: 1562900997.18262
X-Trans-Id: txe03b1f8b3ef044a5ac4dd-005d27fa04
Content-Type: text/plain; charset=utf-8
X-Openstack-Request-Id: txe03b1f8b3ef044a5ac4dd-005d27fa04
[root@openstack1 ~(keystone_admin)]# swift post zg-swift #通过命令行创建容器
[root@openstack1 ~(keystone_admin)]# swift list #查看容器
zg-swift
[root@openstack1 ~(keystone_admin)]# swift list --lh #查看容器详细信息
0 0 2019-07-12 03:10:48 zg-swift
0 0
[root@openstack1 ~(keystone_admin)]# swift post test #通过命令行创建容器
[root@openstack1 ~(keystone_admin)]# swift list --lh #查看容器详细信息
0 0 2019-07-12 03:11:37 test
0 0 2019-07-12 03:10:48 zg-swift
0 0
[root@openstack1 ~(keystone_admin)]# ll
total 132
-rw-------. 1 root root 5098 Aug 15 2018 anaconda-ks.cfg
-rw-------. 1 root root 51728 Jul 8 02:03 answer.txt
-rw-------. 1 root root 51728 Jul 8 02:02 answer.txt.bak
-rw-r--r--. 1 root root 0 Jul 8 01:52 blue
-rwxr-xr-x. 1 root root 266 Jul 11 03:50 colour.sh
-rw-------. 1 root root 332 Jul 8 02:10 keystonerc_admin
-rw-------. 1 root root 313 Jul 8 02:10 keystonerc_demo
-rw-------. 1 root root 5073 Aug 15 2018 original-ks.cfg
-rw-r--r--. 1 root root 0 Jul 8 01:52 tset
[root@openstack1 ~(keystone_admin)]# swift upload test colour.sh #本地上传文件至test容器
colour.sh
[root@openstack1 ~(keystone_admin)]# swift list test #容器中查看文件
colour.sh
[root@openstack1 ~(keystone_admin)]# dd if=/dev/zero of=/tmp/example-500Mb bs=1M count=500 #创建500M的文件
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 0.310914 s, 1.7 GB/s
[root@openstack1 ~(keystone_admin)]# swift upload test -S 102400000 /tmp/example-500Mb #-S指定分片的大小
tmp/example-500Mb segment 5
tmp/example-500Mb segment 4
tmp/example-500Mb segment 2
tmp/example-500Mb segment 0
tmp/example-500Mb segment 3
tmp/example-500Mb segment 1
tmp/example-500Mb
[root@openstack1 ~(keystone_admin)]# swift list test #查看容器情况
colour.sh
tmp/example-500Mb
[root@openstack1 ~(keystone_admin)]# swift list test --lh #查看文件属性
266 2019-07-12 03:12:58 application/x-sh colour.sh
0 2019-07-12 03:15:32 application/octet-stream tmp/example-500Mb
266
[root@openstack1 ~(keystone_admin)]# swift list test_segments --lh #查看分片情况
97M 2019-07-12 03:15:29 application/swiftclient-segment tmp/example-500Mb/1562901244.531578/524288000/102400000/00000000
97M 2019-07-12 03:15:29 application/swiftclient-segment tmp/example-500Mb/1562901244.531578/524288000/102400000/00000001
97M 2019-07-12 03:15:29 application/swiftclient-segment tmp/example-500Mb/1562901244.531578/524288000/102400000/00000002
97M 2019-07-12 03:15:30 application/swiftclient-segment tmp/example-500Mb/1562901244.531578/524288000/102400000/00000003
97M 2019-07-12 03:15:29 application/swiftclient-segment tmp/example-500Mb/1562901244.531578/524288000/102400000/00000004
11M 2019-07-12 03:15:29 application/swiftclient-segment tmp/example-500Mb/1562901244.531578/524288000/102400000/00000005
500M
[root@openstack1 ~(keystone_admin)]#