Configuring a Cloud Repository in Amazon S3
You can configure the following types of cloud repositories:
Amazon S3
This section explains the steps to configure an Amazon S3 repository. To configure a repository, ensure that you have installed the Amazon S3 plugin in Elasticsearch.
To configure an Amazon S3 cloud repository
1. From the command prompt, go to SAGInstallDir/InternalDataStore/bin.
2. Run the following command to create Elasticsearch keystore:
Linux
./elasticsearch-keystore create
Windows
elasticsearch-keystore.bat create
3. Run the following command to add the Amazon S3 repository access key to your Elasticsearch keystore:
Linux
./elasticsearch-keystore add s3.client.default.access_key
Windows
elasticsearch-keystore.bat add s3.client.default.access_key
4. When prompted for the Amazon S3 repository access key, type the access key value and press Enter.
Enter value for s3.client.default.access_key: 123-test-123d-123
5. Run the following command to add the Amazon S3 repository secret key:
Linux
./elasticsearch-keystore add s3.client.default.secret_key
Windows
elasticsearch-keystore.bat add s3.client.default.secret_key
6. When prompted for the Amazon S3 repository secret key, type the secret key value and press Enter.
Enter value for s3.client.default.secret_key: tests1232sk12312t
Important:
You must restart Elasticsearch once you provide the secret key.
7. Go to SAGInstallDir/IntegrationServer/instances/instance_name/packages/WmAPIGateway/cli/bin/conf.
8. Open the gateway-s3-repo.cnf file and specify Amazon S3 values for the following fields:
type=s3
bucket=<s3-bucket-name>
region=<s3-region>
access_key=<s3-access-key>
secret_key=<s3-secret-key>
base_path=<s3-base-path>
For example,
type=s3
bucket=s3 bucket
region=ap-south-1
access_key=apikey
secret_key=secretKey
base_path=basepath/repo
Note:
The base_path value must not start or end with an slash (\).
9. Run the following command:
Linux
./apigatewayUtil.sh configure manageRepo -file file_path
Windows
apigatewayUtil.bat configure manageRepo -file file_path
For example,
./apigatewayUtil.sh configure manageRepo -file SAGInstallDir/IntegrationServer/instances/
instance_name/packages/WmAPIGateway/cli/bin/conf/gateway-s3-repo.cnf
Run the following command to configure the analytics data store repository:
Linux
./apigatewayUtil.sh configure manageRepo -analyticsDS true -repoName analyticsRepo
Windows
apigatewayUtil.bat configure manageRepo -analyticsDS true -repoName analyticsRepo
For example,
apigatewayUtil.bat configure manageRepo -analyticsDS true -repoName myrepo
This command creates a repository named myrepo to backup the analytics data store data.
You can specify the log file location and log level for the repository creation using the
logFileLocation and
logLevel parameters. For information on these parameters, see
Specifying Log File Details.
10. Restart API Data Store.
11. Optional. Run the following command to list the available list of repositories and verify whether the repository you created appears in the list:
Linux
./apigatewayUtil.sh list manageRepo
Windows
apigatewayUtil.bat list manageRepo
Run the following command to list the available list of analytics data store repositories and verify whether the repository you created appears in the list:Linux
./apigatewayUtil.sh list manageRepo -analyticsDS true
Windows
apigatewayUtil.bat list manageRepo -analyticsDS true
You can specify the log file location and log level for the repository listing using the
logFileLocation and
logLevel parameters. For information on these parameters, see
Specifying Log File Details.
12. Optional. Run the following command to delete analytics data store repository:
Linux
./apigatewayUtil.sh delete manageRepo -analyticsDS true -repoName analyticsRepo
Windows
apigatewayUtil.bat delete manageRepo -analyticsDS true -repoName analyticsRepo
For example,
apigatewayUtil.bat delete manageRepo -analyticsDS true -repoName myrepo
This command deletes the local repository named myrepo.
You can specify the log file location and log level for deleting the repository using the
logFileLocation and
logLevel parameters. For information on these parameters, see
Specifying Log File Details.