34323 发表于 2016-8-5 09:26:47

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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# . admin-openrc.sh
# openstack user create --domain default --password-prompt swift
User Password:
Repeat User Password:
+-----------+----------------------------------+
| Field   | Value                            |
+-----------+----------------------------------+
| domain_id | default                        |
| enabled   | True                           |
| id      | 9f9d73e380ac4db0af601604ee45ea02 |
| name      | swift                            |
+-----------+----------------------------------+
# openstack role add --project service --user swift admin
# openstack service create --name swift --description "OpenStack Object Storage" object-store
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Object Storage         |
| enabled   | True                           |
| id          | 6cbf871fbf5f4cb192a1e1337e59e5ed |
| name      | swift                            |
| type      | object-store                     |
+-------------+----------------------------------+
# openstack endpoint create --region RegionOne object-store public http://controller1:8080/v1/AUTH_%\(tenant_id\)s
+--------------+-----------------------------------------------+
| Field      | Value                                       |
+--------------+-----------------------------------------------+
| enabled      | True                                          |
| id         | 9850ec8e31b7434090cca0d881355b46            |
| interface    | public                                        |
| region       | RegionOne                                     |
| region_id    | RegionOne                                     |
| service_id   | 6cbf871fbf5f4cb192a1e1337e59e5ed            |
| service_name | swift                                       |
| service_type | object-store                                  |
| url          | http://controller1:8080/v1/AUTH_%(tenant_id)s |
+--------------+-----------------------------------------------+
# openstack endpoint create --region RegionOne object-store internal http://controller1:8080/v1/AUTH_%\(tenant_id\)s
+--------------+-----------------------------------------------+
| Field      | Value                                       |
+--------------+-----------------------------------------------+
| enabled      | True                                          |
| id         | 11a006619fc24414accc7117a4daabc9            |
| interface    | internal                                    |
| region       | RegionOne                                     |
| region_id    | RegionOne                                     |
| service_id   | 6cbf871fbf5f4cb192a1e1337e59e5ed            |
| service_name | swift                                       |
| service_type | object-store                                  |
| url          | http://controller1:8080/v1/AUTH_%(tenant_id)s |
+--------------+-----------------------------------------------+
# openstack endpoint create --region RegionOne object-store admin http://controller1:8080/v1
+--------------+----------------------------------+
| Field      | Value                            |
+--------------+----------------------------------+
| enabled      | True                           |
| id         | 4d52cf1cf9ab4eab8e14c5db7a564960 |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 6cbf871fbf5f4cb192a1e1337e59e5ed |
| service_name | swift                            |
| service_type | object-store                     |
| url          | http://controller1:8080/v1       |
+--------------+----------------------------------+





9.2.2安裝配置組件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# yum install openstack-swift-proxy python-swiftclient python-keystoneclient python-keystonemiddleware memcached -y
# curl -o /etc/swift/proxy-server.conf https://git.openstack.org/cgit/openstack/swift/plain/etc/proxy-server.conf-sample?h=stable/liberty
% Total    % Received % XferdAverage Speed   Time    Time   TimeCurrent
                                 DloadUpload   Total   Spent    LeftSpeed
100 29655100 29655    0   014194      00:00:020:00:02 --:--:-- 14188
# vi /etc/swift/proxy-server.conf

bind_port = 8080
user = swift
swift_dir = /etc/swift

pipeline = catch_errors gatekeeper healthcheck proxy-logging cache container_sync bulk ratelimit authtoken keystoneauth container-quotas account-quotas slo dlo versioned_writes proxy-logging proxy-server

use = egg:swift#proxy
account_autocreate = true
此项也需要取消注释
use = egg:swift#keystoneauth
operator_roles = admin,user
移除或註釋此配置組下其他項目
paste.filter_factory = keystonemiddleware.auth_token:filter_factory
auth_uri = http://controller1:5000
auth_url = http://controller1:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = swift
password = swift
delay_auth_decision = true

use = egg:swift#memcache
memcache_servers = 127.0.0.1:11211





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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# yum install xfsprogs rsync -y
# ls /dev/sd*
/dev/sda/dev/sda1/dev/sda2/dev/sdb/dev/sdc
# mkfs.xfs /dev/sdb
meta-data=/dev/sdb               isize=256    agcount=4, agsize=8388608 blks
         =                     sectsz=512   attr=2, projid32bit=1
         =                     crc=0      finobt=0
