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訪問點

[[email protected] ~]# . admin-openrc.sh 
[[email protected] ~]# openstack user create --domain default --password-prompt swift
User Password:
Repeat User Password:
+-----------+----------------------------------+
| Field     | Value                            |
+-----------+----------------------------------+
| domain_id | default                          |
| enabled   | True                             |
| id        | 9f9d73e380ac4db0af601604ee45ea02 |
| name      | swift                            |
+-----------+----------------------------------+
[[email protected] ~]# openstack role add --project service --user swift admin
[[email protected] ~]# 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                     |
+-------------+----------------------------------+
[[email protected]er1 ~]# 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 |
+--------------+-----------------------------------------------+
[[email protected] ~]# 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 |
+--------------+-----------------------------------------------+
[[email protected] ~]# 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安裝配置組件

[[email protected] ~]# yum install openstack-swift-proxy python-swiftclient python-keystoneclient python-keystonemiddleware memcached -y
[[email protected] ~]# 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 % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 29655  100 29655    0     0  14194      0  0:00:02  0:00:02 --:--:-- 14188
[[email protected] ~]# vi /etc/swift/proxy-server.conf 
[DEFAULT]
bind_port = 8080
user = swift
swift_dir = /etc/swift
[pipeline:main]
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
[app:proxy-server]
use = egg:swift#proxy
account_autocreate = true
[filter:keystoneauth]  此项也需要取消注释
use = egg:swift#keystoneauth
operator_roles = admin,user
[filter:authtoken] 移除或註釋此配置組下其他項目
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
[filter:cache]
use = egg:swift#memcache
memcache_servers = 127.0.0.1:11211

9.3安裝配置存儲節點

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

[[email protected] ~]# yum install xfsprogs rsync -y
[[email protected] ~]# ls /dev/sd*
/dev/sda  /dev/sda1  /dev/sda2  /dev/sdb  /dev/sdc
[[email protected] ~]# 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
[[email protected] ~]# 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
[[email protected] ~]# mkdir -p /srv/node/sdb
[[email protected] ~]# mkdir -p /srv/node/sdc
[[email protected] ~]# 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
[[email protected] ~]# mount /srv/node/sdb
[[email protected] ~]# mount /srv/node/sdc
[[email protected] ~]# 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地址
[account]
max connections = 2
path = /srv/node/
read only = false
lock file = /var/lock/account.lock
[container]
max connections = 2
path = /srv/node/
read only = false
lock file = /var/lock/container.lock
[object]
max connections = 2
path = /srv/node/
read only = false
lock file = /var/lock/object.lock
[[email protected] ~]# systemctl enable rsyncd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/rsyncd.service to /usr/lib/systemd/system/rsyncd.service.
[[email protected] ~]# systemctl start rsyncd.service
[[email protected] ~]# systemctl status rsyncd.service

9.3.2安裝配置組件

[[email protected] ~]# yum install openstack-swift-account openstack-swift-container  openstack-swift-object  -y
[[email protected] ~]# 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 % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  6147  100  6147    0     0   4344      0  0:00:01  0:00:01 --:--:--  4347
[[email protected] ~]# 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 % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  6976  100  6976    0     0    516      0  0:00:13  0:00:13 --:--:--  2087
[[email protected] ~]# 
[[email protected] ~]# 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 % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 11819  100 11819    0     0   9234      0  0:00:01  0:00:01 --:--:--  9240
[[email protected] ~]# vi /etc/swift/account-server.conf 
[DEFAULT]
bind_ip = 10.0.0.51
bind_port = 6002
user = swift
swift_dir = /etc/swift
devices = /srv/node
mount_check = true
[pipeline:main]
pipeline = healthcheck recon account-server
[filter:recon]
use = egg:swift#recon
recon_cache_path = /var/cache/swift
[[email protected] ~]# vi /etc/swift/container-server.conf 
[DEFAULT]
bind_ip = 10.0.0.51
bind_port = 6001
user = swift
swift_dir = /etc/swift
devices = /srv/node
mount_check = true
[pipeline:main]
pipeline = healthcheck recon container-server
[filter:recon]
use = egg:swift#recon
recon_cache_path = /var/cache/swift
[[email protected] ~]# vi /etc/swift/object-server.conf 
[DEFAULT]
bind_ip = 10.0.0.51
bind_port = 6000
user = swift
swift_dir = /etc/swift
devices = /srv/node
mount_check = true
[pipeline:main]
pipeline = healthcheck recon object-server
[filter:recon]
use = egg:swift#recon
recon_cache_path = /var/cache/swift
recon_lock_path = /var/lock
[[email protected] ~]# chown -R swift:swift /srv/node
[[email protected] ~]# mkdir -p /var/cache/swift
[[email protected] ~]# chown -R root:swift /var/cache/swift

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

