DevOps Classroom Series – 17/Sept/2021

Using Kibana Console

  • To communicate with Elastic Serach we need to use REST API
  • REST stands for Representational State Transfer. Its an architectural style that is used to make system inter operatate and interact with each other. REST has evolved over HTTP protocol.
  • HTTP protocol supports different methods
    • GET
    • POST
    • PUT
    • DELETE
    • HEAD
  • Kibana Console gives us a Console UI which is part of developer tools which makes it easier to interact with Elastic Search
  • So we will be using Kibana Dev Tools to understand Elastic Search Preview Preview

Core Concepts of Elastic Search

  • The JSON documents in Elastic Search are organized as Elastic Search is a document-oriented store.
  • Following are core concepts of Elastic search
    • Indexes
    • Types
    • Documents
    • Clusters
    • Nodes
    • Shards and replicas
    • Mappings and Types
    • Inverted Indexes

Index

  • An index is a container that stores and manages documents of single type in Elastic Search Preview

Type

  • In practice, we should avoid mixing different entitites such as customers and products into single type, It makes sense to store them in seperate types with seperate Entities

Documents

  • Documents contains multiple fields & each field in JSON document is of particular type
  • In addition to the fields sent by user in the document, Elastic search maintains internal meta fields
    • _id: This is unique identifier of the document within a type
    • _type: This field contains the type of the document
    • _index: This field contains the index name of the document

Scenarios

  • Create a new index and document Preview
  • Get the document created in the index Preview
  • Note: HTTP Status codes Refer Here

Nodes and Clusters

  • Elastic search is a distributed system and it consits of multiple processes running on different machines that communicate
  • Each machine which runs elastic search is a Node
  • Every node is associated with unique id and name
  • Node details can be configured in elasticsearch.yml
  • A cluster is formed by one or more nodes. Every Elastic search node is always part of cluster.
  • By default, every Elastic search node tries to join a cluster with the name Elasticsearch
  • A cluster consists of multiple nodes, where each node takes the responsibility for storing, managing its share of data.
  • One cluster can host one or more indexes. Preview

Shards and replicas

  • Lets try to understand what shard is, An index contains documents & Shards help in distributing an Index over cluster.
  • Shards help in dividing the documents of single index over multiple nodes (Shards split data of single index over the cluster), hence allowing the storage, memory and processing capacities of cluster to be utilized
  • The process of dividing data among shards is called sharding
  • By default every index is configured to have five shards in Elastic Search
  • While creating index we can specify number of shards Preview
  • Now lets assume Node 1 is down Preview
  • Distributed systems such as Elastic search are expected to run inspite of hardware failures. This issue is address by replica shards or replicas.
  • Each shard in index is configured to have zero or more replica shards. Replica Shards are extra copies of the orginal shards and they created for high availability of data Preview
  • As you can observe in the image even if the Node 1 is down, then the data is getting served from other nodes with replicas ()

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Customized Social Media Icons from Acurax Digital Marketing Agency

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube