Skip to content

srkaviani/opensearch-docker

Repository files navigation

OpenSearch in Docker Compose

OpenSearch version

Alt

Dockerized cluster architecture for OpenSearch with compose.

Key concepts

Cluster setup

Raise your host's ulimits for ElasticSearch to handle high I/O :

sudo sysctl -w vm.max_map_count=512000
# Persist this setting in `/etc/sysctl.conf` and execute `sysctl -p`

Now, we will generate the certificates for the cluster :

# You may want to edit the OPENDISTRO_DN variable first
bash generate-certs.sh
chown -R 1000.1000 certs

Start the cluster :

docker-compose up -d

Wait about 30 seconds and run securityadmin to initialize the security plugin :

docker-compose exec os01 bash -c "chmod +x plugins/opensearch-security/tools/securityadmin.sh && bash plugins/opensearch-security/tools/securityadmin.sh -cd /usr/share/opensearch/config/opensearch-security/ -icl -nhnv -cacert config/certificates/ca/ca.pem -cert config/certificates/ca/admin.pem -key config/certificates/ca/admin.key -h localhost"

Find all the configuration files in the container's /usr/share/opensearch/plugins/opensearch-security/securityconfig directory. You might want to mount them as volumes.

Access OpenSearch Dashboards through https://localhost:5601

Default username is admin and password is admin

Take a look at OpenSearch's internal users documentation to add, remove or update a user.

Why OpenSearch

  • Fully open source (including plugins)
  • Fully under Apache 2.0 license
  • Advanced security plugin (free)
  • Alerting plugin (free)
  • Allows you to perform SQL queries against ElasticSearch
  • Maintained by AWS and used for its cloud services

About

OpenSearch Cluster In Docker Compose

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages