简体   繁体   中英

Writing from EC2 to S3

I have a Java program that runs on Amazon EC2. I wanted the program to write it to S3. I wasnt able to find instructions on how to write to S3 from Amazon EC2. What is the approach I shoulduse ?

Are you already using the AWS SDK for Java? If not you should download it. It doesn't matter whether you're writing to S3 from EC2 or from your laptop, you can write to it from Java easily enough using the SDK.

See the TransferManager class.

  1. Mount the S3 volume on your EC2 host.
  2. Use the standard Java io methods to write to the mount point.

You can mount a S3 bucket as a partition and work with S3 files as they where located on your server's HDD.

I'm the lead developer and maintainer of Open source project RioFS project : an userspace filesystem to mount Amazon S3 buckets. You can use our project to mount and operate with files using Java or any other programming language.

Hope it helps !

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