2017-04-23 76 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