网站设计的原始资料,wordpress 输出时间,武安市精品网站开发,长沙公司排行1.规划节点
IP主机名节点192.168.100.10controllerOpenStack控制节点192.168.100.20computeOpenStack计算节点
2.环境准备 使用OpenStack平台的两台节点#xff0c;自行使用脚本安装Swift对象存储服务。然后使用这两台进行实验。节点规划表中的IP地址为作者的IP地址#…1.规划节点
IP主机名节点192.168.100.10controllerOpenStack控制节点192.168.100.20computeOpenStack计算节点
2.环境准备 使用OpenStack平台的两台节点自行使用脚本安装Swift对象存储服务。然后使用这两台进行实验。节点规划表中的IP地址为作者的IP地址在进行实操案例的时候按照自己的环境规划网络与IP地址。
3. 案例实施
3.1Swift分片存储
1.查询Swiftring的配置
使用远程连接工具连接到controller节点使用命令查看swift ring的Region、partition、Replica配置分别为多少
# 首先查询swift的状态 controller # source /etc/keystone/admin-openre.sh # 首先身份验证 controller # swift stat # 查看状态 # 进入/etc/swift目录使用命令查看 controller # swift-ring-builder object.builder --------------------------------------------------------------------- object.builder, build version 2, id 3c8cb10a9cd04d7396f4ec1391fa62b6 1024 partitions, 1.000000 replicas, 1 regions, 1 zones, 1 devices, 0.00 balance, 0.00 dispersion The minimum number of hours before a partition can be reassigned is 1 (0:55:49 remaining) The overload factor is 0.00% (0.000000) Ring file object.ring.gz is up-to-date Devices: id region zone ip address:port replication ip:port name weight partitions balance flags meta 0 1 1 192.168.100.20:6000 192.168.100.20:6000 sdb2 100.00 1024 0.00 可以看到swift的存储区域是192.168.100.20这台服务器也就是计算节点使用盘符是/dev/sdb2大小是100G
2.创建容器
使用命令创建一个容器test并查看容器的状态信息
controller # swift post test # 创建一个名为test的容器 controller # swift stat test # 查看test容器的状态
3.上传镜像并使用分段存储
将提供的cirros-0.3.4-x86_64-disk.img镜像上传至controller节点的/root目录下并使用命令上传至test容器中进行分片存储每个片段的大小为10M
controller # ll -rw-r--r--. 1 root root 13287936 8月 3 2017 cirros-0.3.4-x86_64-disk.img controller # swift upload test -S 10000000 cirros-0.3.4-x86_64-disk.img 查看cirros镜像的存储路径
controller # swift stat test cirros-0.3.4-x86_64-disk.img 查看存储路径中的数据片
controller # swift list test_segments 可以看到cirros镜像在上传至swfit对象存储中被分片存储了单个存储片的大小为10M因为该镜像大小为13M左右所有分成了两个存储片。