Change remote store documentation to reflect all the config options (#1245)

* Change remote store documentation to reflect all the config options

Signed-off-by: Sachin Kale <kalsac@amazon.com>

* Address review comments

Signed-off-by: Sachin Kale <kalsac@amazon.com>

* Address review comments

Signed-off-by: Sachin Kale <kalsac@amazon.com>

Signed-off-by: Sachin Kale <kalsac@amazon.com>
Co-authored-by: Sachin Kale <kalsac@amazon.com>
This commit is contained in:
Sachin Kale 2022-09-20 20:08:11 +05:30 committed by GitHub
parent 981ec77db4
commit 57417bb1fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 52 additions and 38 deletions

View File

@ -12,7 +12,58 @@ Remote-backed storage is an experimental feature. Therefore, we do not recommend
Remote-backed storage offers OpenSearch users a new way to protect against data loss by automatically creating backups of all index transactions and sending them to remote storage. In order to expose this feature, segment replication must also be enabled. See [Segment replication]({{site.url}}{{site.baseurl}}/opensearch/segment-replication/) for additional information.
## Enable the feature
## Enable the feature flag
There are several methods for enabling remote store feature, depending on the install type. You will also need to enable `remote_store` property when creating the index.
Segment replication must also be enabled to use remote-backed storage.
{: .note}
### Enable on a node using a tarball install
The flag is toggled using a new jvm parameter that is set either in `OPENSEARCH_JAVA_OPTS` or in config/jvm.options.
#### Option 1: Modify jvm.options
Add the following lines to `config/jvm.options` before starting the OpenSearch process to enable the feature and its dependency:
```
-Dopensearch.experimental.feature.replication_type.enabled=true
-Dopensearch.experimental.feature.remote_store.enabled=true
```
Run OpenSearch
```bash
./bin/opensearch
```
#### Option 2: Enable from an environment variable
As an alternative to directly modifying `config/jvm.options`, you can define the properties by using an environment variable. This can be done in a single command when you start OpenSearch or by defining the variable with `export`.
To add these flags in-line when starting OpenSearch:
```bash
OPENSEARCH_JAVA_OPTS="-Dopensearch.experimental.feature.replication_type.enabled=true -Dopensearch.experimental.feature.remote_store.enabled=true" ./opensearch-{{site.opensearch_version}}/bin/opensearch
```
If you want to define the environment variable separately, prior to running OpenSearch:
```bash
export OPENSEARCH_JAVA_OPTS="-Dopensearch.experimental.feature.replication_type.enabled=true -Dopensearch.experimental.feature.remote_store.enabled=true"
./bin/opensearch
```
### Enable with Docker containers
If you're running Docker, add the following line to docker-compose.yml underneath the `opensearch-node` and `environment` section:
````json
OPENSEARCH_JAVA_OPTS="-Dopensearch.experimental.feature.replication_type.enabled=true -Dopensearch.experimental.feature.remote_store.enabled=true"
````
### Enable for OpenSearch development
To create new indexes with remote-backed storage enabled, you must first enable these features by adding the correct properties to `run.gradle` before building OpenSearch. See the [developer guide](https://github.com/opensearch-project/OpenSearch/blob/main/DEVELOPER_GUIDE.md) for information about to use how Gradle to build OpenSearch.
@ -30,43 +81,6 @@ testClusters {
}
```
Segment replication must also be enabled to use remote-backed storage.
{: .note}
After building OpenSearch with these properties, you must enable the feature for all nodes in your cluster. This can be done by modifying a `config/jvm.options`, or by defining `OPENSEARCH_JAVA_OPS` from the command line.
### Option 1: Modify jvm.options
Add the following lines to `config/jvm.options` before starting the OpenSearch process to enable the feature and its dependency:
```
-Dopensearch.experimental.feature.replication_type.enabled=true
-Dopensearch.experimental.feature.remote_store.enabled=true
```
Run OpenSearch
```bash
./bin/opensearch
```
### Option 2: Enable from an environment variable
As an alternative to directly modifying `config/jvm.options`, you can define the properties by using an environment variable. This can be done in a single command when you start OpenSearch or by defining the variable with `export`.
To add these flags in-line when starting OpenSearch:
```bash
OPENSEARCH_JAVA_OPTS="-Dopensearch.experimental.feature.replication_type.enabled=true -Dopensearch.experimental.feature.remote_store.enabled=true" ./opensearch-{{site.opensearch_version}}/bin/opensearch
```
If you want to define the environment variable separately, prior to running OpenSearch:
```bash
export OPENSEARCH_JAVA_OPTS="-Dopensearch.experimental.feature.replication_type.enabled=true -Dopensearch.experimental.feature.remote_store.enabled=true"
./bin/opensearch
```
## Register a remote repository
Now that your deployment is running with the feature flags enabled, the next step is to register a remote repository where backups will be stored. See [Register repository]({{site.url}}{{site.baseurl}}/opensearch/snapshots/snapshot-restore#register-repository) for more information.