2016-08-23 33 views
0

Amazon S3で初めてです。単純なJavaメソッドを使用してAmazon S3からファイルにアクセスしようとすると、次のエラーが発生します。Amazon S3ファイルの読み取りタイムアウト。 Javaを使用してファイルをダウンロードしようとしています

2016-08-23 09:46:48 INFO request:450 - Received successful response:200, AWS Request ID: F5EA01DB74D0D0F5 
Caught an AmazonClientException, which means the client encountered an 
internal error while trying to communicate with S3, such as not being 
able to access the network. 
Error Message: Unable to store object contents to disk: Read timed out 

正確なコード行が昨日働いていました。私は12GBで5GBファイルの100%をダウンロードできました。今日私はより良い接続環境ですが、ファイルの2%または3%しかダウンロードされず、プログラムが失敗します。

ダウンロードに使用しているコード。

s3Client.getObject(new GetObjectRequest("mybucket", file.getKey()), localFile); 

答えて

0

クライアントの設定で接続タイムアウトとソケットタイムアウトを設定する必要があります。ここで

Click here for a reference article

Here is an excerpt from the article: 

Several HTTP transport options can be configured through the com.amazonaws.ClientConfiguration object. Default values will suffice for the majority of users, but users who want more control can configure: 
Socket timeout 
Connection timeout 
Maximum retry attempts for retry-able errors 
Maximum open HTTP connections 

それを行う方法についての例です。

Downloading files >3Gb from S3 fails with "SocketTimeoutException: Read timed out"

関連する問題