用glusterfs+swift搭建对象存储(代码片段)

**小君哥** **小君哥**     2022-11-21     288

关键词:

在已经搭建好的GlusterFS服务器上(如不知道如何搭建GlusteFS请参考上一篇):

Create bricks:

# truncate -s 1GB /srv/disk1..4# for i in `seq 1 4`;do mkfs.xfs -i size=512 /srv/disk$i ;done# mkdir -p /export/brick1..4

Add the following lines to /etc/fstab to auto-mount the the bricks on system startup:

/srv/disk1    /export/brick1   xfs   loop,inode64,noatime,nodiratime 0 0
/srv/disk2    /export/brick2   xfs   loop,inode64,noatime,nodiratime 0 0
/srv/disk3    /export/brick3   xfs   loop,inode64,noatime,nodiratime 0 0
/srv/disk4    /export/brick4   xfs   loop,inode64,noatime,nodiratime 0 0

Mount the bricks:

# mount -a

You can now create and start the GlusterFS volume. Make sure your hostname is in /etc/hosts or is DNS-resolvable.

# gluster volume create swift-test-vol-01 replica 2 transport tcp cnsz22VLK5966.ossit.sfdc.com.cn:/export/brick1..4/data force
 
 
Mount the GlusterFS volume:
# mkdir -p /mnt/gluster-object/test-vol-01 
# mount -t glusterfs cnsz22VLK5966.ossit.sfdc.com.cn:swift-test-vol-01  /mnt/gluster-object/test-vol-01
 
 
Installing Openstack Swift
# yum install centos-release-openstack-newton    (http://mirrors.aliyun.com/centos/7/extras/x86_64/Packages/
# yum install openstack-swift-*   (http://mirrors.aliyun.com/centos/7/cloud/x86_64/openstack-newton/
 
 
Installing gluster-swift  (注意安装版本要与openstack swift版本一致)
# yum install epel-release     (http://mirrors.aliyun.com/centos/7/extras/x86_64/Packages/
#yum install python-prettytable     (安装python相关包过程中如果遇到gcc相关编译报错,请执行yum install python-devel 安装python开发包)
#yum install git
# git clone https://github.com/gluster/gluster-swift; cd gluster-swift
# python setup.py install
 
 
gluster-swift configuration files
# mkdir -p /etc/swift/
# cp etc/* /etc/swift/
# cd /etc/swift
# for tmpl in *.conf-gluster ; do cp $tmpl $tmpl%.*.conf; done
 
 
Export GlusterFS volumes over gluster-swift   
# gluster-swift-gen-builders [VOLUME] [VOLUME...](命令格式)
# gluster-swift-gen-builders swift-test-vol-01 (命令实例)
 
 
Start gluster-swift
# swift-init main start
 
 
Using gluster-swift
 
Create a container
# curl -i -X PUT http://localhost:8080/v1/AUTH_swift-test-vol-01/test-container-01
# ls /mnt/gluster-object/swift-test-vol-01/
 
Create an object
# echo "Hello Swift" > test.txt
#curl -i -X PUT -T test.txt http://localhost:8080/v1/AUTH_swift-test-vol-01/test-container-01/test.txt
# cat /mnt/gluster-object/swift-test-vol-01/test-container-01/test.txt
 
Request the object
# curl -i -X GET -o newTest.txt http://localhost:8080/v1/AUTH_swift-test-vol-01/test-container-01/test.txt
#cat newTest.txt
 
Delete the object
#curl -i -X DELETE http://localhost :8080/v1/AUTH_swift-test-vol-01/test-container-01/test.txt
 
如果不是GlusterFS服务器,需要先安装以下包:
 
Installing and starting GlusterFS
 
# yum install centos-release-gluster
# yum install glusterfs glusterfs-server  glusterfs-cli glusterfs-libs glusterfs-client glusterfs-fuse glusterfs-api

【minio】基于awss3协议搭建个人云存储服务

参考技术A在2007年,GlusterFS演变为大型分布式存储方案后,任何配备合适硬件的公司,单位都可以利用个做分布式的流媒体,数据分析。在2011年,RedHat收购了GlusterFS.Minio是GlusterFS创始人之一AnandBabuPeriasamy发布新的开源项目。Minio... 查看详情

glusterfs——分布式卷

GlusterFS概述GlusterFS系统是一个可扩展的网络文件系统,相比其他分布式文件系统,GlusterFS具有高扩展性、高可用性、高性能、可横向扩展等特点,并且其没有元数据服务器的设计,让整个服务没有单点故障的隐患。文件存储通常... 查看详情

3.glusterfs企业分布式存储的搭建

...固态硬盘。为了充分保证系统的稳定性和性能,要求所有glusterfs服务器硬件配置尽量一致,尤其是硬盘数量和大小。机器的RAID卡需要带电池,缓存越大,性能越好。一般情况下,建议做RAID10,如果出于空间要求的考虑,需要做RA... 查看详情

对象存储glusterfs使用

新增三台centos7机器,最小化安装ip分配是服务端192.168.1.7192.168.1.8 客户端192.168.1.9   主机名分别为gluster01gluster02client01hostnamectlset-hostnamegluster01hostnamectlset-hostnamegluster02hostnamectlset-ho 查看详情

