<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jinna Balu</title>
    <description>The latest articles on DEV Community by Jinna Balu (@jinnabalu).</description>
    <link>https://dev.to/jinnabalu</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F387343%2F7ca7087c-0106-45a0-b0a4-c699e8445b58.png</url>
      <title>DEV Community: Jinna Balu</title>
      <link>https://dev.to/jinnabalu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jinnabalu"/>
    <language>en</language>
    <item>
      <title>Deploy libreoffice as container</title>
      <dc:creator>Jinna Balu</dc:creator>
      <pubDate>Fri, 27 Sep 2024 07:11:10 +0000</pubDate>
      <link>https://dev.to/jinnabalu/deploy-libreoffice-as-container-40i3</link>
      <guid>https://dev.to/jinnabalu/deploy-libreoffice-as-container-40i3</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foivydbjerak4sla5yii7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foivydbjerak4sla5yii7.jpg" alt="jinnabalu"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Configuration saved in github repo &lt;a href="https://github.com/ContainerTalks/infinite-docker-compose/blob/main/libreoffice/docker-compose.yml" rel="noopener noreferrer"&gt;infinite-docker-compose&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create the docker-compose.yml for the obsidian&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;libreoffice&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;lscr.io/linuxserver/libreoffice:latest&lt;/span&gt;
    &lt;span class="na"&gt;container_name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;libreoffice&lt;/span&gt;
    &lt;span class="na"&gt;security_opt&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;seccomp=unconfined&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;PUID=1000&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;PGID=1000&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;TZ=Etc/UTC&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;3000:3000"&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;3001:3001"&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;unless-stopped&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the application &lt;code&gt;docker-compose up -d&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Application is available on &lt;a href="http://localhost:3000/" rel="noopener noreferrer"&gt;http://localhost:3000/&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Deploy obsidian as container</title>
      <dc:creator>Jinna Balu</dc:creator>
      <pubDate>Fri, 27 Sep 2024 06:32:13 +0000</pubDate>
      <link>https://dev.to/jinnabalu/deploy-obsidian-as-container-b04</link>
      <guid>https://dev.to/jinnabalu/deploy-obsidian-as-container-b04</guid>
      <description>&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://obsidian.md/" rel="noopener noreferrer"&gt;https://obsidian.md/&lt;/a&gt; note taking app&lt;/li&gt;
&lt;li&gt;Configuration saved in github repo &lt;a href="https://github.com/ContainerTalks/infinite-docker-compose/tree/main/obsidian" rel="noopener noreferrer"&gt;infinite-docker-compose&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Create the docker-compose.yml for the obsidian&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;obsidian&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;lscr.io/linuxserver/obsidian:latest&lt;/span&gt;
    &lt;span class="na"&gt;container_name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;obsidian&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;3000:3000"&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;3001:3001"&lt;/span&gt;
    &lt;span class="na"&gt;shm_size&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;1gb"&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;unless-stopped&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the application &lt;code&gt;docker-compose up -d&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Application is available on &lt;a href="http://localhost:3000/" rel="noopener noreferrer"&gt;http://localhost:3000/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>obsidian</category>
      <category>docker</category>
      <category>container</category>
      <category>jinnabaalu</category>
    </item>
    <item>
      <title>Deploy firefox as container</title>
      <dc:creator>Jinna Balu</dc:creator>
      <pubDate>Fri, 27 Sep 2024 06:03:54 +0000</pubDate>
      <link>https://dev.to/jinnabalu/deploy-firefox-as-container-2de2</link>
      <guid>https://dev.to/jinnabalu/deploy-firefox-as-container-2de2</guid>
      <description>&lt;h2&gt;
  
  
  Firefox + Caddy + HTTPS for firefox.jinnabalu.local
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Create the folder and create the following files, here is the tree, configuration is available in github repo &lt;a href="https://github.com/ContainerTalks/infinite-docker-compose/tree/main/firefox" rel="noopener noreferrer"&gt;infinite-docker-compose&lt;/a&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firefox tree
&lt;span class="nb"&gt;.&lt;/span&gt;
├── Caddyfile
└── docker-compose.yml

