[转帖]s3fs

s3fs · 浏览次数 : 0

小编点评

Sure, here is the summary you requested: **s3fs** is a utility for mounting S3 buckets in Linux, macOS, and FreeBSD. It allows you to operate files and directories in the S3 bucket like a local file system. * Supports a subset of POSIX operations, including reading and writing files, directories, symlinks, mode, uid/gid, and extended attributes. * Compatible with Amazon S3 and other S3-based object stores. * Supports random writes and appends via multi-part upload and server-side encryption. * Has its own object format, which can be used with other tools like AWS CLI. * Requires manual configuration of the password file location. **Installation:** * Pre-built packages are available for various platforms, including Amazon Linux, Ubuntu, and macOS. * Manual installation requires compiling from source or using Homebrew. **Usage:** * Mount a bucket using the `s3fs` command. * Specify the bucket name and directory path. * Use a password file to specify the credentials. * Mount the bucket on a specific path. **Limitations:** * Performance may be slower compared to a local file system. * Random writes and appends may require rewriting the entire object, which can be slow for large files. * Not all POSIX features are supported.

正文

https://github.com/s3fs-fuse/s3fs-fuse

 

s3fs allows Linux, macOS, and FreeBSD to mount an S3 bucket via FUSE(Filesystem in Userspace).
s3fs makes you operate files and directories in S3 bucket like a local file system.
s3fs preserves the native object format for files, allowing use of other tools like AWS CLI.

s3fs-fuse CI Twitter Follow

Features

  • large subset of POSIX including reading/writing files, directories, symlinks, mode, uid/gid, and extended attributes
  • compatible with Amazon S3, and other S3-based object stores
  • allows random writes and appends
  • large files via multi-part upload
  • renames via server-side copy
  • optional server-side encryption
  • data integrity via MD5 hashes
  • in-memory metadata caching
  • local disk data caching
  • user-specified regions, including Amazon GovCloud
  • authenticate via v2 or v4 signatures

Installation

Many systems provide pre-built packages:

  • Amazon Linux via EPEL:

    sudo amazon-linux-extras install epel
    sudo yum install s3fs-fuse
    
  • Arch Linux:

    sudo pacman -S s3fs-fuse
    
  • Debian 9 and Ubuntu 16.04 or newer:

    sudo apt install s3fs
    
  • Fedora 27 or newer:

    sudo dnf install s3fs-fuse
    
  • Gentoo:

    sudo emerge net-fs/s3fs
    
  • RHEL and CentOS 7 or newer via EPEL:

    sudo yum install epel-release
    sudo yum install s3fs-fuse
    
  • SUSE 12 and openSUSE 42.1 or newer:

    sudo zypper install s3fs
    
  • macOS 10.12 and newer via Homebrew:

    brew install --cask macfuse
    brew install gromgit/fuse/s3fs-mac
    
  • FreeBSD:

    pkg install fusefs-s3fs
    
  • Windows:

    Windows has its own install, seening in this link

Otherwise consult the compilation instructions.

Examples

s3fs supports the standard AWS credentials file stored in ${HOME}/.aws/credentials. Alternatively, s3fs supports a custom passwd file.

The default location for the s3fs password file can be created:

  • using a .passwd-s3fs file in the users home directory (i.e. ${HOME}/.passwd-s3fs)
  • using the system-wide /etc/passwd-s3fs file

Enter your credentials in a file ${HOME}/.passwd-s3fs and set owner-only permissions:

echo ACCESS_KEY_ID:SECRET_ACCESS_KEY > ${HOME}/.passwd-s3fs
chmod 600 ${HOME}/.passwd-s3fs

Run s3fs with an existing bucket mybucket and directory /path/to/mountpoint:

s3fs mybucket /path/to/mountpoint -o passwd_file=${HOME}/.passwd-s3fs

If you encounter any errors, enable debug output:

s3fs mybucket /path/to/mountpoint -o passwd_file=${HOME}/.passwd-s3fs -o dbglevel=info -f -o curldbg

You can also mount on boot by entering the following line to /etc/fstab:

mybucket /path/to/mountpoint fuse.s3fs _netdev,allow_other 0 0

If you use s3fs with a non-Amazon S3 implementation, specify the URL and path-style requests:

s3fs mybucket /path/to/mountpoint -o passwd_file=${HOME}/.passwd-s3fs -o url=https://url.to.s3/ -o use_path_request_style

or(fstab)

mybucket /path/to/mountpoint fuse.s3fs _netdev,allow_other,use_path_request_style,url=https://url.to.s3/ 0 0

Note: You may also want to create the global credential file first

echo ACCESS_KEY_ID:SECRET_ACCESS_KEY > /etc/passwd-s3fs
chmod 600 /etc/passwd-s3fs

