Re: Not able to access radosgw S3 bucket creation with AWS java SDK. Caused by: java.net.UnknownHostException: issue.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Chris,

Thanks for the info. Code worked for me with pathstyleaccess with out DNS
issues.

BasicAWSCredentials awsCreds = new
BasicAWSCredentials("uiuiusidusiyd898798798",
"HJHGGyugyuyudfyGJHGYGIYIGU");

AmazonS3ClientBuilder s3b = AmazonS3ClientBuilder.standard();
s3b.setEndpointConfiguration(new EndpointConfiguration("http://<End point
hostname>:80", "us-east"));
s3b.enablePathStyleAccess();
s3b.withCredentials(new AWSStaticCredentialsProvider(awsCreds));

AmazonS3 connection = s3b.build();




On Wed, Jul 29, 2020 at 1:36 PM sathvik vutukuri <7vik.sathvik@xxxxxxxxx>
wrote:

> Thanks, I'll check it out.
>
> On Wed, 29 Jul 2020, 13:35 Chris Palmer, <chris@xxxxxxxxxxxxxxxxxxxxx>
> wrote:
>
>> This works for me (the code switches between AWS and RGW according to
>> whether s3Endpoint is set). You need the pathStyleAccess unless you have
>> wildcard DNS names etc.
>>
>>             String s3Endpoint = "http://my.host:80"; <http://my.host:80>;
>>
>>             AmazonS3ClientBuilder s3b = AmazonS3ClientBuilder.standard ();
>>
>>             if (s3Endpoint == null) {
>>
>>                 s3b.setRegion (s3Region);
>>
>>             } else {
>>
>>                 s3b.setEndpointConfiguration (new EndpointConfiguration (s3Endpoint, s3Region));
>>
>>                 s3b.enablePathStyleAccess ();
>>
>>             }
>>
>>             if (s3Profile != null) s3b.setCredentials (new ProfileCredentialsProvider (s3Profile));
>>
>>             AmazonS3 s3 = s3b.build ();
>>
>>
>>
>> On 29/07/2020 08:19, sathvik vutukuri wrote:
>>
>> Hi All,
>>
>> Any update in this from any one?
>>
>> On Tue, Jul 28, 2020 at 4:00 PM sathvik vutukuri <7vik.sathvik@xxxxxxxxx> <7vik.sathvik@xxxxxxxxx>
>> wrote:
>>
>>
>> Hi All,
>>
>> radosgw-admin is configured in ceph-deploy, created a few buckets from the
>> Ceph dashboard, but when accessing through Java AWS S3 code to create a new
>> bucket i am facing the below issue..
>>
>> Exception in thread "main" com.amazonaws.SdkClientException: Unable to
>> execute HTTP request: firstbucket.rgwhost
>> at
>> com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleRetryableException(AmazonHttpClient.java:1207)
>> at
>> com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1153)
>> at
>> com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:802)
>> at
>> com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:770)
>> at
>> com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:744)
>> at
>> com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:704)
>> at
>> com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:686)
>> at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:550)
>> at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:530)
>> at
>> com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:5062)
>> at
>> com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:5008)
>> at
>> com.amazonaws.services.s3.AmazonS3Client.access$300(AmazonS3Client.java:394)
>> at
>> com.amazonaws.services.s3.AmazonS3Client$PutObjectStrategy.invokeServiceCall(AmazonS3Client.java:5950)
>> at
>> com.amazonaws.services.s3.AmazonS3Client.uploadObject(AmazonS3Client.java:1812)
>> at
>> com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1772)
>> at
>> com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1710)
>> at org.S3.App.main(App.java:71)
>> Caused by: java.net.UnknownHostException: firstbucket.rgwhost
>> at java.net.InetAddress.getAllByName0(InetAddress.java:1281)
>> at java.net.InetAddress.getAllByName(InetAddress.java:1193)
>> at java.net.InetAddress.getAllByName(InetAddress.java:1127)
>> at
>> com.amazonaws.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:27)
>> at
>> com.amazonaws.http.DelegatingDnsResolver.resolve(DelegatingDnsResolver.java:38)
>> at
>> org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:112)
>> at
>> org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:374)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> at java.lang.reflect.Method.invoke(Method.java:498)
>> at
>> com.amazonaws.http.conn.ClientConnectionManagerFactory$Handler.invoke(ClientConnectionManagerFactory.java:76)
>> at com.amazonaws.http.conn.$Proxy3.connect(Unknown Source)
>> at
>> org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
>> at
>> org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
>> at
>> org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
>> at
>> org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
>> at
>> org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
>> at
>> org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
>> at
>> com.amazonaws.http.apache.client.impl.SdkHttpClient.execute(SdkHttpClient.java:72)
>> at
>> com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1330)
>> at
>> com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1145)
>> ... 15 more
>>
>>
>>
>>
>>
>>
>> --
>> Thanks,
>> Vutukuri Sathvik,
>> 8197748291.
>>
>>
>>
>>

-- 
Thanks,
Vutukuri Sathvik,
8197748291.
_______________________________________________
ceph-users mailing list -- ceph-users@xxxxxxx
To unsubscribe send an email to ceph-users-leave@xxxxxxx



[Index of Archives]     [Information on CEPH]     [Linux Filesystem Development]     [Ceph Development]     [Ceph Large]     [Ceph Dev]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [xfs]


  Powered by Linux