27 Star 165 Fork 38

Juicedata / JuiceFS

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

JuiceFS Logo

GitHub Workflow Status GitHub Workflow Status Go Report English doc Join Slack

JuiceFS 是一款高性能 POSIX 文件系统,针对云原生环境特别优化设计,在 Apache 2.0 开源协议下发布。使用 JuiceFS 存储数据,数据本身会被持久化在对象存储(例如 Amazon S3),而数据所对应的元数据可以根据场景需求被持久化在 Redis、MySQL、TiKV 等多种数据库引擎中。

JuiceFS 可以简单便捷的将海量云存储直接接入已投入生产环境的大数据、机器学习、人工智能以及各种应用平台,无需修改代码即可像使用本地存储一样高效使用海量云端存储。

📺 视频什么是 JuiceFS?

📖 文档快速上手指南

核心特性

  1. POSIX 兼容:像本地文件系统一样使用,无缝对接已有应用,无业务侵入性;
  2. HDFS 兼容:完整兼容 HDFS API,提供更强的元数据性能;
  3. S3 兼容:提供 S3 网关 实现 S3 协议兼容的访问接口;
  4. 云原生:通过 Kubernetes CSI 驱动 可以很便捷地在 Kubernetes 中使用 JuiceFS;
  5. 多端共享:同一文件系统可在上千台服务器同时挂载,高性能并发读写,共享数据;
  6. 强一致性:确认的修改会在所有挂载了同一文件系统的服务器上立即可见,保证强一致性;
  7. 强悍性能:毫秒级的延迟,近乎无限的吞吐量(取决于对象存储规模),查看性能测试结果
  8. 数据安全:支持传输中加密(encryption in transit)以及静态加密(encryption at rest),查看详情
  9. 文件锁:支持 BSD 锁(flock)及 POSIX 锁(fcntl);
  10. 数据压缩:支持使用 LZ4Zstandard 压缩数据,节省存储空间。

架构 | 开始使用 | 进阶主题 | POSIX 兼容性 | 性能测试 | 支持的对象存储 | 谁在使用 | 产品路线图 | 反馈问题 | 贡献 | 社区 | 使用量收集 | 开源协议 | 致谢 | FAQ


架构

JuiceFS 由三个部分组成:

  1. JuiceFS 客户端:协调对象存储和元数据存储引擎,以及 POSIX、Hadoop、Kubernetes、S3 Gateway 等文件系统接口的实现;
  2. 数据存储:存储数据本身,支持本地磁盘、对象存储;
  3. 元数据引擎:存储数据对应的元数据,支持 Redis、MySQL、SQLite 等多种引擎;

JuiceFS Architecture

JuiceFS 依靠 Redis 来存储文件的元数据。Redis 是基于内存的高性能的键值数据存储,非常适合存储元数据。与此同时,所有数据将通过 JuiceFS 客户端存储到对象存储中。了解详情

Data structure diagram

任何存入 JuiceFS 的文件都会被拆分成固定大小的 "Chunk",默认的容量上限是 64 MiB。每个 Chunk 由一个或多个 "Slice" 组成,Slice 的长度不固定,取决于文件写入的方式。每个 Slice 又会被进一步拆分成固定大小的 "Block",默认为 4 MiB。最后,这些 Block 会被存储到对象存储。与此同时,JuiceFS 会将每个文件以及它的 Chunks、Slices、Blocks 等元数据信息存储在元数据引擎中。了解详情

How JuiceFS stores your files

使用 JuiceFS,文件最终会被拆分成 Chunks、Slices 和 Blocks 存储在对象存储。因此,你会发现在对象存储平台的文件浏览器中找不到存入 JuiceFS 的源文件,存储桶中只有一个 chunks 目录和一堆数字编号的目录和文件。不要惊慌,这正是 JuiceFS 高性能运作的秘诀!

开始使用

创建 JuiceFS,需要以下 3 个方面的准备:

  1. 准备 Redis 数据库
  2. 准备对象存储
  3. 下载安装 JuiceFS 客户端

请参照 快速上手指南 立即开始使用 JuiceFS!

命令索引

请点击 这里 查看所有子命令以及命令行参数。

容器

JuiceFS 可以为 Docker、Podman 等容器化技术提供持久化存储,请查阅 文档 了解详情。

Kubernetes

在 Kubernetes 中使用 JuiceFS 非常便捷,请查看 这个文档 了解更多信息。

Hadoop Java SDK

JuiceFS 使用 Hadoop Java SDK 与 Hadoop 生态结合。

进阶主题

请查阅 JuiceFS 文档中心 了解更多信息。

POSIX 兼容性测试

JuiceFS 通过了 pjdfstest 最新版所有 8813 项兼容性测试。

All tests successful.

