Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Wednesday, 27 January 2016

How to Attach & Mount S3 Bucket on CentOS/RHEL & Ubuntu using S3FS

Install S3 Bucket


Q. What Is Amazon S3?

-- Amazon Simple Storage Service is storage for the Internet. It is designed to make web-scale computing easier for developers. Amazon S3 has a simple web services interface that you can use to store and retrieve any amount of data, at any time, from anywhere on the web.


Step: 1. Install Required Packages :

For CentOS/RHEL Users:

# yum -y install gcc libstdc++-devel gcc-c++ curl-devel libxml2-devel openssl-devel mailcap

For Ubuntu Users:

# apt-get -y install build-essential libcurl4-openssl-dev libxml2-dev mime-support

Step: 2. Install Latest Fuse :

For CentOS/RHEL Users:

# yum -y install fuse fuse-devel

For Ubuntu Users:

# apt-get -y install fuse fuse-utils

Step: 3. Download and Compile Latest S3FS :

# cd /usr/src/
# wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/s3fs/s3fs-1.74.tar.gz
# tar xzf s3fs-1.74.tar.gz
# cd s3fs-1.74
# ./configure --prefix=/usr/local
# make && make install

Step: 4. Make a File in /etc/passwd-s3fs & Put the Bucket_name, Access Key & Secret Key :

# vi /etc/passwd-s3fs

bucket_name:Aws_Access_Key:Aws_Secret_Key

-- Save & Quit (:wq)

Step: 5. Give Permission :

# chmod 640 /etc/passwd-s3fs

Step: 6. To Mount the S3 :

# mkdir /s3backups
# chmod -Rf 755 /s3backups
# /usr/local/bin/s3fs bucket_name /s3backups -ouse_cache=/tmp -o use_rrs=1

Step: 7. For Permanently Mount s3 :

# vi /etc/fstab

s3fs#bucket_name /s3backups fuse _netdev,use_cache=/tmp,use_rrs=1,allow_other 0 0

-- Save & Quit (:wq)

Step: 8. Unmount s3 :

# fusermount -u /s3backups

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog


5 comments:

  1. yes this is good one but how can i get access key and secret key..?

    ReplyDelete
    Replies
    1. well, For that, you have to need an AWS Account. Ok, In my next tutorial, I'll show you how to get aws access key & secret key.

      Delete
  2. ok thanx ...m waiting :) thanx for reply

    ReplyDelete
  3. Hi,
    how to pass the command to mount S3 bucket, if we are using IAM role for the instance. Access S3 without accesskey and secret access key using only IAM role with full access to S3.
    /usr/local/bin/s3fs bucketname /s3bucket -ouse_cache=/tmp -o use_rrs=1

    ReplyDelete
    Replies
    1. follow the below link:
      http://sdbakoushik.blogspot.in/2017/10/mount-s3-bucket-using-iam-role_15.html

      I hope this will be helpful for you.

      Delete

Copyright © 2016 Kousik Chatterjee's Blog