Skip to main content

Installing Elastic Search

Install Using Docker

Taken from Elastic Search with Plugins in Docker

  1. Download Docker Desktop (Windows): Docker Desktop
  2. Create a Dockerfile. This file can be saved anywhere you choose. There is many ways of doing this, but what needs to be done is to create a file that does not have an extension on it and call it Dockerfile. One way is to open an editor(VS Code, Notepad++, Sublime Text, etc) then save the file with that name and no extension. Sometimes you have to save the name with quotes around it (exp. "Dockerfile").
  3. Once file is created enter the following code into the Dockerfile: 

    FROM elasticsearch:6.8.23
    
    RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch ingest-attachment
  4. Open power shell and navigate to the file location of the Dockerfile. Then run the following to build the image in docker:
    docker build -t elasticsearch-ingest-attachment .
  5. Next in power shell run the following to create the container and run for the first time:
    docker run --name elastic-search-6.8.23 -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch-ingest-attachment

  6. Elastic search is now up and running. The only problem is it is running in power shell and will stay up on the screen. To resolve this please close the power shell which will stop elastic search. Then open Docker, in the container menu find the elastic search container and hit the start button. Elastic search will be then good to go.

Note: This install of Elastic Search includes the Ingest add-on that is required for Rubex.

For Testing if it is up and running. Run the following code in power shell: curl -GET "localhost:9200"

The following will then display which shows it is up and running: 

{
    "name" : "64adb598c086",
    "cluster_name" : "docker-cluster",
    "cluster_uuid" : "_jyHQb0LTeSIJxenN4MO1g",
    "version" : {
        "number" : "6.8.23",
        "build_flavor" : "default",
        "build_type" : "docker",
        "build_hash" : "ef48eb35cf30adf4db14086e8aabd07ef6fb113f",
        "build_date" : "2020-03-26T06:34:37.794943Z",
        "build_snapshot" : false,
        "lucene_version" : "8.4.0",
        "minimum_wire_compatibility_version" : "6.8.0",
        "minimum_index_compatibility_version" : "6.0.0-beta1"
    },
    "tagline" : "You Know, for Search"
}


DEBUGGING:

If your elastic search is running, and you can connect to it successfully, but it still isn't working, check the logs of the docker container for the following string:

max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]