Test Summary Report
-------------------
/root/soft/pjdfstest/tests/chown/00.t          (Wstat: 0 Tests: 1323 Failed: 0)
  TODO passed:   693, 697, 708-709, 714-715, 729, 733
Files=235, Tests=8813, 233 wallclock secs ( 2.77 usr  0.38 sys +  2.57 cusr  3.93 csys =  9.65 CPU)
Result: PASS

除了 pjdfstest 覆盖的那些 POSIX 特性外,JuiceFS 还支持:

  • 关闭再打开(close-to-open)一致性。一旦一个文件写入完成并关闭,之后的打开和读操作保证可以访问之前写入的数据。如果是在同一个挂载点,所有写入的数据都可以立即读。
  • 重命名以及所有其他元数据操作都是原子的,由 Redis 的事务机制保证。
  • 当文件被删除后,同一个挂载点上如果已经打开了,文件还可以继续访问。
  • 支持 mmap
  • 支持 fallocate 以及空洞
  • 支持扩展属性
  • 支持 BSD 锁(flock)
  • 支持 POSIX 记录锁(fcntl)

性能测试

基础性能测试

JuiceFS 提供一个性能测试的子命令来帮助你了解它在你的环境中的性能表现:

JuiceFS Bench

顺序读写性能

使用 fio 测试了 JuiceFS、EFSS3FS 的顺序读写性能,结果如下:

Sequential Read Write Benchmark

上图显示 JuiceFS 可以比其他两者提供 10 倍以上的吞吐,详细结果请看这里

元数据性能

使用 mdtest 测试了 JuiceFS、EFSS3FS 的元数据性能,结果如下:

Metadata Benchmark

上图显示 JuiceFS 的元数据性能显著优于其他两个,详细的测试报告请看这里

性能分析

如遇性能问题,查看「实时性能监控」

支持的对象存储

  • 亚马逊 S3
  • 谷歌云存储
  • 微软云存储
  • 阿里云 OSS
  • 腾讯云 COS
  • 青云 QingStor 对象存储
  • Ceph RGW
  • MinIO
  • 本地目录
  • Redis
  • ……

JuiceFS 支持几乎所有主流的对象存储服务,查看详情

谁在使用

JuiceFS 已经可以用于生产环境,目前有几千个节点在生产环境中使用它。我们收集汇总了一份使用者名单,记录在这里。另外 JuiceFS 还有不少与其他开源项目进行集成的合作项目,我们将其记录在这里。如果你也在使用 JuiceFS,请随时告知我们,也欢迎你向大家分享具体的使用经验。

JuiceFS 的存储格式已经稳定,会被后续发布的所有版本支持。

产品路线图

  • 基于用户和组的配额
  • 快照
  • 一次写入多次读取(WORM)

反馈问题

我们使用 GitHub Issues 来管理社区反馈的问题,你也可以通过其他渠道跟社区联系。

贡献

感谢你对 JuiceFS 社区的贡献!请参考 JuiceFS 贡献指南 了解更多信息。

社区

欢迎加入 DiscussionsSlack 频道 跟我们的团队和其他社区成员交流。

使用量收集

JuiceFS 的客户端会收集 匿名 使用数据来帮助我们更好地了解大家如何使用它,它只上报诸如版本号等使用量数据,不包含任何用户信息,完整的代码在 这里

你也可以通过下面的方式禁用它:

juicefs mount --no-usage-report

开源协议

使用 Apache License 2.0 开源,详见 LICENSE

致谢

JuiceFS 的设计参考了 Google File SystemHDFS 以及 MooseFS,感谢他们的杰出工作。

FAQ

为什么不支持某个对象存储?

已经支持了绝大部分对象存储,参考这个列表。如果它跟 S3 兼容的话,也可以当成 S3 来使用。否则,请创建一个 issue 来增加支持。

是否可以使用 Redis 集群版作为元数据引擎?

可以。自 v1.0.0 Beta3 版本开始 JuiceFS 支持使用 Redis 集群版作为元数据引擎,不过需要注意的是 Redis 集群版要求一个事务中所有操作的 key 必须在同一个 hash slot 中,因此一个 JuiceFS 文件系统只能使用一个 hash slot。

请查看「Redis 最佳实践」了解更多信息。

JuiceFS 与 XXX 的区别是什么?

请查看「同类技术对比」文档了解更多信息。

更多 FAQ 请查看完整列表

历史加星

Stargazers over time

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

JuiceFS 是基于 Redis 和对象存储(例如 Amazon S3)构建的开源 POSIX 文件系统,针对云本机环境进行了设计和优化。 展开 收起
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Go
1
https://gitee.com/juicedata/JuiceFS.git
git@gitee.com:juicedata/JuiceFS.git
juicedata
JuiceFS
JuiceFS
main

搜索帮助