ElasticSearch 8.1.0 and Kibana 8.1.0 on Docker


ElasticSearch 8.1.0 and Kibana 8.1.0 on Docker

Q. Why do we need Kibana with ElasticSearch?
A. We don't. But I have found Kibana's "Dev Tools" to be very helpful in learning ElasticSearch.

Q. Why am I talking about removing security?
A. With ElasticSearch 8, security comes as default. As a developer, for every query (from postman) needs authentication headers. I don't want that. I want my developer instance to be free of clutter so that I can learn ElasticSearch. Hence I intend to remove security.

What we shall cover
  1. Start ElasticSearch 8.1.0 without security
  2. Start Kibana 8.1.0
  3. Connect Kibana with ElasticSearch

Start ElasticSearch 8.1.0 (without security)

docker run -d \
--name elastic8 \
-p 9200:9200 \
-p 9300:9300 \
-e "discovery.type=single-node" \
-e "xpack.security.enabled=false" \
elasticsearch:8.1.0

Hit http://localhost:9200/. You should see a JSON response when ElasticSearch is running successfully.

Note:
  • It takes time for ElasticSearch to start
  • -e "discovery.type=single-node" tells that we are not running a cluster, but a single node
  • -e "xpack.security.enabled=false" tells ES that we do not want any security

Start Kibana

docker run -d \
--name kibana8 \
-p 5601:5601 \
kibana:8.1.0

Hit http://localhost:5601/. You should see Kibana page loading

Connect Kibana with ElasticSearch

  1. Open http://localhost:5601/.
  2. You should see a page that looks like this

  3. We didn't use security. So we need to manually setup. Click on "Configure Manually".
  4. Now you should see a page that looks like this 

  5. Here we should enter the ElasticSearch URL. Enter the URL and click "Check address"
    1. http://localhost:9200
    2. http://docker.for.mac.localhost:9200 (for Mac)
  6. The new page looks like 
  7. Click on "Configure Elastic". This should open a verification box 
  8. Fetching verification code:
    1. A verification code has been generated by Kibana at this moment. This is printed in logs. Open logs with command docker logs kibana8
    2. In logs you should see a line at end which has verification code. The log looks like this: Your verification code is:  957 388
    3. Just enter this code in box.
    4. Click on "Verify"
    5. You should see an intermediate page that looks like this. It just means that Kibana is setting up 

  9. After some time, home page opens. And you know your Kibana and Elastic Search are connected.

Note: This guide only talks about installing ES and Kibana without security for developers to test ElasticSearch and Kibana.

Comments