1 directory, 2 files
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;docker-compose.yml
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;firefox&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;lscr.io/linuxserver/firefox:latest&lt;/span&gt;
    &lt;span class="na"&gt;container_name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;firefox&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;PUID=1000&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;PGID=1000&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;TZ=Etc/UTC&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;3001:3001"&lt;/span&gt;
    &lt;span class="na"&gt;shm_size&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;1gb"&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;unless-stopped&lt;/span&gt;

  &lt;span class="na"&gt;caddy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;caddy:latest&lt;/span&gt;
    &lt;span class="na"&gt;container_name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;caddy&lt;/span&gt;
    &lt;span class="na"&gt;depends_on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;firefox&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;80:80"&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;443:443"&lt;/span&gt;
    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;./Caddyfile:/etc/caddy/Caddyfile&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;caddy_data:/data&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;caddy_config:/config&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;unless-stopped&lt;/span&gt;

&lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;caddy_data&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;caddy_config&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Caddyfile
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;firefox.jinnabalu.local &lt;span class="o"&gt;{&lt;/span&gt;
    reverse_proxy firefox:3001
    tls internal
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Update the host for mapping the domain, this is not required if you are mapping to the DNS records from the internet registry.
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;sudo nano /etc/hosts&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Add the following record &lt;/p&gt;

&lt;p&gt;&lt;code&gt;127.0.0.1 firefox.jinnabalu.local&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Finally run the application &lt;code&gt;docker compose up -d&lt;/code&gt;, open &lt;a href="https://firefox.jinnabalu.local" rel="noopener noreferrer"&gt;https://firefox.jinnabalu.local&lt;/a&gt;&lt;/p&gt;

</description>
      <category>firefox</category>
      <category>caddy</category>
      <category>docker</category>
      <category>jinnabaalu</category>
    </item>
    <item>
      <title>Identify the Active Controller In Kafka</title>
      <dc:creator>Jinna Balu</dc:creator>
      <pubDate>Sun, 20 Mar 2022 16:08:03 +0000</pubDate>
      <link>https://dev.to/jinnabalu/identify-the-active-controller-in-kafka-1oj5</link>
      <guid>https://dev.to/jinnabalu/identify-the-active-controller-in-kafka-1oj5</guid>
      <description>&lt;h3&gt;
  
  
  What is Controller?
&lt;/h3&gt;

&lt;p&gt;The Controller is one of the kafka broker's, usually behaves as a normal broker and having a controlling capability of managing partition state and replicas and reassignment of the partition.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to get the current active controller?
&lt;/h3&gt;

&lt;p&gt;Zookeeper is the storage of the kafka cluster, who elects the controller node either in the beginning of the cluster setup or when the controller node crashes. Here is the command to get the controller&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Shell command when installed on the host
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;zookeeper-shell 192.168.1.1:22181 get /controller
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;When we are dealing with the docker container we can execute the above command in interactive mode as follows
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Connect to Zookeeper
docker run --net=host --rm confluentinc/cp-kafka:4.0.0 zookeeper-shell 192.168.1.1:22181

# Get the Controller
docker run --net=host --rm confluentinc/cp-kafka:4.0.0 zookeeper-shell 192.168.1.1:22181 get /controller
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Note:  &lt;code&gt;192.168.1.1&lt;/code&gt; is the zookeeper IP&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>kafka</category>
      <category>container</category>
    </item>
    <item>
      <title>Elasticsearch as a container for beginners</title>
      <dc:creator>Jinna Balu</dc:creator>
      <pubDate>Fri, 29 May 2020 02:55:20 +0000</pubDate>
      <link>https://dev.to/jinnabalu/elasticsearch-as-a-container-for-beginners-d1e</link>
      <guid>https://dev.to/jinnabalu/elasticsearch-as-a-container-for-beginners-d1e</guid>
      <description>&lt;h1&gt;
  
  
  Elasticsearch Single Node with Kibana
&lt;/h1&gt;

&lt;p&gt;In this scenario, you'll learn how to deploy a Elasticsearch and Kibana as a Docker Container.&lt;/p&gt;

&lt;p&gt;Elasticsearch single is recommended for dev and monitoring but not for the production or primary store. &lt;/p&gt;

&lt;p&gt;If we have a proper backup strategy still we can risk running a single node in the production too but we don't get all the feature set like fault tolerance and distributed cluster, this is at high risk.&lt;/p&gt;

&lt;p&gt;Let us understand how we can start the single node container in this scenario, expecting that you are familiar  with &lt;code&gt;docker&lt;/code&gt; and &lt;code&gt;docker-compose&lt;/code&gt; commands.&lt;/p&gt;

&lt;h2&gt;
  
  
  Agenda
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Create the docker-compose&lt;/li&gt;
&lt;li&gt;Understand the properties used in Elasticsearch and Kibana&lt;/li&gt;
&lt;li&gt;Health check with 

&lt;ul&gt;
&lt;li&gt;Kibana Console UI &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;curl&lt;/code&gt; Command &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Create a simple document with 

&lt;ul&gt;
&lt;li&gt;mappings&lt;/li&gt;
&lt;li&gt;settings&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Insert Data into the created index&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Create the docker-compose
&lt;/h2&gt;

&lt;p&gt;Create the &lt;code&gt;docker-compose.yml&lt;/code&gt; with the following&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;version: &lt;span class="s2"&gt;"3"&lt;/span&gt;
services:
    elasticsearch:
        image: docker.elastic.co/elasticsearch/elasticsearch:7.7.0
        container_name: elasticsearch
        environment:
            - discovery.type&lt;span class="o"&gt;=&lt;/span&gt;single-node
            - &lt;span class="nv"&gt;ES_JAVA_OPTS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"-Xms1g -Xmx1g"&lt;/span&gt;
        volumes:
            - vibhuviesdata:/usr/share/elasticsearch/data
        ports:
            - 9200:9200
        networks:
            - elastic
        labels:
            - co.elastic.logs/module&lt;span class="o"&gt;=&lt;/span&gt;elasticsearch
            - co.elastic.metrics/module&lt;span class="o"&gt;=&lt;/span&gt;elasticsearch
    kibana:
        image: docker.elastic.co/kibana/kibana:7.7.0
        container_name: kibana
        ports:
            - 5601:5601
        depends_on:
            - elasticsearch
        environment:
            ELASTICSEARCH_URL: http://elasticsearch:9200
            ELASTICSEARCH_HOSTS: http://elasticsearch:9200
        networks:
            - elastic
networks:
    elastic:
      driver: bridge  
volumes:
    vibhuviesdata:
      driver: &lt;span class="nb"&gt;local&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check the content of &lt;code&gt;docker-compose.yml&lt;/code&gt; file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat &lt;/span&gt;docker-compose.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Understands the Environment and Run the container
&lt;/h2&gt;

&lt;p&gt;As mentioned in the intro hope you are familiar with the docker container commands, expecting that we proceed with the environment we have configured for the elasticsearch. &lt;/p&gt;

&lt;p&gt;In the docker-compose we have defined two services &lt;code&gt;elasticsearch&lt;/code&gt; and &lt;code&gt;kibana&lt;/code&gt;. Let's look at the other properties defined.&lt;/p&gt;

&lt;h3&gt;
  
  
  Elasticsearch
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;image: docker.elastic.co/elasticsearch/elasticsearch:7.7.0&lt;/code&gt; - Image of version &lt;code&gt;7.7.0&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;container_name&lt;/code&gt; - Custom name of the container &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;environment&lt;/code&gt; -  To run the single need we need to set the container environment with &lt;code&gt;discovery.type: single-node&lt;/code&gt; and Optional but important when we are running in dev machine &lt;code&gt;ES_JAVA_OPTS: "-Xms512m -Xmx1024m"&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;volumes&lt;/code&gt; to maintain the persistancy on restarting the container else we loose the data when we restart the container. Here we have host volume &lt;code&gt;vibhuviesdata&lt;/code&gt; and container volume &lt;code&gt;/usr/share/elasticsearch/data&lt;/code&gt;. Host Volume maintains the data for multiple restarts of the container.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ports&lt;/code&gt; - Elasticsearch will use port 9200 for requests and port 9300 for communication between nodes within the cluster.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;networks&lt;/code&gt; - To maintain the security from the other networks in the docker we have created a common network for both kibana and elasticsearch&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Kibana
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;image: docker.elastic.co/kibana/kibana:7.7.0&lt;/code&gt; - We have to use the same version as elasticsearch after &lt;code&gt;4.6.*&lt;/code&gt;. Check the &lt;a href="https://www.elastic.co/support/matrix#matrix_compatibility"&gt;Kibana Compatibility with Elasticsearch Matrix&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;container_name&lt;/code&gt; - Custom name of the container &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;environment&lt;/code&gt; -  Kibana is connecting to the container elasticsearch with teh service name and port.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ports&lt;/code&gt; - Kibana will use port 9200 for visualising the elasticsearch&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;depends_on&lt;/code&gt; - The property tell the Kibana service to run after elasticsearch&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Run the container
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker-compose up &lt;span class="nt"&gt;-d&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Docker Commands
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Check the status of the container
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker container &lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Check the logs of the Elasticsearch
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker logs elasticsearch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Check the logs of the Kibana
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker logs kibana
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Output contains  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Elasticsearch - &lt;code&gt;"message": "Cluster health status changed from [YELLOW] to [GREEN]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Kibana - &lt;code&gt;"message":"http server running at http://0:5601"&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This means that both containers are running successfully&lt;/p&gt;

&lt;h2&gt;
  
  
  Interaction with Elasticsearch Cluster API
&lt;/h2&gt;

&lt;p&gt;We have Elasticsearch running, let's try to interact with elaticsearch APIs&lt;/p&gt;

&lt;p&gt;We have two options to intearct with Elasticsearch &lt;code&gt;curl&lt;/code&gt; and &lt;code&gt;Kibana Console UI&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Curl
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Cluster health API&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; GET &lt;span class="s2"&gt;"localhost:9200/_cluster/health?pretty"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Cluster state API&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; GET &lt;span class="s2"&gt;"localhost:9200/_cluster/state/_all?pretty"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Cluster Stats API&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; GET &lt;span class="s2"&gt;"localhost:9200/_cluster/stats"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Cluster Settings API&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; GET &lt;span class="s2"&gt;"localhost:9200/_cluster/settings"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Kibana UI
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Cluster health API - GET /_cluster/health&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cluster state API - GET /_cluster/state/_all&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cluster Stats API - GET /_cluster/stats&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cluster Settings API - GET /_cluster/settings&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Frequently used commands
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Check the status of the Elasticsearch&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Check the health status of the Elasticsearch&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; GET &lt;span class="s2"&gt;"localhost:9200/_cat/health"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Get the number of nodes of the Elasticsearch Cluster
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; GET &lt;span class="s2"&gt;"localhost:9200/_cat/nodes"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Check with the shards with
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; GET &lt;span class="s2"&gt;"localhost:9200/_cat/shards"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Get list of indices
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; GET &lt;span class="s2"&gt;"localhost:9200/_cat/indices?v"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Get list of indices with specific column, we want to the column index, which will list the index names
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; GET &lt;span class="s2"&gt;"localhost:9200/_cat/indices?v&amp;amp;h=index"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Get the list of indices sort by column
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; GET &lt;span class="s2"&gt;"localhost:9200/_cat/indices?v&amp;amp;s=docs.count:desc"&lt;/span&gt;

curl &lt;span class="nt"&gt;-X&lt;/span&gt; GET &lt;span class="s2"&gt;"localhost:9200/_cat/indices?v&amp;amp;s=docs.count:asc"&lt;/span&gt;

curl &lt;span class="nt"&gt;-X&lt;/span&gt; GET &lt;span class="s2"&gt;"localhost:9200/_cat/indices?v&amp;amp;s=index"&lt;/span&gt;

curl &lt;span class="nt"&gt;-X&lt;/span&gt; GET &lt;span class="s2"&gt;"localhost:9200/_cat/indices?v&amp;amp;s=docs.count:desc"&lt;/span&gt;

curl &lt;span class="nt"&gt;-X&lt;/span&gt; GET &lt;span class="s2"&gt;"localhost:9200/_cat/indices?v&amp;amp;s=docs.count:desc"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Create Index
&lt;/h2&gt;

&lt;p&gt;Let's get into the actual dev stuff required for any developer to use elasticsearch with any client. Lets create a index using Index API.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create index
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; PUT &lt;span class="s2"&gt;"localhost:9200/twitter?pretty"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Create the index with settings
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-sXPUT&lt;/span&gt; &lt;span class="s1"&gt;'http://localhost:9200/customer/?pretty'&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{
  "settings" : {
      "index" : {
          "number_of_shards" : 5,
          "number_of_replicas" : 0
      }
  }
}'&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Insert bulk data into the index created
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;for &lt;/span&gt;i &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="nb"&gt;seq &lt;/span&gt;1 500&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do
  &lt;/span&gt;curl &lt;span class="nt"&gt;-sXPUT&lt;/span&gt; &lt;span class="s2"&gt;"localhost:9200/customer/external/&lt;/span&gt;&lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="s2"&gt;?pretty"&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s2"&gt;"
  {
    &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;number&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;: &lt;/span&gt;&lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="s2"&gt;,
    &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;: &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;John Doe - &lt;/span&gt;&lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;
  }"&lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Create student entity with 1000 records
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-sXPUT&lt;/span&gt; &lt;span class="s1"&gt;'http://localhost:9200/student/?pretty'&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{
  "settings" : {
      "index" : {
          "number_of_shards" : 5,
          "number_of_replicas" : 0
      }
  }
}'&lt;/span&gt;

&lt;span class="k"&gt;for &lt;/span&gt;i &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="nb"&gt;seq &lt;/span&gt;1 20&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do
  &lt;/span&gt;curl &lt;span class="nt"&gt;-sXPUT&lt;/span&gt; &lt;span class="s2"&gt;"localhost:9200/student/external/&lt;/span&gt;&lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="s2"&gt;?pretty"&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s2"&gt;"
  {
    &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;number&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;: &lt;/span&gt;&lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="s2"&gt;,
    &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;: &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;Ram - &lt;/span&gt;&lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;
  }"&lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Create index with mappings and settings
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; PUT &lt;span class="s2"&gt;"localhost:9200/school?pretty"&lt;/span&gt; &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt;&lt;span class="s1"&gt;'
{
    "settings" : {
        "number_of_shards" : 3,
        "number_of_replicas" : 2
    },
    "mappings" : {
        "properties" : {
            "name" : { "type" : "text" }
        }
    }
}
'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Delete index
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; DELETE &lt;span class="s2"&gt;"localhost:9200/school?pretty"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Get Index
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Get the mappings and setting with the following
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; GET &lt;span class="s2"&gt;"localhost:9200/school?pretty"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; GET &lt;span class="s2"&gt;"localhost:9200/school/_mapping?pretty"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; GET &lt;span class="s2"&gt;"localhost:9200/school/_settings?pretty"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Checks if an index exists
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-I&lt;/span&gt; &lt;span class="s2"&gt;"localhost:9200/twitter?pretty"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Get the count of Index
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-I&lt;/span&gt; &lt;span class="s2"&gt;"localhost:9200/twitter/_count?pretty"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Update index settings API
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; PUT &lt;span class="s2"&gt;"localhost:9200/school/_settings?pretty"&lt;/span&gt; &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt;&lt;span class="s1"&gt;'
{
    "index" : {
        "number_of_replicas" : 2
    }
}
'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Get the Statistics of the index
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; GET &lt;span class="s2"&gt;"localhost:9200/school/_stats?pretty"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; GET &lt;span class="s2"&gt;"localhost:9200/_stats?pretty"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; GET &lt;span class="s2"&gt;"localhost:9200/index1,index2/_stats?pretty"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Congratulations! We successfully completed the basics in elasticsearch. &lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
