首页 » Swift » OpenStack-M版(Mitaka)搭建基于(Centos7.2)+++十、Openstack对象存储

OpenStack-M版(Mitaka)搭建基于(Centos7.2)+++十、Openstack对象存储

原文 http://blog.csdn.net/controllerha/article/details/78686801

2017-12-02 02:01:20阅读(374)

十、Openstack对象存储服务(swift)完成安装


一、启动服务

1.在控制节点节点上,启动对象存储代理服务及其依赖服务,并将它们配置为随系统启动

systemctl enable openstack-swift-proxy.service memcached.service

systemctl start openstack-swift-proxy.service memcached.service


2.在存储节点上,启动对象存储服务,并将其设置为随系统启动


systemctl enable openstack-swift-account.service openstack-swift-account-auditor.service \
openstack-swift-account-reaper.service openstack-swift-account-replicator.service \
openstack-swift-container.service openstack-swift-container-auditor.service \
openstack-swift-container-replicator.service openstack-swift-container-updater.service \
openstack-swift-object.service openstack-swift-object-auditor.service \
openstack-swift-object-replicator.service openstack-swift-object-updater.service


systemctl start openstack-swift-account.service openstack-swift-account-auditor.service \
openstack-swift-account-reaper.service openstack-swift-account-replicator.service \
openstack-swift-container.service openstack-swift-container-auditor.service \
openstack-swift-container-replicator.service openstack-swift-container-updater.service \
openstack-swift-object.service openstack-swift-object-auditor.service \
openstack-swift-object-replicator.service openstack-swift-object-updater.service


一共12个服务

openstack-swift-account.service
openstack-swift-account-auditor.service
openstack-swift-account-reaper.service
openstack-swift-account-replicator.service
openstack-swift-container.service
openstack-swift-container-auditor.service
openstack-swift-container-replicator.service
openstack-swift-container-updater.service
openstack-swift-object.service
openstack-swift-object-auditor.service
openstack-swift-object-replicator.service
openstack-swift-object-updater.service


二、验证操作


1.控制节点导入demo凭证

. demo-openrc

2.显示服务状态

swift stat

[root@controller ~]# . demo-openrc 
[root@controller ~]# swift stat
                        Account: AUTH_8cc1c04a21ae4165a1667e0bd5029831
                     Containers: 0
                        Objects: 0
                          Bytes: 0
Containers in policy "policy-0": 0
   Objects in policy "policy-0": 0
     Bytes in policy "policy-0": 0
    X-Account-Project-Domain-Id: b24b3093654b4ba4be706fe675a03b2d
                    X-Timestamp: 1510843832.18905
                     X-Trans-Id: tx3a203d933678441fbbd8f-005a0da74b
                   Content-Type: text/plain; charset=utf-8
                  Accept-Ranges: bytes

3.创建container1容器

openstack container create container1

[root@controller ~]# openstack container create container1
+---------------------------------------+------------+------------------------------------+
| account                               | container  | x-trans-id                         |
+---------------------------------------+------------+------------------------------------+
| AUTH_8cc1c04a21ae4165a1667e0bd5029831 | container1 | tx9cbd7d1486e64780a8bc6-005a0da775 |
+---------------------------------------+------------+------------------------------------+

4.上传一个测试文件到container1容器

创建一个文件FILE

touch FILE
上传测试文件

openstack object create container1 FILE

[root@controller ~]# openstack object create container1 FILE
+--------+------------+----------------------------------+
| object | container  | etag                             |
+--------+------------+----------------------------------+
| FILE   | container1 | d41d8cd98f00b204e9800998ecf8427e |
+--------+------------+----------------------------------+

5.列出container1容器里的所有文件

openstack object list container1

[root@controller ~]# openstack object list container1
+------+
| Name |
+------+
| FILE |
+------+

6.从container1容器里下载一个测试文件

先将创建的FILE文件删除

[root@controller ~]# rm FILE 
rm: remove regular empty file ‘FILE’? y
[root@controller ~]# ls
admin-openrc  anaconda-ks.cfg  cirros-0.3.4-x86_64-disk.img  demo-openrc

下载

openstack object save container1 FILE

[root@controller ~]# openstack object save container1 FILE
[root@controller ~]# ls
admin-openrc  anaconda-ks.cfg  cirros-0.3.4-x86_64-disk.img  demo-openrc  FILE


到此swift结束


最新发布

CentOS专题

关于本站

5ibc.net旗下博客站精品博文小部分原创、大部分从互联网收集整理。尊重作者版权、传播精品博文,让更多编程爱好者知晓!

小提示

按 Ctrl+D 键,
把本文加入收藏夹