简体   繁体   中英

How to access file storage from web application on Amazon EC2

I am in process of hosting a dynamic website on Amazon EC2. I have created the environment and deployed war on ElasticStalkBean. I can connect to mysql database too. But I am not sure how my web application will read/write to the disk and at which path? As per my understanding, Amazon provides 3 options for file storage S3 EBS (Persistant) instance storage

I could upload files on s3 creaing bucket but how can my web application read or write to S3 bucket path on differnt server?

I am not sure how should i upload files or write file to EBS. Connecting to EC2, I cannot cd /dev/sd* directory for my EBS attached to my environment instance. How can I configure my web app to use this as directory for images etc

Instance storage is lost if I stop or recreate env. and is non persistant. So not interested to store files here.

Can you help me on this? Where to upload file that are read by application? Where can my application write files?

Your question: "how can my web application read or write to S3 bucket path on different server?

I'm a newbie user of AWS too, so can only offer limited help, but this is what I understand: The webapp running in the EC2 instance can access the S3 storage using with the REST or SOAP APIs. Here's the link to the reference guide for using the REST GET function to get a file from S3:

GET object documentation

I guess the idea is that the S3 storage bucket that Amazon create for your EBS "environments" provides permanent storage for your application and data files (images etc.). When a EC2 instance is created or rebooted, it should get any additional application files from an S3 bucket and 'cache' them on the file system ("volume") attached to the EC2 "instance".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM