mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-09 14:34:43 +00:00
parent
61a307f28d
commit
d680b94eb7
@ -164,7 +164,7 @@ The following settings are supported:
|
||||
* `bucket`: The name of the bucket to be used for snapshots. (Mandatory)
|
||||
* `region`: The region where bucket is located. Defaults to US Standard
|
||||
* `endpoint`: The endpoint to the S3 API. Defaults to AWS's default S3 endpoint. Note that setting a region overrides the endpoint setting.
|
||||
* `protocol`: The protocol to use (`http` or `https`). Defaults to `https`.
|
||||
* `protocol`: The protocol to use (`http` or `https`). Defaults to value of `cloud.aws.protocol` or `cloud.aws.s3.protocol`.
|
||||
* `base_path`: Specifies the path within bucket to repository data. Defaults to root directory.
|
||||
* `access_key`: The access key to use for authentication. Defaults to value of `cloud.aws.access_key`.
|
||||
* `secret_key`: The secret key to use for authentication. Defaults to value of `cloud.aws.secret_key`.
|
||||
@ -266,8 +266,10 @@ The bucket needs to exist to register a repository for snapshots. If you did not
|
||||
|
||||
### Using other S3 endpoint
|
||||
|
||||
If you are using any S3 api compatible service, you can set the endpoint you want to use by setting `cloud.aws.s3.endpoint`
|
||||
to your URL provider.
|
||||
If you are using any S3 api compatible service, you can set a global endpoint by setting `cloud.aws.s3.endpoint`
|
||||
to your URL provider. Note that this setting will be used for all S3 repositories.
|
||||
|
||||
Different `endpoint`, `region` and `protocol` settings can be set on a per-repository basis (see [S3 Repository](#s3-repository) section for detail).
|
||||
|
||||
|
||||
## Testing
|
||||
|
@ -60,7 +60,7 @@ public class InternalAwsS3Service extends AbstractLifecycleComponent<AwsS3Servic
|
||||
String account = componentSettings.get("access_key", settings.get("cloud.account"));
|
||||
String key = componentSettings.get("secret_key", settings.get("cloud.key"));
|
||||
|
||||
return getClient(endpoint, "https", account, key, null);
|
||||
return getClient(endpoint, null, account, key, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -94,7 +94,8 @@ public class InternalAwsS3Service extends AbstractLifecycleComponent<AwsS3Servic
|
||||
|
||||
ClientConfiguration clientConfiguration = new ClientConfiguration();
|
||||
if (protocol == null) {
|
||||
protocol = "https";
|
||||
protocol = componentSettings.get("protocol", "https").toLowerCase();
|
||||
protocol = componentSettings.get("s3.protocol", protocol).toLowerCase();
|
||||
}
|
||||
|
||||
if ("http".equals(protocol)) {
|
||||
|
@ -80,9 +80,7 @@ public class S3Repository extends BlobStoreRepository {
|
||||
}
|
||||
|
||||
String endpoint = repositorySettings.settings().get("endpoint", componentSettings.get("endpoint"));
|
||||
String protocol = componentSettings.get("protocol", "https").toLowerCase();
|
||||
protocol = componentSettings.get("s3.protocol", protocol).toLowerCase();
|
||||
protocol = repositorySettings.settings().get("protocol", protocol);
|
||||
String protocol = repositorySettings.settings().get("protocol", componentSettings.get("protocol"));
|
||||
|
||||
String region = repositorySettings.settings().get("region", componentSettings.get("region"));
|
||||
if (region == null) {
|
||||
|
@ -287,10 +287,11 @@ abstract public class AbstractS3SnapshotRestoreTest extends AbstractAwsTest {
|
||||
logger.info("--> creating s3 repostoriy with endpoint [{}], bucket[{}] and path [{}]", bucketSettings.get("endpoint"), bucketSettings.get("bucket"), basePath);
|
||||
PutRepositoryResponse putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo")
|
||||
.setType("s3").setSettings(ImmutableSettings.settingsBuilder()
|
||||
.put("protocol", bucketSettings.get("protocol"))
|
||||
.put("bucket", bucketSettings.get("bucket"))
|
||||
.put("endpoint", bucketSettings.get("endpoint"))
|
||||
.put("access_key", bucketSettings.get("access_key"))
|
||||
.put("secret_key", bucketSettings.get("secret_key"))
|
||||
.put("base_path", basePath)
|
||||
).get();
|
||||
assertThat(putRepositoryResponse.isAcknowledged(), equalTo(true));
|
||||
assertRepositoryIsOperational(client, "test-repo");
|
||||
@ -445,7 +446,8 @@ abstract public class AbstractS3SnapshotRestoreTest extends AbstractAwsTest {
|
||||
Settings[] buckets = {
|
||||
settings.getByPrefix("repositories.s3."),
|
||||
settings.getByPrefix("repositories.s3.private-bucket."),
|
||||
settings.getByPrefix("repositories.s3.remote-bucket.")
|
||||
settings.getByPrefix("repositories.s3.remote-bucket."),
|
||||
settings.getByPrefix("repositories.s3.external-bucket.")
|
||||
};
|
||||
for (Settings bucket : buckets) {
|
||||
String endpoint = bucket.get("endpoint", settings.get("repositories.s3.endpoint"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user