Overview

Installation and configuration of Elasticsearch 7.1.1 in an Ubuntu system.

 

Prerequisites

  • Ubuntu 18.04
  • Access to a Terminal or Shell Console
  • Java 8 is installed

 

Installation

01: Open a terminal

 

02: Download the installer via cURL

$ curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.1.1-linux-x86_64.tar.gz

 

03: Extract the installer

$ tar -xvf elasticsearch-7.1.1-linux-x86_64.tar.gz

 

04: Navigate to the Elasticsearch directory

$ cd elasticsearch-7.1.1-linux-x86_64

 

05: Run the Elasticsearch. It will continue to run until stopped manually using Ctrl-Z.

$ ./elasticsearch

 

06: On a separate terminal, run the following to check the status. If JSON response is returned, the basic installation is completed.

$ curl 'http://127.0.0.1:9200/?pretty'

 

It will output something like

{
  "name" : "ubuntu-bionic",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "aRxfA2XCRPGcWNKIzfBCEg",
  "version" : {
    "number" : "7.1.1",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "7a013de",
    "build_date" : "2019-05-23T14:04:00.380842Z",
    "build_snapshot" : false,
    "lucene_version" : "8.0.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

 

Configuration

01: Navigate to the Elasticsearch directory, and edit the configuration file

$ cd {{elasticsearch-directory}}

$ nano config/elasticsearch.yml

 

02: Update the following section depending on the use case

# Set the following to the Private IP or Public IP on how it will be accessed

network.host: 192.168.0.1

# Elasticsearch Port

# Default port is 9200

Http.port: 9200

# Data Path

path.data: /path/to/data

# Log Path

path.logs: /path/to/logs

# Node Name

node.name: geek-project-node-production-001

# Cluster Name

cluster.name: geek-project-cluster-production

 

03: After making changes, stop Elasticsearch and restart Elasticsearch program.

 

Appendix

Java Installation

$ sudo apt update

$ sudo apt install openjdk-8-jre-headless

 

Previous PyCon 2019 | Exceptional Exceptions - How To Properly Raise, Handle And Create Them
Next Benefits And Challenges Of Cloud Computing