无法使用 AWS Java SDK 配置和 运行 pithos.io

Unable to configure and run pithos.io using AWS Java SDK

我正在尝试在我的服务器上配置 pithos.io testmbr1.kabuter.com:8081:

我是这样开始的 pithos.io:

java -jar pithos-0.7.5-standalone.jar -f pithos.yaml

我的pithos.yaml:

service:
  host: "0.0.0.0"
  port: 8081
logging:
  level: info
  console: true
  overrides:
    io.pithos: debug
options:
  service-uri: testmbr1.kabuter.com
  default-region: myregion
keystore:
  keys:
    AKIAIOSFODNN7EXAMPLE:
      master: true
      tenant: test@example.com
      secret: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'
bucketstore:
  default-region: myregion
  cluster: "45.33.37.148"
  keyspace: storage
regions:
  myregion:
    metastore:
      cluster: "45.33.37.148"
      keyspace: storage
    storage-classes:
      standard:
        cluster: "45.33.37.148"
        keyspace: storage
        max-chunk: "128k"
        max-block-chunk: 1024
cassandra:
   saved_caches_directory: "target/db/saved_caches"
   data_file_directories:
     - "target/db/data"
   commitlog_directory: "target/db/commitlog"

我正在使用 AWS Java SDK 进行连接。下面是我的 JUnit:

@Test
public void testPithosIO() {
try {
    ClientConfiguration config = new ClientConfiguration();
    config.setSignerOverride("S3SignerType");

    EndpointConfiguration endpointConfiguration = new EndpointConfiguration("http://testmbr1.kabuter.com:8081",
            "myregion");
    BasicAWSCredentials awsCreds = new BasicAWSCredentials("AKIAIOSFODNN7EXAMPLE",
            "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY");
    AmazonS3 s3Client = AmazonS3ClientBuilder.standard()
            .withRegion("myregion")
            .withClientConfiguration(config)
            .withCredentials(new AWSStaticCredentialsProvider(awsCreds))
            .withEndpointConfiguration(endpointConfiguration).build();
    s3Client.createBucket("mybucket1");
    System.out.println(s3Client.getRegionName());
    System.out.println(s3Client.listBuckets());
} catch (Exception e) {
    e.printStackTrace();
}
}

我的问题是 1) 我得到:com.amazonaws.SdkClientException:无法执行 HTTP 请求:连接到 mybucket1.testmbr1.kabuter.com:8081 [mybucket1.testmbr1.kabuter.com/198.105.254.130, mybucket1.testmbr1.kabuter.com/104.239.207.44] 失败:连接超时

This was fixed by adding mybucket1.testmbr1 CNAME record pointing to testmbr1.kabuter.com.

2) 在尝试创建桶时:s3Client.createBucket("mybucket1") 我得到:

com.amazonaws.services.s3.model.AmazonS3Exception: The request signature we calculated does not match the signature you provided. Check your key and signing method. (Service: Amazon S3; Status Code: 403; Error Code: SignatureDoesNotMatch; Request ID: d98b7908-d11e-458a-be27-254b136f344a), S3 Extended Request ID: d98b7908-d11e-458a-be27-254b136f344a

如何让它工作? pithos.io 文档似乎有限。

有什么指点吗?

由于我的端点使用的是非标准端口:

http://testmbr1.kabuter.com:8081

我还必须使用端口在 pithos.yaml 中定义服务器 uri:

server-uri : testmbr1.kabuter.com:8081