data   =                     bsize=4096   blocks=33554432, imaxpct=25
         =                     sunit=0      swidth=0 blks
naming   =version 2            bsize=4096   ascii-ci=0 ftype=0
log      =internal log         bsize=4096   blocks=16384, version=2
         =                     sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
# mkfs.xfs /dev/sdc
meta-data=/dev/sdc               isize=256    agcount=4, agsize=8388608 blks
         =                     sectsz=512   attr=2, projid32bit=1
         =                     crc=0      finobt=0
data   =                     bsize=4096   blocks=33554432, imaxpct=25
         =                     sunit=0      swidth=0 blks
naming   =version 2            bsize=4096   ascii-ci=0 ftype=0
log      =internal log         bsize=4096   blocks=16384, version=2
         =                     sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
# mkdir -p /srv/node/sdb
# mkdir -p /srv/node/sdc
# vi /etc/fstab
/dev/sdb /srv/node/sdb xfs noatime,nodiratime,nobarrier,logbufs=8 0 2
/dev/sdc /srv/node/sdc xfs noatime,nodiratime,nobarrier,logbufs=8 0 2
# mount /srv/node/sdb
# mount /srv/node/sdc
# vi /etc/rsyncd.conf
uid = swift
gid = swift
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
address = 10.0.0.51   ###對應存儲節點IP地址

max connections = 2
path = /srv/node/
read only = false
lock file = /var/lock/account.lock

max connections = 2
path = /srv/node/
read only = false
lock file = /var/lock/container.lock

max connections = 2
path = /srv/node/
read only = false
lock file = /var/lock/object.lock
# systemctl enable rsyncd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/rsyncd.service to /usr/lib/systemd/system/rsyncd.service.
# systemctl start rsyncd.service
# systemctl status rsyncd.service




9.3.2安裝配置組件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# yum install openstack-swift-account openstack-swift-containeropenstack-swift-object-y
# curl -o /etc/swift/account-server.conf https://git.openstack.org/cgit/openstack/swift/plain/etc/account-server.conf-sample?h=stable/liberty
% Total    % Received % XferdAverage Speed   Time    Time   TimeCurrent
                                 DloadUpload   Total   Spent    LeftSpeed
10061471006147    0   0   4344      00:00:010:00:01 --:--:--4347
# curl -o /etc/swift/container-server.conf https://git.openstack.org/cgit/openstack/swift/plain/etc/container-server.conf-sample?h=stable/liberty
% Total    % Received % XferdAverage Speed   Time    Time   TimeCurrent
                                 DloadUpload   Total   Spent    LeftSpeed
10069761006976    0   0    516      00:00:130:00:13 --:--:--2087
#
# curl -o /etc/swift/object-server.conf https://git.openstack.org/cgit/openstack/swift/plain/etc/object-server.conf-sample?h=stable/liberty
% Total    % Received % XferdAverage Speed   Time    Time   TimeCurrent
                                 DloadUpload   Total   Spent    LeftSpeed
100 11819100 11819    0   0   9234      00:00:010:00:01 --:--:--9240
# vi /etc/swift/account-server.conf

bind_ip = 10.0.0.51
bind_port = 6002
user = swift
swift_dir = /etc/swift
devices = /srv/node
mount_check = true

pipeline = healthcheck recon account-server

use = egg:swift#recon
recon_cache_path = /var/cache/swift
# vi /etc/swift/container-server.conf

bind_ip = 10.0.0.51
bind_port = 6001
user = swift
swift_dir = /etc/swift
devices = /srv/node
mount_check = true

pipeline = healthcheck recon container-server

use = egg:swift#recon
recon_cache_path = /var/cache/swift
# vi /etc/swift/object-server.conf

bind_ip = 10.0.0.51
bind_port = 6000
user = swift
swift_dir = /etc/swift
devices = /srv/node
mount_check = true

pipeline = healthcheck recon object-server