2018年3月29日11:02:33关于docker分享之分布式存储glusterfs(代码片段)

2018年3月29日11:02:33关于docker分享之分布式存储glusterfs经典语录:实际实验搭建:前提是要保证一个/data目录不和根分区在同一个磁盘!1、centos7安装glusterfs参考链接:https://wiki.centos.org/SpecialInterestGroup/Storage/gluster-Quickstart#ToUsetheRPM... 查看详情

glusterfs简介(代码片段)

GlusterFS简介GlusterFS概述GlusterFS(GlusterFileSystem)是一个开源的分布式文件系统,主要由ZRESEARCH公司负责开发。GlusterFS是Scale-Out存储解决方案Gluster的核心,具有强大的横向扩展能力,通过扩展能够支持数PB存储容量和处理数千客户端... 查看详情

glusterfs分布式文件系统(代码片段)

GlusterFS分布式文件系统,用于存储、管理磁盘文件文件系统(FS)文件系统组成1、文件系统接口2、对对像管理的软件集合3、对象及属性文件系统作用从系统角度来看,文件系统是对文件存储设备的空间进行组织和分配... 查看详情

swift对象存储(代码片段)

swift对象存储简介OpenStackObjectStorage(Swift)是OpenStack开源云计算项目的子项目之一,被称为对象存储,提供了强大的扩展性、冗余和持久性。对象存储,用于永久类型的静态数据的长期存储。 Swift最初是由Rackspace公司开发的高可... 查看详情

把对象存储转为文件存储,到底香不香?(代码片段)

目前开源的文件存储有很多,譬如NFS、GlusterFS、CephFS等,但实话实话这些文件存储都存在一定的问题,譬如NFS的多集群要折腾、GlusterFS的小文件存储性能差、CephFS的运维复杂度和稳定性不高。结合公司的业务场景࿱... 查看详情

glusterfs分布式文件系统概述(代码片段)

博文目录一、GlusterFS概述1、GlusterFS的特点2、GlusterFS术语3、模块化堆栈式架构二、GlusterFS的工作原理1、GlusterFS的工作流程2、弹性HASH算法三、GlusterFS的卷类型1、分布式卷2、条带卷3、复制卷4、分布式条带卷5、分布式复制卷一、G... 查看详情

在 Swift 中存储没有初始化的对象

】在Swift中存储没有初始化的对象【英文标题】:StoringanObjectwithoutInitializationinSwift【发布时间】:2017-01-1200:01:36【问题描述】:当我通过测试驱动的开发练习来更好地了解如何初始化和使用对象时,我遇到了一个测试用例,我在... 查看详情

38掌握分布式存储系统glusterfs的基本用法,包括卷管理数据复制(代码片段)

GlusterFS是一种分布式文件系统,可以将多个存储服务器集成为一个分布式存储池。以下是一些基本的使用方法和示例代码。安装和启动GlusterFS在所有节点上安装GlusterFS,并确保每个节点上的GlusterFS服务已经启动。创建Glust... 查看详情

搭建gfs分布式文件系统-----实操(代码片段)

一、GlusterFS简介:GFS是一个可扩展的分布式文件系统,用于大型的、分布式的、对大量数据进行访问的应用。它运行于廉价的普通硬件上,并提供容错功能。它可以给大量的用户提供总体性能较高的服务。开源的分布式文件系统... 查看详情

glusterfs:优秀开源分布式存储系统(代码片段)

一、GlusterFS简介1、什么是glusterfsGlusterfs是一个开源分布式文件系统,具有强大的横向扩展能力,可支持数PB存储容量和数千客户端,通过InfinibandRDMA或Tcp/Ip方式将许多廉价的x86主机,通过网络互联成一个并行的网... 查看详情

glusterfs-----文件分布系统+集群部署(代码片段)

一、Gluster概述1.1、gluster简介Glusterfs是一个开源的分布式文件系统,是Scale存储的核心,能够处理千数量级的客户端.在传统的解决方案中Glusterfs能够灵活的结合物理的,虚拟的和云资源去体现高可用和企业级的性能存储.Glusterfs通过TCP... 查看详情

glusterfs-----文件分布系统+集群部署(代码片段)

一、Gluster概述1.1、gluster简介Glusterfs是一个开源的分布式文件系统,是Scale存储的核心,能够处理千数量级的客户端.在传统的解决方案中Glusterfs能够灵活的结合物理的,虚拟的和云资源去体现高可用和企业级的性能存储.Glusterfs通过TCP... 查看详情

glusterfs简单介绍

...手,低坑模式,深受我这种菜鸟的喜爱并一发不可收拾。glusterFS:适用于数据密集型任务的可扩展忘了文件系统,免费开源。gluster于2011年10月7日被redhat收 查看详情

glusterfs分布式存储集群-2.使用(代码片段)

参考文档: QuickStartGuide:http://gluster.readthedocs.io/en/latest/Quick-Start-Guide/Quickstart/ Install-Guide:https://docs.gluster.org/en/latest/Install-Guide/Install/ CentOSgluster-Quickstart:https: 查看详情