2017-04-23 15 views
0

我想在我的服务器testmbr1.kabuter.com:8081配置pithos.io:无法配置和运行pithos.io使用AWS的Java SDK

这里是我开始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: [email protected] 
     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]失败:连接通过添加mybucket1.testmbr1 CNAME记录指向testmbr1.kabuter.com超时

这是固定的。

2)试图createBucket: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似乎有限的文档。

任何指针?

回答

0

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

http://testmbr1.kabuter.com:8081 

我必须定义服务器的URI pithos.yaml与端口,以及:

server-uri : testmbr1.kabuter.com:8081