Tarball

The tarball installation provides a self-contained directory with everything you need to run OpenSearch, including an integrated Java Development Kit (JDK). The tarball is a good option for testing and development.

The tarball supports most Linux distributions, including CentOS 7, Amazon Linux 2, and Ubuntu 18.04. If you have your own Java installation and set JAVA_HOME in the terminal, macOS works, as well.

  1. Download the tarball from the OpenSearch downloads page.

  2. Extract the TAR file to a directory and change to that directory:

    1. # x64
    2. tar -zxf opensearch-1.0.0-linux-x64.tar.gz
    3. cd opensearch-1.0.0
  3. Run OpenSearch:

    1. ./opensearch-tar-install.sh
  4. Open a second terminal session, and send requests to the server to verify that OpenSearch is up and running:

    1. curl -XGET https://localhost:9200 -u 'admin:admin' --insecure
    2. curl -XGET https://localhost:9200/_cat/plugins?v -u 'admin:admin' --insecure

Configuration

You can modify config/opensearch.yml or specify environment variables as arguments using -E:

  1. ./opensearch-tar-install.sh -Ecluster.name=opensearch-cluster -Enode.name=opensearch-node1 -Ehttp.host=0.0.0.0 -Ediscovery.type=single-node

For other settings, see Important settings.

(Optional) Set up Performance Analyzer

In a tarball installation, Performance Analyzer collects data when it is enabled. But in order to read that data using the REST API on port 9600, you must first manually launch the associated reader agent process:

  1. Make Performance Analyzer accessible outside of the host machine

    1. cd /usr/share/opensearch # navigate to the OpenSearch home directory
    2. cd plugins/opensearch_performance_analyzer/pa_config/
    3. vi performance-analyzer.properties

    Uncomment the line #webservice-bind-host and set it to 0.0.0.0:

    1. # ======================== OpenSearch performance analyzer plugin config =========================
    2. # NOTE: this is an example for Linux. Please modify the config accordingly if you are using it under other OS.
    3. # WebService bind host; default to all interfaces
    4. webservice-bind-host = 0.0.0.0
    5. # Metrics data location
    6. metrics-location = /dev/shm/performanceanalyzer/
    7. # Metrics deletion interval (minutes) for metrics data.
    8. # Interval should be between 1 to 60.
    9. metrics-deletion-interval = 1
    10. # If set to true, the system cleans up the files behind it. So at any point, we should expect only 2
    11. # metrics-db-file-prefix-path files. If set to false, no files are cleaned up. This can be useful, if you are archiving
    12. # the files and wouldn't like for them to be cleaned up.
    13. cleanup-metrics-db-files = true
    14. # WebService exposed by App's port
    15. webservice-listener-port = 9600
    16. # Metric DB File Prefix Path location
    17. metrics-db-file-prefix-path = /tmp/metricsdb_
    18. https-enabled = false
    19. #Setup the correct path for certificates
    20. certificate-file-path = specify_path
    21. private-key-file-path = specify_path
    22. # Plugin Stats Metadata file name, expected to be in the same location
    23. plugin-stats-metadata = plugin-stats-metadata
    24. # Agent Stats Metadata file name, expected to be in the same location
    25. agent-stats-metadata = agent-stats-metadata
  2. Make the CLI executable:

    1. sudo chmod +x ./bin/performance-analyzer-agent-cli
  3. Launch the agent CLI:

    1. ES_HOME="$PWD" ./bin/performance-analyzer-agent-cli
  4. In a separate window, enable the Performance Analyzer plugin:

    1. curl -XPOST localhost:9200/_plugins/_performanceanalyzer/cluster/config -H 'Content-Type: application/json' -d '{"enabled": true}'

    If you receive the curl: (52) Empty reply from server error, you are likely protecting your cluster with the security plugin and you need to provide credentials. Modify the following command to use your username and password:

    1. curl -XPOST https://localhost:9200/_plugins/_performanceanalyzer/cluster/config -H 'Content-Type: application/json' -d '{"enabled": true}' -u 'admin:admin' -k
  5. Finally, enable the Root Cause Analyzer (RCA) framework

    1. curl -XPOST localhost:9200/_plugins/_performanceanalyzer/rca/cluster/config -H 'Content-Type: application/json' -d '{"enabled": true}'

    Similar to step 4, if you run into curl: (52) Empty reply from server, run the command below to enable RCA

    1. curl -XPOST https://localhost:9200/_plugins/_performanceanalyzer/rca/cluster/config -H 'Content-Type: application/json' -d '{"enabled": true}' -u 'admin:admin' -k