Problem:
Provide steps to install and configure Elasticsearch and kibana in local.
If you are getting started with Elasticsearch I strongly recommend getting started on the free trial available at Elastic Cloud, and skip this recipe. You may also use the Amazon ES free tier if you already have an AWS free tier account. However, for any reason you want to install and configure Elasticsearch in your local machine, you may continue with this recipe.
Solution Summary:
In this lab, we will download and install ElasticSearch in a Windows Machine. In a Linux machine, you should be able to do the same from OS package manager (e.g. Debian or RPM packages).
Alternatively you can install Elasticsearch with Docker.
However, I recommend you try it out in Elastic Cloud. It is free for 14 days and you do not have to enter a credit card as well.
Prerequisites:
Java should have been installed, preferably the latest version.
Solution Steps:
-
Install ElasticSearch
-
Download ElasticSearch from https://www.elastic.co/downloads/elasticsearchand extract it.
-
Run: bin\elasticsearch.bat
-
Run: curl http://localhost:9200/ (See Sample Output 1)
-
Note: Latest steps should be present in the download page.
-
-
Override the cluster or node name
-
Stop server
-
Run: bin\elasticsearch.bat -Ecluster.name=buddy_cluster -Enode.name=buddy_node
-
Run: curl http://localhost:9200/ (See Sample Output 2)
-
-
Install Kibana to visualize your Elasticsearch data and navigate the Elastic Stack:
-
Download (and extract) from https://www.elastic.co/downloads/kibana
-
Open Open config/kibana.yml and Set elasticsearch.url to point at your Elasticsearch instance. Default is http://localhost:9200/, but you will need to uncomment the line.
-
Run: bin\kibana.bat
-
May see a message: Optimizing and caching bundles for kibana, timelion and status_page. This may take a few minutes. It may then print some additional statements and finally it will print: Status changed from yellow to green – Ready.
-
-
Run from browser: http://localhost:5601
-
Kibana will be loaded and you should see a message to configure an index pattern: in order to use Kibana you must configure at least one index pattern. Index patterns are used to identify the Elasticsearch index to run search and analytics against. They are also used to configure fields.
-
-
Run the ‘GET /_cat/health?v’ API call from Kibana console, going to the Dev Tools tab.
-
Run the ‘GET /_cat/nodes?v’ API call from Kibana console, to see the list of nodes.
-
Run the ‘GET /_cat/nodes?v’ API call from Kibana console, to see the list of indices.
-
Gives output similar to: yellow open .kibana FWELCuIbRRmf4LVVCOTpHQ 1 1 1 0 3.1kb 3.1kb. Or nothing at all.
-
-
Notes
-
By default, Elasticsearch uses port 9200 to provide access to its REST API. This port is configurable if necessary.
-
Kibana lets you visualize your Elasticsearch data and navigate the Elastic Stack.
-
Whenever we ask for the cluster health, we either get green, yellow, or red. Green means everything is good (cluster is fully functional), yellow means all data is available but some replicas are not yet allocated (cluster is fully functional), and red means some data is not available.
Sample Outputs
Output 1: Run: curl http://localhost:9200/ - Default ES Start
{
"name" : "72RGNuX",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "DZEhGZRlRqSvqKwjuRwDAg",
"version" : {
"number" : "5.4.1",
"build_hash" : "2cfe0df",
"build_date" : "2017-05-29T16:05:51.443Z",
"build_snapshot" : false,
"lucene_version" : "6.5.1"
},
"tagline" : "You Know, for Search"
}
Output 2: Run: curl http://localhost:9200/- Custom ES Start
{
"name" : "buddy_node",
"cluster_name" : "buddy_cluster",
"cluster_uuid" : "DZEhGZRlRqSvqKwjuRwDAg",
"version" : {
"number" : "5.4.1",
"build_hash" : "2cfe0df",
"build_date" : "2017-05-29T16:05:51.443Z",
"build_snapshot" : false,
"lucene_version" : "6.5.1"
},
"tagline" : "You Know, for Search"
}
Recent comments