9.4.1創建賬戶RING

[[email protected] ~]# cd /etc/swift/   ##切換目錄
[[email protected] swift]# swift-ring-builder account.builder create 10 3 1   ###沒有輸出
[[email protected] swift]# 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
[[email protected] swift]# 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
[[email protected] swift]# 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
[[email protected] swift]# 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
[[email protected] swift]# 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:    id  region  zone      ip address  port  replication ip  replication port      name weight partitions balance meta
             0       1     1       10.0.0.51  6002       10.0.0.51              6002       sdb 100.00          0 -100.00 
             1       1     2       10.0.0.51  6002       10.0.0.51              6002       sdc 100.00          0 -100.00 
             2       1     3       10.0.0.52  6002       10.0.0.52              6002       sdb 100.00          0 -100.00 
             3       1     4       10.0.0.52  6002       10.0.0.52              6002       sdc 100.00          0 -100.00 
[[email protected] swift]# 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

[[email protected] ~]# cd /etc/swift/
[[email protected] swift]# swift-ring-builder container.builder create 10 3 1
[[email protected] swift]# 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
[[email protected] swift]# 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
[[email protected]oller1 swift]# 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
[[email protected] swift]# 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
[[email protected] swift]# 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:    id  region  zone      ip address  port  replication ip  replication port      name weight partitions balance meta
             0       1     1       10.0.0.51  6001       10.0.0.51              6001       sdb 100.00          0 -100.00 
             1       1     2       10.0.0.51  6001       10.0.0.51              6001       sdc 100.00          0 -100.00 
             2       1     3       10.0.0.52  6001       10.0.0.52              6001       sdb 100.00          0 -100.00 
             3       1     4       10.0.0.52  6001       10.0.0.52              6001       sdc 100.00          0 -100.00 
[[email protected] swift]# 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

[[email protected] ~]# cd /etc/swift/
[[email protected] swift]# swift-ring-builder object.builder create 10 3 1
[[email protected] swift]# 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
[[email protected] swift]# 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
[[email protected] swift]# 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
[[email protected] swift]# 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
[[email protected] swift]# 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:    id  region  zone      ip address  port  replication ip  replication port      name weight partitions balance meta
             0       1     1       10.0.0.51  6000       10.0.0.51              6000       sdb 100.00          0 -100.00 
             1       1     2       10.0.0.51  6000       10.0.0.51              6000       sdc 100.00          0 -100.00 
             2       1     3       10.0.0.52  6000       10.0.0.52              6000       sdb 100.00          0 -100.00 
             3       1     4       10.0.0.52  6000       10.0.0.52              6000       sdc 100.00          0 -100.00
[[email protected] swift]# 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/目錄下

[[email protected] swift]# ll *.ring.gz
-rw-r--r-- 1 root root 1445 Aug  4 11:28 account.ring.gz
-rw-r--r-- 1 root root 1443 Aug  4 11:34 container.ring.gz
-rw-r--r-- 1 root root 1438 Aug  4 11:37 object.ring.gz
[[email protected] swift]# scp *.ring.gz [email protected]:/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.
[email protected]‘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    
[[email protected] swift]# scp *.ring.gz [email protected]:/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.
[email protected]‘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取得配置文件

[[email protected] ~]# 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

[[email protected] ~]# vi /etc/swift/swift.conf
swift_hash_path_suffix = openstack
swift_hash_path_prefix = openstack

9.5.2配置默认存储策略

[storage-policy:0]
name = Policy-0
default = yes

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

[[email protected] ~]# scp /etc/swift/swift.conf [email protected]:/etc/swift/
[email protected]‘s password: 
swift.conf                                                                                      100% 7202     7.0KB/s   00:00    
[[email protected] ~]# scp /etc/swift/swift.conf [email protected]:/etc/swift/
[email protected]‘s password: 
swift.conf

9.5.4变更文件和文件夹权限

[[email protected] ~]# chown -R root:swift /etc/swift
[[email protected] ~]# chown -R root:swift /etc/swift
[[email protected] ~]# chown -R root:swift /etc/swift

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