use = egg:swift#recon
recon_cache_path = /var/cache/swift
recon_lock_path = /var/lock
# chown -R swift:swift /srv/node
# mkdir -p /var/cache/swift
# chown -R root:swift /var/cache/swift





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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# cd /etc/swift/   ##切換目錄
# swift-ring-builder account.builder create 10 3 1   ###沒有輸出
# swift-ring-builder account.builder add--region 1 --zone 1 --ip 10.0.0.51 --port 6002 --device sdb --weight 100   ###將各個存儲節點硬盤添加到RING
Device d0r1z1-10.0.0.51:6002R10.0.0.51:6002/sdb_"" with 100.0 weight got id 0
# swift-ring-builder account.builder add--region 1 --zone 2 --ip 10.0.0.51 --port 6002 --device sdc --weight 100
Device d1r1z2-10.0.0.51:6002R10.0.0.51:6002/sdc_"" with 100.0 weight got id 1
# swift-ring-builder account.builder add--region 1 --zone 3 --ip 10.0.0.52 --port 6002 --device sdb --weight 100
Device d2r1z3-10.0.0.52:6002R10.0.0.52:6002/sdb_"" with 100.0 weight got id 2
# swift-ring-builder account.builder add--region 1 --zone 4 --ip 10.0.0.52 --port 6002 --device sdc --weight 100
Device d3r1z4-10.0.0.52:6002R10.0.0.52:6002/sdc_"" with 100.0 weight got id 3
# swift-ring-builder account.builder    ##驗證RING配置
account.builder, build version 4
1024 partitions, 3.000000 replicas, 1 regions, 4 zones, 4 devices, 100.00 balance, 0.00 dispersion
The minimum number of hours before a partition can be reassigned is 1
The overload factor is 0.00% (0.000000)
Devices:    idregionzone      ip addressportreplication ipreplication port      name weight partitions balance meta
             0       1   1       10.0.0.516002       10.0.0.51            6002       sdb 100.00          0 -100.00
             1       1   2       10.0.0.516002       10.0.0.51            6002       sdc 100.00          0 -100.00
             2       1   3       10.0.0.526002       10.0.0.52            6002       sdb 100.00          0 -100.00
             3       1   4       10.0.0.526002       10.0.0.52            6002       sdc 100.00          0 -100.00
# swift-ring-builder account.builder rebalance##再平衡RING
Reassigned 1024 (100.00%) partitions. Balance is now 0.00.Dispersion is now 0.00






9.4.2創建容器RING

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# cd /etc/swift/
# swift-ring-builder container.builder create 10 3 1
# swift-ring-builder container.builder add--region 1 --zone 1 --ip 10.0.0.51 --port 6001 --device sdb --weight 100
Device d0r1z1-10.0.0.51:6001R10.0.0.51:6001/sdb_"" with 100.0 weight got id 0
# swift-ring-builder container.builder add--region 1 --zone 2 --ip 10.0.0.51 --port 6001 --device sdc --weight 100
Device d1r1z2-10.0.0.51:6001R10.0.0.51:6001/sdc_"" with 100.0 weight got id 1
# swift-ring-builder container.builder add--region 1 --zone 3 --ip 10.0.0.52 --port 6001 --device sdb --weight 100
Device d2r1z3-10.0.0.52:6001R10.0.0.52:6001/sdb_"" with 100.0 weight got id 2
# swift-ring-builder container.builder add--region 1 --zone 4 --ip 10.0.0.52 --port 6001 --device sdc --weight 100
Device d3r1z4-10.0.0.52:6001R10.0.0.52:6001/sdc_"" with 100.0 weight got id 3
# swift-ring-builder container.builder
container.builder, build version 4
1024 partitions, 3.000000 replicas, 1 regions, 4 zones, 4 devices, 100.00 balance, 0.00 dispersion
The minimum number of hours before a partition can be reassigned is 1
The overload factor is 0.00% (0.000000)
Devices:    idregionzone      ip addressportreplication ipreplication port      name weight partitions balance meta
             0       1   1       10.0.0.516001       10.0.0.51            6001       sdb 100.00          0 -100.00
             1       1   2       10.0.0.516001       10.0.0.51            6001       sdc 100.00          0 -100.00
             2       1   3       10.0.0.526001       10.0.0.52            6001       sdb 100.00          0 -100.00
             3       1   4       10.0.0.526001       10.0.0.52            6001       sdc 100.00          0 -100.00
# swift-ring-builder container.builder rebalance
Reassigned 1024 (100.00%) partitions. Balance is now 0.00.Dispersion is now 0.00