Note2: You may also need to make sure netfs service is start on boot

Limitations

Generally S3 cannot offer the same performance or semantics as a local file system. More specifically:

  • random writes or appends to files require rewriting the entire object, optimized with multi-part upload copy
  • metadata operations such as listing directories have poor performance due to network latency
  • non-AWS providers may have eventual consistency so reads can temporarily yield stale data (AWS offers read-after-write consistency since Dec 2020)
  • no atomic renames of files or directories
  • no coordination between multiple clients mounting the same bucket
  • no hard links
  • inotify detects only local modifications, not external ones by other clients or tools

References

  • CSI for S3 - Kubernetes CSI driver
  • docker-s3fs-client - Docker image containing s3fs
  • goofys - similar to s3fs but has better performance and less POSIX compatibility
  • s3backer - mount an S3 bucket as a single file
  • S3Proxy - combine with s3fs to mount Backblaze B2, EMC Atmos, Microsoft Azure, and OpenStack Swift buckets
  • s3ql - similar to s3fs but uses its own object format
  • YAS3FS - similar to s3fs but uses SNS to allow multiple clients to mount a bucket

Frequently Asked Questions

License

Copyright (C) 2010 Randy Rizun rrizun@gmail.com

Licensed under the GNU GPL version 2

与[转帖]s3fs相似的内容:

[转帖]s3fs

https://github.com/s3fs-fuse/s3fs-fuse s3fs allows Linux, macOS, and FreeBSD to mount an S3 bucket via FUSE(Filesystem in Userspace).s3fs makes you op

[转帖]s3fs把 s3-like 对象存储挂载到本地

https://www.cnblogs.com/hiyang/p/12631908.html s3fs-fuse 是一个采用 c++🚀 开发的开源应用,它的作用是可以将 AWS S3 以及兼容 S3 API 的第三方对象存储像普通文件系统一样挂载到本地计算机,由于这种功能通过 FUSE 实现,因此

[转帖]s3fs - 使用S3FS存储桶目录允许其他用户使用权限

https://www.coder.work/article/6661505 我在使用S3FS时遇到问题。我正在使用 ubuntu@ip-x-x-x-x:~$ /usr/bin/s3fs --version Amazon Simple Storage Service File System 1.71

[转帖]S3FS 简介及部署

PS:文章一般都会先首发于我的个人Blog上:S3FS 简介及部署 · TonghuaRoot's BloG. ,有需要的小伙伴可以直接订阅我的Blog,获取最新内容。 0x00 前言 S3FS可以把S3 Bucket可以向挂盘一样,挂在本地,适用于Linux和Mac OS,完事复制粘贴写文件啥的跟

[转帖]s3fs把 s3-like 对象存储挂载到本地

s3fs把 s3-like 对象存储挂载到本地 s3fs把 s3-like 对象存储挂载到本地 s3fs-fuse 是一个采用 c++🚀 开发的开源应用,它的作用是可以将 AWS S3 以及兼容 S3 API 的第三方对象存储像普通文件系统一样挂载到本地计算机,由于这种功能通过 FUSE 实现,因

[转帖]使用S3F3在Linux实例上挂载Bucket

https://docs.jdcloud.com/cn/object-storage-service/s3fs S3F3是基于FUSE的文件系统,允许Linux 挂载Bucket在本地文件系统,S3fs能够保持对象原来的格式。使用S3F3可以把Bucket当成一个文件夹挂载到Linux系统内部,当成

[转帖]s3对象存储挂载到本地文件夹

https://www.zhangzhuo.ltd/articles/2021/10/22/1634888049032.html 一、s3fs工具 s3fs-fuse 是一个采用 c++ 开发的开源应用,它的作用是可以将 AWS S3 以及兼容 S3 API 的第三方对象存储像普通文件系统一样挂载到

[转帖][minio]挂载minio到本地

https://www.cnblogs.com/XY-Heruo/p/16489190.html 前言 将minio的bucket挂载到本地文件系统 环境 客户端系统版本:centos 7 MinIO节点IP:192.168.0.20 s3fs方式步骤 安装s3fs客户端(可能需要先安装epel-r

[转帖]

Linux ubuntu20.04 网络配置(图文教程) 因为我是刚装好的最小系统,所以很多东西都没有,在开始配置之前需要做下准备 环境准备 系统:ubuntu20.04网卡:双网卡 网卡一:供连接互联网使用网卡二:供连接内网使用(看情况,如果一张网卡足够,没必要做第二张网卡) 工具: net-to

[转帖]

https://cloud.tencent.com/developer/article/2168105?areaSource=104001.13&traceId=zcVNsKTUApF9rNJSkcCbB 前言 Redis作为高性能的内存数据库,在大数据量的情况下也会遇到性能瓶颈,日常开发中只有时刻