2016-12-28 65 views
0
AmazonEC2Client ec2Client = AWSEC2Client.getAWSEC2Client(set basicCredentials :: accesskey and secreate key); 
       ec2Client.setRegion(set regions); 
final ClientConfiguration clientConfiguration = new ClientConfiguration() 
      .withConnectionTimeout(150000).withMaxConnections(200) 
      .withRetryPolicy(new RetryPolicy(null, null, 3, true)); 

同時呼籲ec2Client.describeNetworkAcls();得到以下異常:無法執行HTTP請求:ec2.cn-north-1.amazonaws.com.cn未能響應

org.apache.http.NoHttpResponseException: ec2.cn-north-1.amazonaws.com.cn未能回覆 org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:143) 〜[httpclient-4.3.6.jar:4.3 0.6]在 org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:57) 〜[httpc lient-4.3.6.jar:4.3.6]在 org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:260) 〜[的HttpCore-4.3.3.jar:4.3.3]在 org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:283) 〜[的HttpCore-4.3.3.jar:4.3.3]在 org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(默認客戶端連接.java:251) 〜[httpclient-4.3.6.jar:4.3.6] 6.jar:4.3.6]在 org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:271) 〜[的HttpCore-4.3。 3.jar:4.3.3]在 com.amazonaws.http.protocol.SdkHttpRequestExecutor.doReceiveResponse(SdkHttpRequestExecutor.java:82) 〜[AWS-java的SDK-芯1.10.54.jar:NA]在 有機.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123) 〜[httpcore-4.3.3.jar:4.3.3] at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector。的java:685) 〜[HttpClient的-4.3.6.jar:4.3.6]在 org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:487) 〜[HttpClient的-4.3.6。罐子:4.3.6]在 org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863) 〜[HttpClient的-4.3.6.jar:4.3.6]在 有機.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82) 〜[HttpClient的-4.3.6.jar:4.3.6]在 org.apache.http.impl.client.CloseableHttpClient.execute( CloseableHttpClient.java:57) 〜[HttpClient的-4.3.6.jar:4.3.6]在 com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:860) [AWS-java的SDK-核 - 1.10 .54.jar:在 com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:631) [AWS-java的SDK-芯1.10.54.jar NA]:NA]在 com.amazonaws.http .AmazonHttpClient.doExecute(AmazonHttpClient.java:400) [AWS-java的SDK-芯1.10.54.jar:NA]在 com.amazonaws.http.AmazonHttpClient.executeWithTimer(AmazonHttpClient.java:362) [aws-java-sdk-core-1.10.54.jar:na] at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:311) [aws-java-sdk-core-1.10.54。 jar:na] at com.amazonaws.services.ec2.AmazonEC2Client.invoke(AmazonEC2Client.java:11095) [aws-java-sdk-ec2-1.10.54.jar:na] at com.amazonaws.services。 ec2.AmazonEC2Client.describeNetworkAcls(AmazonEC2Client.java:5644) [aws-java-sdk-ec2-1.10.54.jar:na] at com.amazonaws.services.ec2.AmazonEC2Client.describeNetworkAcls(AmazonEC2Client.java:5656) [AWS-java的SDK-ec2-1.10.54。罐子:NA]

請指導我是新來的AWS

提前

謝謝!

回答

1

Beijing Region需要單獨憑據 - 未連接到其他區域。

誰願意使用新的北京地區客戶需要簽署 了單獨的一套獨特的中國 (北京)地區帳戶憑據。擁有現有AWS證書的客戶將不能使用 訪問新區域中的資源,反之亦然。

+1

此外,如果您承載任何類型的內容,您將需要ICP許可證。玩的開心 :) – EdH