[[email protected] ~]# 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.
[[email protected] ~]# systemctl start openstack-swift-proxy.service memcached.service

9.5.6启动各存储节点服务

[[email protected] ~]# systemctl enable openstack-swift-account.service openstack-swift-account-auditor.service  openstack-swift-account-reaper.service openstack-swift-account-replicator.service
[[email protected] ~]# systemctl start openstack-swift-account.service openstack-swift-account-auditor.service  openstack-swift-account-reaper.service openstack-swift-account-replicator.service
[[email protected] ~]# systemctl enable openstack-swift-container.service  openstack-swift-container-auditor.service openstack-swift-container-replicator.service  openstack-swift-container-updater.service
[[email protected] ~]# systemctl start openstack-swift-container.service   openstack-swift-container-auditor.service openstack-swift-container-replicator.service   openstack-swift-container-updater.service
[[email protected] ~]# systemctl enable openstack-swift-object.service openstack-swift-object-auditor.service   openstack-swift-object-replicator.service openstack-swift-object-updater.service
[[email protected] ~]# systemctl start openstack-swift-object.service openstack-swift-object-auditor.service  openstack-swift-object-replicator.service openstack-swift-object-updater.service
[[email protected] ~]# systemctl enable openstack-swift-account.service openstack-swift-account-auditor.service  openstack-swift-account-reaper.service openstack-swift-account-replicator.service
[[email protected] ~]# systemctl start openstack-swift-account.service openstack-swift-account-auditor.service  openstack-swift-account-reaper.service openstack-swift-account-replicator.service
[[email protected] ~]# systemctl enable openstack-swift-container.service  openstack-swift-container-auditor.service openstack-swift-container-replicator.service  openstack-swift-container-updater.service
[[email protected] ~]# systemctl start openstack-swift-container.service   openstack-swift-container-auditor.service openstack-swift-container-replicator.service   openstack-swift-container-updater.service
[[email protected] ~]# systemctl enable openstack-swift-object.service openstack-swift-object-auditor.service   openstack-swift-object-replicator.service openstack-swift-object-updater.service
[[email protected] ~]# systemctl start openstack-swift-object.service openstack-swift-object-auditor.service  openstack-swift-object-replicator.service openstack-swift-object-updater.service

9.6驗證

[[email protected] ~]# echo "export OS_AUTH_VERSION=3" | tee -a admin-openrc.sh demo-openrc.sh
[[email protected] ~]# 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.
[[email protected] ~]# . demo-openrc.sh 
[[email protected] ~]# 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
[[email protected] ~]# swift list  ##查看swift中的容器
container1
[[email protected] ~]# swift list container1  ##查看swift容器中的对象
cirros-0.3.4-x86_64-disk.img
[[email protected] ~]# swift delete container1 cirros-0.3.4-x86_64-disk.img  ##删除容器中对象
cirros-0.3.4-x86_64-disk.img
[[email protected] ~]# swift list container1
[[email protected] ~]# swift upload container1 cirros-0.3.4-x86_64-disk.img   ##上传对象到容器
cirros-0.3.4-x86_64-disk.img
[[email protected] ~]# ls
admin-openrc.sh  anaconda-ks.cfg  cirros-0.3.4-x86_64-disk.img  demo-openrc.sh  --os-project-domain-id  --os-project-name  token
[[email protected] ~]# rm cirros-0.3.4-x86_64-disk.img 
rm: remove regular file ‘cirros-0.3.4-x86_64-disk.img’? y
[[email protected] ~]# swift download container1 cirros-0.3.4-x86_64-disk.img  ##从容器中下载对象
cirros-0.3.4-x86_64-disk.img [auth 0.637s, headers 0.682s, total 1.000s, 36.568 MB/s]
[[email protected] ~]# ls
admin-openrc.sh  anaconda-ks.cfg  cirros-0.3.4-x86_64-disk.img  demo-openrc.sh  --os-project-domain-id  --os-project-name  token
[[email protected] ~]# swift post test_container   ##建立容器
[[email protected] ~]# swift list
container1
test_container
[[email protected] ~]# swift delete test_container  ##删除容器
test_container
[[email protected] ~]# swift list
container1
时间: 2024-10-13 16:16:15

openstack安装(liberty)--安装对象存储服务(swift)的相关文章

swift(Object Storage对象存储服务)(单节点)

