Elasticsearch - Quick Start

Overview

PDS Registry requires Elasticsearch.

To install Elasticsearch on a developer laptop follow instructions below. For production deployment, see this section.

Installation

Step 1: Download and extract Elasticsearch

Download Elasticsearch 7.8.1 from Elastic website. There are ZIP (recommended) and MSI files for Windows, TAR.GZ for MacOS, TAR.GZ, RPM and DEB files for Linux.

If you're using ZIP or TAR.GZ file, extract the archive to any directory, for example, /opt/elasticsearch-7.8.1. We will call this directory ELASTIC_SEARCH_HOME throughout the rest of this documentation.

Step 2: Start Elasticsearch

Open Command Prompt / Terminal / PowerShell.

Go to ELASTIC_SEARCH_HOME/bin and run elasticsearch.bat on Windows or elasticsearch on Linux or Mac.

Step 3: Check that Elasticsearch server started

Either go to http://localhost:9200 in a web browser or use curl command. You should get a response similar to this.

{
  "name" : "HOST-1234",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "JJn5eqoGS3-qg03QX-Jb4w",
  "version" : {
    "number" : "7.8.1",
    "build_flavor" : "default",
    "build_type" : "zip",
    "build_hash" : "b5ca9c58fb664ca8bf9e4057fc229b3396bf3a89",
    "build_date" : "2020-07-21T16:40:44.668009Z",
    "build_snapshot" : false,
    "lucene_version" : "8.5.1",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

Using Docker

You can run Elasticsearch in Docker or Podman. The Elasticsearch images are based on CentOS 7.

First, pull Elasticsearch from Elastic Docker registry.

docker pull docker.elastic.co/elasticsearch/elasticsearch:7.8.1

To start a single-node Elasticsearch cluster for development or testing, run the following command

docker run -d --name elasticsearch \
  -p 9200:9200 -p 9300:9300 \
  -e "discovery.type=single-node" \
  docker.elastic.co/elasticsearch/elasticsearch:7.8.1

Next Steps

Your Elasticsearch server is ready. You should now deploy the tools to harvest metadata and manage your registry.

Common Errors

If you could not start Elasticsearch or access it

  • Check logs in ELASTIC_SEARCH_HOME/logs directory.
  • If running in a VM or container, make sure that ports 9200 and 9300 are open or mapped.
  • Try replacing localhost with the hostname or IP of your machine.
  • Check if another application is using ports 9200 or 9300. Make sure you don't have another Elasticsearch instance or docker container running.