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. 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:FROM elasticsearch:7.6.2 RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch ingest-attachment

  4. Open power shell and run the following to build 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 -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.

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" : "7.6.2",
        "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"
}