# 在部署对象存储服务(swift)之前,你的环境必须包含身份验证服务(keystone); # keystone需要MySQL数据库,Rabbitmq服务,Memcached服务; # 内存:4G # 系统:Ubuntu Server-14.04.5 # 安装方法:http://www.jianshu.com/p/9e77b3ad930a # IP地址:192.168.10.55 # 主机名:object 基本环境配置 配置主机静态IP地址 vim /etc/network/interface

openstack-mitaka之对象存储服务(object安装配置)

在本次环境中,object共使用2台主机,每台主机3个磁盘,其中第一块磁盘用于系统,后面两块,用于对象存储服务使用,前期准备工作,已经准备就绪,接下来,开始安装配置 1.安装软件包(在object1.object2分别执行如下命令) 2.在object1.object2执行XFS格式化/dev/sdb./dev/sdc 3.在object1.object2创建挂载点目录结构 3.在object1.object2分别编辑/etc/fstab 4.在object1.object2挂载设备 5.在ob

Openstack O版 配置swift对象存储服务

环境如下图所示:IP:192.168.0.111 controllerIP:192.168.0.112 computeIP:192.168.0.113 object1IP:192.168.0.117 object2IP:192.168.0.118 cinder1.在控制节点上安装 swift服务[[email protected]er ~]# source admin-openrc创建swift用户[[email protected] ~]# openstack user create --do

openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 三

openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 一 openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 二 openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 三 openstack-r版(rocky)搭建基于centos7.4 的openstack swift对象存储服务 四 以下操作在控制节点执行control

轻量对象存储服务——minio

minio Minio是一个非常轻量的对象存储服务. Github: minio 它本身不支持文件的版本管理.如果有这个需求,可以用 s3git 搭配使用. Github: s3git 安装 minio 文档有列出各平台的安装方式.这里只说 docker 的方式. docker-compose.yml version: "3" services: minio: image: minio/minio volumes: - minio-data:/data ports: - "9

Ceph分布式radosgw对象存储融合Swift 、S3的访问应用

**Ceph分布式radosgw对象存储融合Swift .S3的访问应用** 确保集群状态正常:前半部分配置参照 https://blog.51cto.com/jdonghong/244175 上半部分配置.安装RGW实例[[email protected] idc-cluster]# ceph-deploy install --rgw client1 client2 client3 [[email protected] idc-cluster]# ceph-deploy rgw create

2020.2.19 10分钟自建对象存储服务!

10分钟自建对象存储服务! 摘要 对象存储服务可以用来存储各类文件,下面如何搭建一个对象存储服务来存储图片 MinIO 简介 MinIO是一款基于Go语言的高性能对象存储服务,它采用了Apache License v2.0 开源协议,非常适合于存储大容量非结构化的数据,例如图片.视频.日志文件.备份数据和容器/虚拟机镜像等. 安装及部署 MinIO的安装方式有很多,这里我们使用它在Docker环境下的安装方式. 下载MinIO 的Docker 镜像: docker pull minio/mini

腾讯对象存储服务COS加密签名上传文件与下载文件的剖析,福利提供给所有使用Android的小伙伴们!

在做一些用户需求的时候,公司往往需要工程师采集到更多有用的关于用户的个人信息,然后对用户群进行分析,今天我不是来分析这些的,今天我主要是说 腾讯推出的款云产品,那就是对象存储服务COS,这个产品面向所有开发者,新用户都有免费享有10G的使用权,10G可能对于做方案的工程师来说可能是微不 足道的,比如后视镜和车载方案,会常常需要用到视频的存储与云分享,当然这里不是只本地存储哦,我指的是用户在使用方案商的方案的时候,比如他开车 的时候录了一段视频需要分享到某个域,共享给大家看,比如微信,这时候他肯定

FreeNAS 11.0 正式发布,提供 S3 兼容的对象存储服务

FreeNAS 11.0 正式版已发布,该版本带来了新的虚拟化和对象存储功能.FreeNAS 11.0 将 bhyve 虚拟机添加到其受欢迎的 SAN / NAS.Jail 和插件中,让用户可以在 FreeNAS box 上使用 host web-scale VMs.它提供 S3 兼容的对象存储服务,可将 FreeNAS box 变成 S3 兼容的服务器,不用再依赖云端.点击此处查看 FreeNAS 11.0 的新功能 FreeNAS 11.0 基于 FreeBSD 11-STABLE ,它增加