ElasticSearch – How to Install ElasticSearch ?

Published on March 5, 2016 by abundantcode

Filed under Elastic Search

Last modified March 5, 2016

Print this page

rate 1 star rate 2 star rate 3 star rate 4 star rate 5 star
Your rating: none, Average: 0 (0 votes)

This article have been viewed 5355 times

Problem Statement

You need to download , install and Elastic Search on Windows and Mac OS X machines.

Solution

You can download ElasticSearch which is available in various formats like Zip , Tar.gz from https://www.elastic.co/downloads/elasticsearch .

The installation is pretty simple and infact you dont need to do  anything special to install ElasticSearch on your machine.

You need to extract or uncompress the file.

Note : You need to ensure that you are running the latest version of the JDK on your machine and the class path is configured on your System Environment variables.

How to run ElasticSearch on Windows machine ?

To run ElasticSearch on Windows PC , run the elasticsearch.bat file from the bin folder under the extracted folder path. This will start ElasticSearch in the foreground using the console.

How to shutdown ElasticSearch in Windows ?

To shutdown ElasticSearch in Windows , press Ctrl+C shortcut key in the command window or close the command window.

If you dont have the JAVA_HOME environment variable set , you will be prompted with a message "JAVA_HOME environment variable must be set!".

How to run ElasticSearch on Mac OSX machine ?

If you want to run ElasticSearch on Mac OS X , just run the elasticsearch shell script from the bin folder.

image

Testing Your ElasticSearch

You can test your ElasticSearch by following the below steps
1. Launch the Web browser (Eg : Microsoft Edge , Google Chrome etc).
2. Enter the following URL
http://localhost:9200/

3. You should immediately see a response like this

{
  "name" : "Union Jack",
  "cluster_name" : "elasticsearch",
  "version" : {
    "number" : "2.2.0",
    "build_hash" : "8ff36d139e16f8720f2947ef62c8167a888992fe",
    "build_timestamp" : "2016-01-27T13:32:39Z",
    "build_snapshot" : false,
    "lucene_version" : "5.4.1"
  },
  "tagline" : "You Know, for Search"
}

If you are using curl , then you can use the below command as shown.

curl ‘http://localhost:9200/?pretty’

Now that your Elasticsearch cluster is up and running, you can start your adventure on ElasticSearch :).

Leave a Comment


x

You might be Interested in these Posts

C# Program to swap two numbers without using temporary variable

Problem Write a program in Visual CSharp to swap two numbers using temporary variable and display t...

C# Program to swap two numbers

Problem Write a program in C# to swap two numbers using temporary variable and display the result i...

C# Program to print the sum of two numbers

Problem Write a program in C# to add two numbers and display the result in copnsole window. How to...