Code Monkey home page Code Monkey logo

opensearch-docker-compose's Introduction

OpenSearch - Docker - Compose

OpenSearch version

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

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 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/config/opensearch-security 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.

Hot-warm architecture setup

Use a hot-warm cluster architecture if you have data that you rarely want to update or search so you can place them on lower-cost storage nodes.

Hot-warm architecture schema

Hot-warm architecture cluster setup instructions...

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-hot-warm.sh

Adjust Xms/Xmx parameters and start the cluster :

docker-compose -f docker-compose.hot-warm.yml up -d

Wait about 60 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 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/config/opensearch-security 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.

To add an index to a warm node :

PUT newindex
{
  "settings": {
    "index.routing.allocation.require.temp": "warm"
  }
}

You might want to use Index State Management (ILM) to automatically move old indices from hot to warm nodes.

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

opensearch-docker-compose's People

Contributors

flavienbwk avatar esidate avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.