SeaweedFS使用小结

SeaweedFS是一个基于Go语言开发的高可用文件存储系统,提供快速、低内存占用的文件存储解决方案。其特色包括存储大量文件、自带REST API且易于上手。系统由数据卷、数据卷服务器和主控服务器组成,其中文件元数据仅占16字节,提高了访问速度。文件上传和下载可通过curl命令或内置的weed工具完成,支持HTTP API操作。SeaweedFS支持直接访问Volume获取文件内容,避免了通过Master服务器的额外请求。
摘要由CSDN通过智能技术生成

一、介绍

SeaweedFS是基于go语言开发的高可用文件存储系统,主要特性
1、成存储上亿的文件(最终受制于你的硬盘大小)
2、速度快,内存占用小

上手使用比fastDFS要简单很多,自带Rest API。

SaaWeeDFS作为对象存储库来有效地处理小文件。不是管理中央主机中的所有文件元数据,中央主机只管理文件卷,它允许这些卷服务器管理文件和它们的元数据。
这减轻了来自中央主机的并发压力,并将文件元数据扩展到卷服务器,允许更快的文件访问(仅一个磁盘读取操作)。

每个文件的元数据只有40字节的磁盘存储开销。

访问地址:https://github.com/chrislusf/seaweedfs

二、原理


数据卷:也就是是类似我们windowspan的D,E盘等物理磁盘,文件保存的物理介质。默认32GB,通过修改代码可以修改为64GB或者128GB,每个文件的最大不超过单个卷的大小。
官网描述:In the current implementation, each volume can hold 32 gibibytes (32GiB or 8x2^32 bytes). This is because we align content to 8 bytes. We can easily increase this to 64GiB, or 128GiB, or more, by changing 2 lines of code, at the cost of some wasted padding space due to alignment.
There can be 4 gibibytes (4GiB or 2^32 bytes) of volumes. So the total system size is 8 x 4GiB x 4GiB which is 128 exbibytes (128EiB or 2^67 bytes).
Each individual file size is limited to the volume size.

数据卷服务器:为了更方便的管理数据卷,通过该服务来对多个数据卷进行管理。其中,数据卷服务器保存了文件元数据,通过访问文件元数据就可以操作数据卷中的文件。从官网中我们了解到文件的元数据只有16字节大小。【文件句柄:表示文件对象的一个便于使用的引用】
官网描述:The actual data is stored in volumes on storage nodes. One volume server can have multiple volumes, and can both support read and write access with basic authentication. 一个卷服务对应多个卷
The actual file metadata is stored in each volume on volume servers. Since each volume server only manages metadata of files on its own disk, with only 16 bytes for each file, all file access can read file metadata just from memory and only needs one disk operation to actually read file data.每个文件的元数据16字节大小,Linux中中XFS结构中为536/8(67)字节。
For comparison, consider that an xfs inode structure in Linux is 536 bytes

主控服务器:为了便于对多个数据卷服务器进行统一的调度(增加,删除,查找,定位等等操作

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

byxdaz

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值