S3FS is a FUSE-based utility that lets you mount your AWS S3 bucket like it's a filesystem. It handles all the abstractions of making API calls and puts/gets of files to the object store. It supports a number of features such as multistore upload, AWS S3 SSE (S3 server-side encryption using KMS and Customer Keys), setting object lifecycle to Reduced Redundancy Storage, and parallel uploads/downloads.

S3FS is a comparable product to AWS File/Storage Gateway as it does not require running any local AWS-provided VMs for the sake of sharing S3 files across NFS in your environment. This guide goes over how to install and configure S3FS on FreeBSD.

Update as of 2018-05-16: Honestly after some time working with AWS Storage Gateway, I highly suggest migrating to it if you require S3 buckets exposed as NFS file shares. It's far easier to manage, mantain, and automate. Yes, you will need to spin up an m4.large or higher instance, but you will have a more robust product with more features out of the box. This is not meant to discourage you - S3FS has been developed by some talented folks, but in all honest opinion I feel more comfortable with Storage Gateway in a production environment.
Note: Honestly speaking, the FreeBSD port should be updated. Port version is 1.78 (and that's from 2014) and current S3FS release on Github is 1.82. This version has been released in May 2017. Newest github version isn't compiling because missing xattr dependencies. I haven't had much time to look into this but once I figure it out, I'll post an update.

Start by installing S3FS package on FreeBSD:

cd /usr/ports/sysutils/fuse-s3fs
sudo make install clean

Create a credentials file:

touch ~/.aws/passwd
echo ${AWS_ACCESS_KEY_ID}:${AWS_SECRET_ACCESS_KEY} > ~/.aws/passwd

Load the Fuse subsystem libraries:

sudo kldload fuse.ko

Mount the S3FS filesystem:

mkdir s3
sudo s3fs ${S3-bucket} s3 -o passwd_file=~/.aws/passwd -ouse_cache=/tmp

Unmount the S3FS filesystem by running umount:

sudo umount s3

References:


Comments

comments powered by Disqus