Setting up Elasticsearch Development Environment.

Elasticsearch | Full text search | Installation

Introduction

Elasticsearch is a Lucene-based search server (and a lot more) that has become a topic of every hot conversation around the block. If you work with large volumes of structured/unstructured text data in production environments, you would have come across Elasticsearch quite often.

Elasticsearch can scale up to Petabytes of data, is highly available, can double as a No-SQL datastore, has a class leading enterprise support while offering all the goodness of Lucene (Full Text Search) in a nicely wrapped API. No wonder this has become the absolute favorite of industry giants in a very short span of time.

Today, we are going to take the first step in a long journey of understanding the crux of Elasticsearch and what makes it everyone’s favorite by setting up a local development environment.

Note: This is the first article in a multipart series to explore Elasticsearch in detail. Please check additional articles here.

Prerequisites

Before we jump into setting up our Elasticsearch server, lets go ahead and check if our system is ready with prerequisites.

The list of prerequisites for Elasticsearch is pretty short, in fact if you are on Unix platform (Linux/MacOS), the only requirement is a compatible appropriate version of JAVA. As of writing this article (latest Elastic Search Version 7.1.0), java 7+ (recommended 8+) will work fine.

Note: Elasticsearch installer ships with JDK which can be used directly, in case you want to use your own installation of JAVA, Setup JAVA_HOME environment variable.

Installation

Depending upon your use case their are several ways to get Elastic Search up and running on your local system, Let’s discuss each one by one

  1. From archive (.tar.gz) on Linux or MacOS
  2. Using Package Manager on Debian based Linux Distribution.
  3. Using Docker

Let’s address each one at a time.

1. From archive (.tar.gz) on Linux or MacOS

Elasticsearch is available as .tar.gz archive on elastic official website, both latest and archived versions can be downloaded from the link here.

Alternately, for the latest version of elastic search (as of writing this article), following code snippet can be used.

On Linux

On MacOS

Running Elasticsearch from command line

This is one of the simplest (not very robust and reusable) way to get up and running with Elasticsearch. In my personal experience unless you are setting us the environment for a very occasional, mostly learning purpose, running elastic search as service (next section) is worth the effort.

2. Using Package Manager on Debian based Linux Distribution

While installing Elasticsearch using .tar.gz archive is an excellent way to get started quickly, it leaves a lot to be desired, in terms of long term use and manageability of the service.

  1. First import the Elasticsearch PGP key

2. Add the Elasticsearch repository in apt directory

3. Finally the magic command, to summon them all

4. To make Elasticsearch server start on its own every time you reboot, lets enable the service (Optional)

5. If you wanna manually start/stop the service, following command can be used. (Optional)

6. Now to check/debug the installation

You should get a green running status, in case it shows any error, you can debug the same using command.

3. Using Docker

This is perhaps the easiest and simplest way to deploy Elasticsearch server on a local system. If you want to setup the server purely for learning purpose or want to run experiments that risk messing up the installation, this is the recommended way to go.

we can get up and running in two easy step (assuming you have docker installed and configured on your system, if not, please Get Docker)

Pulling the Image

Starting a single node cluster

There you go, That’s pretty much it.

Conclusion

While Elasticsearch is a labyrinth of a system, jam-packed of features and configuration, moldable in any shape or size imaginable, it is almost comically easy to get a single note server up and running, and poke around. I have tried to list some of the most popular setup environments in the article, in case you on a different platform, you can checkout the Elasticsearch official installation guide here.

This is the very first article in a multipart Getting to know Elasticsearch series that I am writing. Ones you are done with your installation you might be interested in a simple Python based Indexer to load data into your new installed and currently empty Elasticsearch server.

A Simple Elasticsearch Indexer written in Python Programming Language (Coming Soon!)

Ref:

https://www.elastic.co/guide/index.html

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store