Configuring a Cloud Repository in Amazon S3
About this task
- Amazon S3
- Azure storage. For information on setting up a Azure cloud repository, see https://www.elastic.co/guide/en/cloud/current/ec-azure-snapshotting.html.
To configure an Amazon S3 cloud repository
- From the command prompt, go to SAGInstallDir/InternalDataStore/bin.
- Run the following command
to create Elasticsearch keystore:
Linux
Windows./elasticsearch-keystore create
elasticsearch-keystore.bat create
- Run the following command to
add the Amazon S3 repository access key to your Elasticsearch keystore:
Linux
Windows./elasticsearch-keystore add s3.client.default.access_key
elasticsearch-keystore.bat add s3.client.default.access_key
- 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
- Run the following command
to add the Amazon S3 repository secret key:
Linux
Windows./elasticsearch-keystore add s3.client.default.secret_key
elasticsearch-keystore.bat add s3.client.default.secret_key
- 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. - Go to SAGInstallDir/IntegrationServer/instances/instance_name/packages/WmAPIGateway/cli/bin/conf.
- Open the
gateway-s3-repo.cnf file and specify Amazon S3
values for the following fields:
For example,type=s3 bucket=<s3-bucket-name> region=<s3-region> access_key=<s3-access-key> secret_key=<s3-secret-key> base_path=<s3-base-path>
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 (\). - Run the following command:
Linux
Windows./apigatewayUtil.sh configure manageRepo -file file_path
For example,apigatewayUtil.bat configure manageRepo -file file_path
./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
Windows./apigatewayUtil.sh configure manageRepo -analyticsDS true -repoName analyticsRepo
For example,apigatewayUtil.bat configure manageRepo -analyticsDS true -repoName analyticsRepo
This command creates a repository named myrepo to backup the analytics data store data.apigatewayUtil.bat configure manageRepo -analyticsDS true -repoName myrepo
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.
- Restart API Data Store.
You can now use the configured cloud repository to store backup files. For information on backing up, Creating API Data Store Backup.
- Optional. Run the following command to list the
available list of repositories and verify whether the repository you created
appears in the list:
Linux
Windows./apigatewayUtil.sh list manageRepo
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
Windows./apigatewayUtil.sh list manageRepo -analyticsDS true
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.
- Optional. Run the following command to delete
analytics data store repository:
Linux
Windows./apigatewayUtil.sh delete manageRepo -analyticsDS true -repoName analyticsRepo
For example,apigatewayUtil.bat delete manageRepo -analyticsDS true -repoName analyticsRepo
This command deletes the local repository named myrepo.apigatewayUtil.bat delete manageRepo -analyticsDS true -repoName 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.