Installing Elasticsearch and Kibana on MacOS

This tutorial covers the steps to install Elasticsearch and Kibana on MacOS.

Image for post
Image for post

Elasticsearch is a full-text search engine, allowing you to find matches from very large datasets.

Kibana is a UI tool that sits on top of ElasticStack, allowing you to visualize data and run queries.

Pre-Requisites

Open a new terminal window by using Command + Space to open Spotlight:

Image for post
Image for post

Then start typing “Terminal” and hit Enter:

Image for post
Image for post

To install Homebrew, run the following command:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Image for post
Image for post

More information can be found from the Homebrew website https://brew.sh/

The next step is to install Java JDK.

You can see if this is already installed by running the following command:

$ /usr/libexec/java_home -V
Image for post
Image for post

If the JDK is not installed, use the following Homebrew command:

$ brew cask install java

Installing Elasticsearch

$ brew cask install elasticsearch
Image for post
Image for post

Once the installation is completed, run the following command to start Elasticsearch on the default port 9200:

$ brew services start elasticsearch
Image for post
Image for post

Then a browser visit localhost:9200 and confirm you see the message “You Know, for Search”

Image for post
Image for post

Installing Kibana

$ brew cask install kibana
Image for post
Image for post

Once installed, visit Kibana on the default port 5601.

Then click the “Try our sample data” button.

Image for post
Image for post

On the next page, click the “Add data” button under “Sample e-Commerce Orders”

Image for post
Image for post

Now click the icon in the top left-hand corner.

In the menu, select “Dev Tools”:

Image for post
Image for post

Use the following command to perform a health check:

GET /_cat/health?v
Image for post
Image for post

To add data, use the PUT command.

For example, if I wanted to update the name at Id 1 in the customer data, I’d use the following command to replace the resource:

PUT /customer/_doc/1
{
"name": "George Marklow"
}
Image for post
Image for post

To view my name that I updated in the customer records, I’d use the GET command as follows:

GET /customer/_doc/1
Image for post
Image for post

Written by

George is a software engineer, author, blogger, and tech enthusiast who believes in helping others to make us happier and healthier.

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