9.4.3創建對象RING

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# cd /etc/swift/
# swift-ring-builder object.builder create 10 3 1
# swift-ring-builder object.builder add--region 1 --zone 1 --ip 10.0.0.51 --port 6000 --device sdb --weight 100
Device d0r1z1-10.0.0.51:6000R10.0.0.51:6000/sdb_"" with 100.0 weight got id 0
# swift-ring-builder object.builder add--region 1 --zone 2 --ip 10.0.0.51 --port 6000 --device sdc --weight 100
Device d1r1z2-10.0.0.51:6000R10.0.0.51:6000/sdc_"" with 100.0 weight got id 1
# swift-ring-builder object.builder add--region 1 --zone 3 --ip 10.0.0.52 --port 6000 --device sdb --weight 100
Device d2r1z3-10.0.0.52:6000R10.0.0.52:6000/sdb_"" with 100.0 weight got id 2
# swift-ring-builder object.builder add--region 1 --zone 4 --ip 10.0.0.52 --port 6000 --device sdc --weight 100
Device d3r1z4-10.0.0.52:6000R10.0.0.52:6000/sdc_"" with 100.0 weight got id 3
# swift-ring-builder object.builder
object.builder, build version 4
1024 partitions, 3.000000 replicas, 1 regions, 4 zones, 4 devices, 100.00 balance, 0.00 dispersion
The minimum number of hours before a partition can be reassigned is 1
The overload factor is 0.00% (0.000000)
Devices:    idregionzone      ip addressportreplication ipreplication port      name weight partitions balance meta
             0       1   1       10.0.0.516000       10.0.0.51            6000       sdb 100.00          0 -100.00
             1       1   2       10.0.0.516000       10.0.0.51            6000       sdc 100.00          0 -100.00
             2       1   3       10.0.0.526000       10.0.0.52            6000       sdb 100.00          0 -100.00
             3       1   4       10.0.0.526000       10.0.0.52            6000       sdc 100.00          0 -100.00
# swift-ring-builder object.builder rebalance
Reassigned 1024 (100.00%) partitions. Balance is now 0.00.Dispersion is now 0.00





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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# ll *.ring.gz
-rw-r--r-- 1 root root 1445 Aug4 11:28 account.ring.gz
-rw-r--r-- 1 root root 1443 Aug4 11:34 container.ring.gz
-rw-r--r-- 1 root root 1438 Aug4 11:37 object.ring.gz
# scp *.ring.gz root@10.0.0.51:/etc/swift/
The authenticity of host '10.0.0.51 (10.0.0.51)' can't be established.
ECDSA key fingerprint is ce:93:44:a9:4d:03:93:c7:df:bf:6a:c0:a4:7e:13:8a.
Are you sure you want to continue connecting (yes/no)? yes   
Warning: Permanently added '10.0.0.51' (ECDSA) to the list of known hosts.
root@10.0.0.51's password:
account.ring.gz                                                                                 100% 1445   1.4KB/s   00:00   
container.ring.gz                                                                               100% 1443   1.4KB/s   00:00   
object.ring.gz                                                                                  100% 1438   1.4KB/s   00:00   
# scp *.ring.gz root@10.0.0.52:/etc/swift/
The authenticity of host '10.0.0.52 (10.0.0.52)' can't be established.
ECDSA key fingerprint is 12:a5:46:52:af:56:1c:1a:f1:f7:ae:04:ee:f4:4c:05.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.0.0.52' (ECDSA) to the list of known hosts.
root@10.0.0.52's password:
account.ring.gz                                                                                 100% 1445   1.4KB/s   00:00   
container.ring.gz                                                                               100% 1443   1.4KB/s   00:00   
object.ring.gz                                                                                  100% 1438   1.4KB/s   00:00





9.5結束安裝並啟動服務
9.5.1取得配置文件

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




9.5.2配置HASH_PATH_SUFFIX和HASH_PATH_PREFIX

1
2
3
# vi /etc/swift/swift.conf
swift_hash_path_suffix = openstack
swift_hash_path_prefix = openstack





9.5.2配置默认存储策略

1
2
3

name = Policy-0
default = yes





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

1
2
3
4
5
6
# scp /etc/swift/swift.conf root@10.0.0.51:/etc/swift/
root@10.0.0.51's password:
swift.conf                                                                                    100% 7202   7.0KB/s   00:00   
# scp /etc/swift/swift.conf root@10.0.0.52:/etc/swift/
root@10.0.0.52's password:
swift.conf





9.5.4变更文件和文件夹权限

1
2
3
# chown -R root:swift /etc/swift
# chown -R root:swift /etc/swift
# chown -R root:swift /etc/swift




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

1
2
3
# systemctl enable openstack-swift-proxy.service memcached.service
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-swift-proxy.service to /usr/lib/systemd/system/openstack-swift-proxy.service.
# systemctl start openstack-swift-proxy.service memcached.service





