diff --git a/_api-reference/snapshots/create-repository.md b/_api-reference/snapshots/create-repository.md index d115ce4284f..a9ae4fd9b46 100644 --- a/_api-reference/snapshots/create-repository.md +++ b/_api-reference/snapshots/create-repository.md @@ -9,15 +9,18 @@ nav_order: 1 **Introduced 1.0** {: .label .label-purple } + You can register a new repository in which to store snapshots or update information for an existing repository by using the snapshots API. -There are two types of snapshot repositories: +Snapshot repositories can be of the following types: * File system (`fs`): For instructions on creating an `fs` repository, see [Register repository shared file system]({{site.url}}{{site.baseurl}}/tuning-your-cluster/availability-and-recovery/snapshots/snapshot-restore/#shared-file-system). * Amazon Simple Storage Service (Amazon S3) bucket (`s3`): For instructions on creating an `s3` repository, see [Register repository Amazon S3]({{site.url}}{{site.baseurl}}/tuning-your-cluster/availability-and-recovery/snapshots/snapshot-restore/#amazon-s3). -For instructions on creating a repository, see [Register repository]({{site.url}}{{site.baseurl}}/opensearch/snapshots/snapshot-restore#register-repository). +* Hadoop Distributed File System (HDFS) (`hdfs`): For instructions on creating an `hdfs` repository, see [Register an HDFS repository]({{site.url}}{{site.baseurl}}/tuning-your-cluster/availability-and-recovery/snapshots/snapshot-restore/#hdfs). + +For instructions on creating a repository, see [Register repository]({{site.url}}{{site.baseurl}}/opensearch/snapshots/snapshot-restore/#register-repository). ## Endpoints @@ -34,7 +37,10 @@ Parameter | Data type | Description ## Request parameters -Request parameters depend on the type of repository: `fs` or `s3`. +Request parameters depend on the type of repository: + - `fs` + - `s3` + - `hdfs` ### Common parameters @@ -97,6 +103,17 @@ For the `base_path` parameter, do not enter the `s3://` prefix when entering you The `server_side_encryption` setting is removed as of OpenSearch 3.1.0. S3 applies server-side encryption as the base level of encryption for all S3 buckets. Because this cannot be disabled, this value repository setting had no effect. For more information, see [Protecting data with server-side encryption](https://docs.aws.amazon.com/AmazonS3/latest/userguide/serv-side-encryption.html). {: .note} +### hdfs repository + + Request field | Description +:----------------------------------|:------------------------------------------------------------------------------------------------------------- +| `uri` | The HDFS URI of the `hdfs://:/path/to/backup` format. Required. | +| `path` | The path within HDFS where you want to store snapshots (for example, `/my/snapshot/directory`). Required. | +| `security.principal` | The Kerberos principal to use when connecting to HDFS. Optional. | +| `conf.` | Additional HDFS client configuration settings (for example, `core-site.xml` or `hdfs-site.xml`). Optional. | + + + ## Example requests ### `fs` @@ -254,6 +271,53 @@ response = client.snapshot.create_repository( python=step1_python %} +### `hdfs` + +The following request registers a new HDFS repository using the HDFS URI `hdfs://namenode:8020` and the HDFS filesystem path `/opensearch/snapshots`: + +{% capture step1_rest %} +PUT /_snapshot/my-hdfs-repository +{ + "type": "hdfs", + "settings": { + "uri": "hdfs://namenode:8020", + "path": "/opensearch/snapshots" + } +} +{% endcapture %} + +{% capture step1_python %} + + +response = client.snapshot.create_repository( + repository = "my-hdfs-repository", + body = { + "type": "hdfs", + "settings": { + "uri": "hdfs://namenode:8020", + "path": "/opensearch/snapshots" + } + } +) + +{% endcapture %} + +{% include code-block.html +rest=step1_rest +python=step1_python %} + + ## Example response Upon success, the following JSON object is returned: diff --git a/_tuning-your-cluster/availability-and-recovery/snapshots/snapshot-restore.md b/_tuning-your-cluster/availability-and-recovery/snapshots/snapshot-restore.md index af5249cb630..93803f98f8a 100644 --- a/_tuning-your-cluster/availability-and-recovery/snapshots/snapshot-restore.md +++ b/_tuning-your-cluster/availability-and-recovery/snapshots/snapshot-restore.md @@ -80,7 +80,7 @@ You will most likely not need to specify any parameters except for `location`. F sudo ./bin/opensearch-plugin install repository-s3 ``` - If you're using the Docker installation, see [Working with plugins]({{site.url}}{{site.baseurl}}/opensearch/install/docker#working-with-plugins). Your `Dockerfile` should look something like this: + If you're using the Docker installation, see [Working with plugins]({{site.url}}{{site.baseurl}}/install-and-configure/install-opensearch/docker/#working-with-plugins). Your `Dockerfile` should look similar to the following: ``` FROM opensearchproject/opensearch:{{site.opensearch_version}}