Skip to content

Commit

Permalink
Update docker.md (#6519)
Browse files Browse the repository at this point in the history
* Update docker.md

Adding OPENSEARCH_INITIAL_ADMIN_PASSWORD variable to OpenSearch node for version 2.12.0.

Signed-off-by: Pawel Wlodarczyk <pawel.wlodarczyk@eliatra.com>

* Added note about 2.12

Signed-off-by: Heather Halter <HDHALTER@AMAZON.COM>

* Update _install-and-configure/install-opensearch/docker.md

Signed-off-by: Heather Halter <HDHALTER@AMAZON.COM>

* Update _install-and-configure/install-opensearch/docker.md

Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Signed-off-by: Heather Halter <HDHALTER@AMAZON.COM>

* Update docker.md

Signed-off-by: Heather Halter <HDHALTER@AMAZON.COM>

* Update _install-and-configure/install-opensearch/docker.md

Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Signed-off-by: Heather Halter <HDHALTER@AMAZON.COM>

---------

Signed-off-by: Pawel Wlodarczyk <pawel.wlodarczyk@eliatra.com>
Signed-off-by: Heather Halter <HDHALTER@AMAZON.COM>
Co-authored-by: Heather Halter <HDHALTER@AMAZON.COM>
Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
  • Loading branch information
3 people authored Mar 1, 2024
1 parent e476ee8 commit 083496a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions _install-and-configure/install-opensearch/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ docker-compose -f /path/to/your-file.yml up

If this is your first time launching an OpenSearch cluster using Docker Compose, use the following example `docker-compose.yml` file. Save it in the home directory of your host and name it `docker-compose.yml`. This file will create a cluster that contains three containers: two containers running the OpenSearch service and a single container running OpenSearch Dashboards. These containers will communicate over a bridge network called `opensearch-net` and use two volumes, one for each OpenSearch node. Because this file does not explicitly disable the demo security configuration, self-signed TLS certificates are installed and internal users with default names and passwords are created.

### Setting a custom admin password

Starting with OpenSearch 2.12, a custom admin password is required to set up a demo security configuration. For a Docker cluster set up using a `docker-compose.yml` file, do either of the following:

1. Export `OPENSEARCH_INITIAL_ADMIN_PASSWORD` with a value in the same terminal session before running `docker-compose up`.
2. Create an `.env` file in the same folder as your `docker-compose.yml` file with the `OPENSEARCH_INITIAL_ADMIN_PASSWORD` and strong password values.

### Sample docker-compose.yml

```yml
Expand All @@ -170,6 +177,7 @@ services:
- cluster.initial_cluster_manager_nodes=opensearch-node1,opensearch-node2 # Nodes eligible to serve as cluster manager
- bootstrap.memory_lock=true # Disable JVM heap memory swapping
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" # Set min and max JVM heap sizes to at least 50% of system RAM
- OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_INITIAL_ADMIN_PASSWORD} # Sets the demo admin user password when using demo configuration, required for OpenSearch 2.12 and later
ulimits:
memlock:
soft: -1 # Set memlock to unlimited (no soft or hard limit)
Expand All @@ -194,6 +202,7 @@ services:
- cluster.initial_cluster_manager_nodes=opensearch-node1,opensearch-node2
- bootstrap.memory_lock=true
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m"
- OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_INITIAL_ADMIN_PASSWORD}
ulimits:
memlock:
soft: -1
Expand Down

0 comments on commit 083496a

Please sign in to comment.