9.5.6启动各存储节点服务

1
2
3
4
5
6
7
8
9
10
11
12
# systemctl enable openstack-swift-account.service openstack-swift-account-auditor.serviceopenstack-swift-account-reaper.service openstack-swift-account-replicator.service
# systemctl start openstack-swift-account.service openstack-swift-account-auditor.serviceopenstack-swift-account-reaper.service openstack-swift-account-replicator.service
# systemctl enable openstack-swift-container.serviceopenstack-swift-container-auditor.service openstack-swift-container-replicator.serviceopenstack-swift-container-updater.service
# systemctl start openstack-swift-container.service   openstack-swift-container-auditor.service openstack-swift-container-replicator.service   openstack-swift-container-updater.service
# systemctl enable openstack-swift-object.service openstack-swift-object-auditor.service   openstack-swift-object-replicator.service openstack-swift-object-updater.service
# systemctl start openstack-swift-object.service openstack-swift-object-auditor.serviceopenstack-swift-object-replicator.service openstack-swift-object-updater.service
# systemctl enable openstack-swift-account.service openstack-swift-account-auditor.serviceopenstack-swift-account-reaper.service openstack-swift-account-replicator.service
# systemctl start openstack-swift-account.service openstack-swift-account-auditor.serviceopenstack-swift-account-reaper.service openstack-swift-account-replicator.service
# systemctl enable openstack-swift-container.serviceopenstack-swift-container-auditor.service openstack-swift-container-replicator.serviceopenstack-swift-container-updater.service
# systemctl start openstack-swift-container.service   openstack-swift-container-auditor.service openstack-swift-container-replicator.service   openstack-swift-container-updater.service
# systemctl enable openstack-swift-object.service openstack-swift-object-auditor.service   openstack-swift-object-replicator.service openstack-swift-object-updater.service
# systemctl start openstack-swift-object.service openstack-swift-object-auditor.serviceopenstack-swift-object-replicator.service openstack-swift-object-updater.service






9.6驗證

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# echo "export OS_AUTH_VERSION=3" | tee -a admin-openrc.sh demo-openrc.sh
# echo "export OS_REGION_NAME=RegionOne" | tee -a admin-openrc.sh demo-openrc.sh ###解决错误/usr/lib/python2.7/site-packages/keystoneclient/service_catalog.py:196: UserWarning: Providing attr without filter_value to get_urls() is deprecated as of the 1.7.0 release and may be removed in the 2.0.0 release. Either both should be provided or neither should be provided.
# . demo-openrc.sh
# swift stat##查看swift状态
                        Account: AUTH_db6bcde12cc947119ecab8c211fa4f35
                     Containers: 1
                        Objects: 1
                        Bytes: 13287936
Containers in policy "policy-0": 1
   Objects in policy "policy-0": 1
   Bytes in policy "policy-0": 13287936
    X-Account-Project-Domain-Id: default
                  X-Timestamp: 1470286741.05862
                     X-Trans-Id: txa608922c24224805bfd25-0057a2e160
                   Content-Type: text/plain; charset=utf-8
                  Accept-Ranges: bytes
# swift list##查看swift中的容器
container1
# swift list container1##查看swift容器中的对象
cirros-0.3.4-x86_64-disk.img
# swift delete container1 cirros-0.3.4-x86_64-disk.img##删除容器中对象
cirros-0.3.4-x86_64-disk.img
# swift list container1
# swift upload container1 cirros-0.3.4-x86_64-disk.img   ##上传对象到容器
cirros-0.3.4-x86_64-disk.img
# ls
admin-openrc.shanaconda-ks.cfgcirros-0.3.4-x86_64-disk.imgdemo-openrc.sh--os-project-domain-id--os-project-nametoken
# rm cirros-0.3.4-x86_64-disk.img
rm: remove regular file ‘cirros-0.3.4-x86_64-disk.img’? y
# swift download container1 cirros-0.3.4-x86_64-disk.img##从容器中下载对象
cirros-0.3.4-x86_64-disk.img
# ls
admin-openrc.shanaconda-ks.cfgcirros-0.3.4-x86_64-disk.imgdemo-openrc.sh--os-project-domain-id--os-project-nametoken
# swift post test_container   ##建立容器
# swift list
container1
test_container
# swift delete test_container##删除容器
test_container
# swift list
container1






页: [1]
查看完整版本: openstack安装(liberty)--安装对象存储服务(swift)