JayD
JayD

Reputation: 986

specify more than one endpoint in java s3 api for ceph to connect to ceph cluster?

Hello every one i have just started to get my hands dirty with ceph object storage i.e. radosgateway and for this purpose have spun out a very basic single node ceph/daemon docker container which works perfectly fine for both s3cmd and java s3 API (the mgr dashboard don't work though container shuts down when issuing command ceph mgr module enable dashboard) but one thing i cant seem to figure out is how can we specify more than one endpoint for our java s3 client to connect to our cluster? does it have something to do with HTTP front-ends? please need some pointers or a sample example would be great.Following is my code to connect to a single node ceph cluster built using ceph/daemon image's docker container.

String accessKey = "demoKey";
String secretKey = "demoKey";
            try {

                ClientConfiguration clientConfig = new ClientConfiguration();
                clientConfig.setProtocol(Protocol.HTTP);
                System.setProperty(SDKGlobalConfiguration.DISABLE_CERT_CHECKING_SYSTEM_PROPERTY,"true");
                if (SDKGlobalConfiguration.isCertCheckingDisabled())
                {
                  System.out.println("Cert checking is disabled");
                }
            AWSCredentials credentials = new BasicAWSCredentials(accessKey, secretKey);
            AmazonS3 conn = new AmazonS3Client(credentials);
            conn.setEndpoint("http://ubuntu:8080"); //more than one endpoint ??
            List<Bucket> buckets = conn.listBuckets();
            for (Bucket bucket : buckets) {
                    System.out.println(bucket.getName() + "\t" +
                            StringUtils.fromDate(bucket.getCreationDate()));
            }
    }catch(Exception ex)
            {
                ex.printStackTrace();
            }

Finally my ceph version ceph version 14.2.4 nautilus (stable)

Upvotes: 2

Views: 925

Answers (1)

itsafire
itsafire

Reputation: 6103

The Ceph Object Gateway can have multiple instances. These are combined by some load balancer. You have one end point that is distributing the load onto the ceph object gateway instances. The load balancer itself can be scaled as well (i.e. round-robin DNS or whatnot).

I found a nice use case here. Maybe it helps. Have a look at the media storage architecture.

Upvotes: 2

Related Questions