The Fundamentals of Elasticsearch -2

Ecesu Olgun
4 min readMar 29, 2022

Hello everyone, I move on to the Fundamental of Elasticsearch series with my second article. The topics that I want to mention are as follows:

1- Elasticsearch (download, installation, run, etc.)
2- Kibana (download, installation, run, etc.)

If you miss up my first article about Elasticsearch, you can find it here: https://ecesuolgun.medium.com/the-fundamentals-of-elasticsearch-1-73006c7f06f1

1- Elasticsearch:

We have already mentioned what is elasticsearch in the previous article, so we can move on to explain the elasticsearch download and installation part.

1.1 Download Elasticsearch:

By choosing your operating system, you can download Elasticsearch with the help of the following site -> https://www.elastic.co/downloads/elasticsearch

After your download is complete, enter the config file in the downloaded file and then open the .yml file named elasticsearch. This is an elasticsearch configuration file. In this file, you need to specify your cluster.name and node.name. After determining this, you can see which http port you are working on in the “network” header in the same file, or you can change it to a specific port.

An example from the elasticsearch yml file

Once the Elasticsearch installation is complete, we can run Elasticsearch.

1.2 Run Elasticsearch:

To run Elasticsearch, we first open the windows power shell (or terminal if you’re using a mac). After entering the power shell, we need to go to the directory where we saved our Elasticsearch file and run elasticsearch.bat in the bin.

If you do everything right, you should see this page when you visited this url: http://localhost:9200

http://localhost:9200

2- Kibana:

Before downloading Kibana, you should make sure you have downloaded Elasticsearch. First of all, if I have to talk about what Kibana is, it enables you to give shape to your data and navigate the Elastic Stack. With Kibana, you can:

  • Search, observe and protect your data. From discovering documents to analyzing logs to finding security vulnerabilities, Kibana is your portal for accessing these capabilities and more.
  • Analyze your data. Search for hidden insights, visualize what you’ve found in charts, gauges, maps, graphs, and more, and combine them in a dashboard.
  • Manage, monitor, and secure the Elastic Stack. Manage your data, monitor the health of your Elastic Stack cluster, and control which users have access to which features (https://www.elastic.co/guide/en/kibana/current/introduction.html).

2.1 Download Kibana:

By choosing your operating system, you can download Kibana with the help of the following site -> (https://www.elastic.co/downloads/kibana)

After the download is finished, choose where you want to save it. Then enter your file and open the config file. Inside this file, you will see a notepad with a yml extension. If it didn’t come in the form of elasticsearch.hosts: [“http://localhost:9200"] first, we need to fix it here.

2.2 Run Kibana:

We are ready to run the Kibana now. To run Kibana, we first open the windows power shell (or terminal if you’re using a mac). After entering the power shell, we need to go to the directory where we saved our Kibana file and run kibana.bat in the bin.

If the Kibana installation is completed correctly, Kibana will open when we enter the server (http://localhost:5601/app/dev_tools#/console)(Kibana server.port:5601) that is written in the Kibana .yml extension file. If the Kibana installation is not completed yet, you will see a warning like ‘Kibana server is not already yet’. Besides, do not forget to run Elasticsearch first, before running Kibana.

2.3 Kibana Dev Tools:

We write the basic queries on the Dev Tools in Kibana.

Before writing a specific query, you can check first cluster health and node info by GET _cluster/health and GET _nodes/stats respectively. Your cluster health status may be red, yellow, or green. While green is the best situation, yellow is not a problem either. Yellow status indicates that one or more of the replica shards on the Elasticsearch cluster are not allocated to a node. There are several reasons why a yellow status can be perfectly normal, and in many cases, Elasticsearch will recover to green by itself, so the worst thing you can do is start tweaking things without knowing exactly what the cause is. While the status is yellow, search and index operations are still available (https://opster.com/guides/elasticsearch/operations/elasticsearch-yellow-status/).

But if you still want to change the situation from yellow to green, you can try the solutions in the link given above.

I have come to the end of my second blog post about Elasticsearch. Thank you for reading. In my next writing about Elasticsearch is that I will try to show write queries such as creating an index, indexing a document, deleting, or updating a document through the Dev Console.

--

--