S3Fs installation
FUSE-based file system backed by Amazon S3. Mount a s3 bucket as a local file system to read/write. Since the bucket is mounted as a local file system, the write/read operation is faster than when we read the file from s3 bucket directly.
Install Dependencies:
yum install gcc libstdc++-devel gcc-c++ curl-devel libxml2-devel openssl-devel mailcap util-linux
Download fuse:
wget http://sourceforge.net/projects/fuse/files/fuse-2.X/2.9.4/fuse-2.9.4.tar.gz
Extract and install it:
cd fuse-2.9.4
./configure --prefix=/usr/local
make
make install
Add to loadable module:
ldconfig
modprobe fuse
Download s3fs:
wget https://s3fs.googlecode.com/files/s3fs-1.74.tar.gz
Extract and install it:
tar -xzf s3fs-1.74.tar.gz
cd s3fs-1.74
./configure --prefix=/usr/local
make
make install
Export the access key and secret key:
echo AccessKey:Secretkey > ~/.passwd-s3fs
Install fuse:
yum install libfuse,fuse-libs
Mount the bucket to a local directory.
s3fs -o allow_other -o use_cache=/tmp/cache/ bucket-name /mnt/
where,
/tmp/cache – local cache directory.
bucket-name – S3 bucket Name
/mnt – Local Mount point
Add a permanent entry in /etc/fstab
s3fs#bucket-name /cfmnt fuse allow_other,use_cache=/tmp/cache 0 0