2
votes

I created S3 bucket and mounted with ec2. When I upload a file to S3 bucket, that file is copied to ec2 mounted folder automatically. I wanted the file to be uploaded to S3 bucket only. As it copies to EC2 folder, it becomes redundant and doesn't fulfill our requirements. I installed S3fs and executed the following commands:

sudo s3fs my-s3-bucket /var/www/html/vqmod/xml/ -o passwd_file=/home/ubuntu/.passwd-s3fs,nonempty,retries=5,gid=33,uid=33,allow_other,url=https://s3.amazonaws.com,umask=0000

Am I doing any permission mistake? Thanks.

Comments:

John Rotenstein: "Why do you wish to mount the bucket on the EC2 instance? Amazon S3 is an object storage system and is not designed to be "mounted". While there are utilities that can do this (eg s3fs), it is not a recommended way to use Amazon S3."

I answered, "My client wants his eCommerce site's cache files to be generated in S3 storage. For this reason, cache folder of eCommerce site should be mounted the bucket."

John Rotenstein: "It will result in exactly the behaviour you describe."

Is there any alternative way to accomplish this requirement?

1
Why do you wish to mount the bucket on the EC2 instance? Amazon S3 is an object storage system and is not designed to be "mounted". While there are utilities that can do this (eg s3fs), it is not a recommended way to use Amazon S3.John Rotenstein
My client wants his eCommerce site's cache files to be generated in S3 storage. For this reason, cache folder of eCommerce site should be mounted the bucket.Wasim
Why do they want that? It will result in exactly the behaviour you describe.John Rotenstein
Is it possible without mounting?Wasim
Are you sure the files are duplicated? Mountfing s3fs the files are visible as local, but actually residing in s3. That is what did you want to achieve, isn't it not?gusto2

1 Answers

1
votes

File uploaded to s3 bucket are only visible in your s3fs mount path. it does not take space on you fileSystem, when you open file then it downloads the content. so in your case though they are visible on mounted path there are not on your system.