Configuring a Backup Repository

About this task

A repository is a folder, network location, or cloud location where you store the data backup files. The default repository that comes with the API Gateway installation is located at SAGInstallDir/InternalDataStore/archives. This repository is called default. However, you can create additional repositories for backup storage based on your requirements.

Configure the required repositories using the configure command. You can configure more than one repository in one Elasticsearch instance with unique names. You can specify the required repository name using the repoName parameter when performing backup and restore operations.

You can configure your backup repository in one of the following locations:
  • Local file system
  • Network file system
  • Cloud

Configuring a Local File System Repository

About this task

The local file system functions as the default repository. If you do not create a repository, the backup files are stored in the SAGInstallDir/InternalDataStore/archives/ folder, by default.
Note: For a clustered API Gateway setup, ensure that the backup repository must be accessible for all cluster nodes.

Procedure

  1. From the command prompt, go to SAGInstallDir/IntegrationServer/instances/instance_name/packages/WmAPIGateway/cli/bin.
  2. Run the following command to configure local file system repository:
    Linux
    ./apigatewayUtil.sh configure fs_path -path backup_location
    Windows
    apigatewayUtil.bat configure fs_path -path backup_location
    For example,
    apigatewayUtil.bat configure fs_path -path D:/localapigatewayBackup
    This command creates a backup folder called localapigatewayBackup in the D drive.
  3. Restart API Data Store.
    You can now use the configured local repository to store backup files. For information about backing up, Creating API Data Store Backup.
  4. 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
    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

Configuring a Network File System Repository

About this task

You can specify a folder that is safe in the network as a repository to store your backup files.

If you are performing this for a clustered setup, ensure that all nodes in the cluster can access the repository.

To configure a network file system repository

Procedure

  1. From the command prompt, go to SAGInstallDir/IntegrationServer/instances/instance_name/packages/WmAPIGateway/cli/bin.
  2. Run the following command to create a network repository:
    Linux
    ./apigatewayUtil.sh configure fs_path -path network_location 
    Windows
    apigatewayUtil.bat configure fs_path -path network_location 
    For example,
    apigatewayUtil.bat configure fs_path -path //10.2.35.121/apigatewayBackup
    This command creates a repository called localapigatewayBackup at the specified network location.

    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

  3. Restart API Data Store.
    You can now use the configured network repository to store backup files. For information on backing up, Creating API Data Store Backup.
  4. 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
    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

Configuring a Cloud Repository in Amazon S3

About this task

You can configure the following types of cloud repositories: 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

Procedure

  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
    
  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
    
    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.
    You can now use the configured cloud repository to store backup files. For information on backing up, Creating API Data Store Backup.
  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
    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.