Skip to content

Commit eb4d698

Browse files
Add more information about running Benchmark in Docker (#10392) (#10394)
1 parent c5dc01b commit eb4d698

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

_benchmark/user-guide/install-and-configure/installing-benchmark.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,21 +138,32 @@ docker run opensearchproject/opensearch-benchmark -h
138138
```
139139
{% include copy.html %}
140140

141-
142141
### Establishing volume persistence in a Docker container
143142

144-
To make sure your benchmark data and logs persist after your Docker container stops, specify a Docker volume to mount to the image when you work with OpenSearch Benchmark.
143+
To ensure that your benchmark data and logs persist after your Docker container stops, you must mount a local directory as a volume when running OpenSearch Benchmark in Docker.
145144

146145
Use the `-v` option to specify a local directory to mount and a directory in the container where the volume is attached.
147146

148-
The following example command creates a volume in a user's home directory, mounts the volume to the OpenSearch Benchmark container at `/opensearch-benchmark/.benchmark`, and then runs a test benchmark using the geonames workload. Some client options are also specified:
147+
The following example mounts a volume from the user's home directory to the OpenSearch Benchmark container's default benchmark data path at `/opensearch-benchmark/.benchmark` and then runs a test benchmark using the `geonames` workload:
149148

150149
```bash
151150
docker run -v $HOME/benchmarks:/opensearch-benchmark/.benchmark opensearchproject/opensearch-benchmark execute-test --target-hosts https://198.51.100.25:9200 --pipeline benchmark-only --workload geonames --client-options basic_auth_user:admin,basic_auth_password:admin,verify_certs:false --test-mode
152151
```
153152
{% include copy.html %}
154153

155-
See [Configuring OpenSearch Benchmark]({{site.url}}{{site.baseurl}}/benchmark/configuring-benchmark/) to learn more about the files and subdirectories located in `/opensearch-benchmark/.benchmark`.
154+
By default, the OpenSearch Benchmark container runs as the `benchmark` user with a home directory of `/opensearch-benchmark`, so `$HOME/.benchmark` resolves to `/opensearch-benchmark/.benchmark`.
155+
{: .note}
156+
157+
#### Running OpenSearch Benchmark as the root user
158+
159+
If you run the container as the `root` user, then the effective home directory becomes `/root`, and the benchmark path becomes `/root/.benchmark`. In this case, specify the volume mount accordingly:
160+
161+
```bash
162+
docker run -v $HOME/benchmarks:/root/.benchmark opensearchproject/opensearch-benchmark execute-test --target-hosts https://198.51.100.25:9200 --pipeline benchmark-only --workload geonames --client-options basic_auth_user:admin,basic_auth_password:admin,verify_certs:false --test-mode
163+
```
164+
{% include copy.html %}
165+
166+
To learn more about the files and subdirectories located in `/opensearch-benchmark/.benchmark`, see [Configuring OpenSearch Benchmark]({{site.url}}{{site.baseurl}}/benchmark/configuring-benchmark/).
156167

157168
## Provisioning an OpenSearch cluster with a test
158169

0 commit comments

Comments
 (0)