<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by 𝐒𝐚𝐤𝐞𝐭 𝐉𝐚𝐢𝐧 on Medium]]></title>
        <description><![CDATA[Stories by 𝐒𝐚𝐤𝐞𝐭 𝐉𝐚𝐢𝐧 on Medium]]></description>
        <link>https://medium.com/@jainsaket-1994?source=rss-1a8ba5e78f2b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Dg-aW30gtNPzXApJ3g1gHw.jpeg</url>
            <title>Stories by 𝐒𝐚𝐤𝐞𝐭 𝐉𝐚𝐢𝐧 on Medium</title>
            <link>https://medium.com/@jainsaket-1994?source=rss-1a8ba5e78f2b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 22:54:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jainsaket-1994/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Implementing Google Authentication for Grafana 2FA: A Step-by-Step Guide]]></title>
            <link>https://jainsaket-1994.medium.com/implementing-google-authentication-for-grafana-2fa-a-step-by-step-guide-3dd6c0024428?source=rss-1a8ba5e78f2b------2</link>
            <guid isPermaLink="false">https://medium.com/p/3dd6c0024428</guid>
            <category><![CDATA[google-auth]]></category>
            <category><![CDATA[grafana]]></category>
            <category><![CDATA[2fa]]></category>
            <dc:creator><![CDATA[ ]]></dc:creator>
            <pubDate>Fri, 30 May 2025 08:35:32 GMT</pubDate>
            <atom:updated>2025-05-30T08:35:32.380Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OnkMrvXKscxj_K7mVwl5DA.png" /></figure><h3>🔐 Implementing Google Authentication for 2FA in Grafana</h3><p>In this blog post, we’ll walk you through the process of enabling <strong>Google Authentication</strong> as a <strong>Two-Factor Authentication (2FA)</strong> method in <strong>Grafana</strong>. This additional layer of security helps ensure that only authorized users can access your Grafana dashboards.</p><p>We recently completed a successful Proof of Concept (POC) on a separate Grafana instance, and this guide is based on those real-world steps.</p><h3>📊 Grafana Dashboard Details</h3><p>You can access your Grafana instance using a URL such as:</p><p>https://&lt;your-grafana-url&gt;.com</p><h3>🛠️ Steps to Implement Google Authentication</h3><h3>1. Update Grafana URL and Redirect URL in Google Cloud Console</h3><ul><li>Go to the <a href="https://console.cloud.google.com/iam-admin/iam?referrer=search&amp;project=testing-410718">Google Cloud Console</a></li><li>Locate the <strong>API Credential</strong> named “grafana”</li><li>Update the following fields:</li><li><strong>Authorized JavaScript origins</strong> with your Grafana URL</li><li><strong>Authorized redirect URIs</strong> with your callback URL (usually something like https://&lt;your-grafana-url&gt;/login/google)</li></ul><h3>2. Add Google OAuth Credentials to Grafana</h3><p>Once you have the Client ID and Client Secret from Google, update your Grafana configuration file (grafana.ini) with the following section:</p><pre>[auth.google]<br>enabled = true<br>client_id = YOUR_CLIENT_ID<br>client_secret = YOUR_CLIENT_SECRET<br>scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email<br>auth_url = https://accounts.google.com/o/oauth2/auth<br>token_url = https://oauth2.googleapis.com/token<br>allowed_domains = yourdomain.com</pre><blockquote><em>📝 </em>Make sure to restart Grafana after editing the configuration.</blockquote><h3>3. Test Authentication Flow</h3><ul><li>Open your Grafana URL</li><li>Click on the <strong>Google login</strong> button</li><li>Verify that you’re redirected to Google and can successfully authenticate</li></ul><h3>4. Restart Grafana Service</h3><p>To apply the new authentication settings, restart the Grafana service:</p><pre>sudo systemctl restart grafana-server</pre><p>Confirm that the service is running without errors.</p><h3>5. Validate Login with Google IDs</h3><ul><li>Try logging in with your Google account</li><li>Confirm that access is granted only to the intended Gmail accounts/domains</li></ul><h3>6. Collect Gmail IDs from Clients</h3><ul><li>Gather the list of Gmail accounts that require access</li><li>Configure these users in the <strong>Google Cloud Console</strong> or restrict access in Grafana using the allowed_domains setting</li></ul><h3>7. Collaborate with Clients</h3><p>Work closely with clients during rollout to:</p><ul><li>Validate access</li><li>Provide support for login issues</li><li>Decommission old login credentials to enforce Google Authentication</li></ul><h3>✅ Conclusion</h3><p>Enabling Google Authentication for 2FA in Grafana significantly improves the security posture of your monitoring setup. This integration ensures only verified users can log in, reducing the risk of unauthorized access.</p><p>By following the steps above, you can quickly and effectively set up Google OAuth in your Grafana environment.</p><p>🔧 <strong>Need help or have questions?</strong></p><p>Stay secure — and enjoy seamless authentication with Grafana + Google!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3dd6c0024428" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Streamlining Audio File Processing with AWS Services]]></title>
            <link>https://jainsaket-1994.medium.com/streamlining-audio-file-processing-with-aws-services-5a23601dc3dd?source=rss-1a8ba5e78f2b------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a23601dc3dd</guid>
            <category><![CDATA[elastic-transcoder]]></category>
            <category><![CDATA[sns]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[ ]]></dc:creator>
            <pubDate>Fri, 30 May 2025 08:25:56 GMT</pubDate>
            <atom:updated>2025-05-30T08:25:56.862Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*F17IDgmkpIGKvsX17fnS4A.png" /></figure><p>Scenario: The input audio can be any type like m4a,flac,mp3,mp4,wav,WMA, aac, or amr to work for us, it has to specifically be <strong>.wav file with 8000 Hz sampling rate and 16-bit encoding</strong>.</p><blockquote><em>Iinitially explored using </em><strong><em>AWS MediaConvert</em></strong><em>, but it didn’t meet our specific requirements — particularly the need to output audio files in </em><strong><em>8000 Hz, 16-bit WAV format</em></strong><em>. As a result, we opted for </em><strong><em>AWS Elastic Transcoder</em></strong><em>, which provided more suitable presets and better alignment with our use case.</em></blockquote><h4>High-Level Architecture Diagram</h4><p>User → API Upload → S3 Input → Elastic Transcoder → S3 Output → SNS → Lambda → RabbitMQ</p><h3>🧩 Step 1: User Upload and Initial Handling</h3><p>The journey begins with the API endpoint:</p><p>POST /v1/uploadedFiles/upload</p><p>This API performs two critical tasks when a user uploads an audio file:</p><ol><li><strong>Upload to S3 </strong>The uploaded audio file is stored securely in an <strong>AWS S3 bucket</strong> designated for incoming files. This ensures durability, scalability, and easy accessibility.</li><li><strong>Kafka Notification</strong></li><li>Metadata and file details are simultaneously pushed to <strong>Kafka</strong>, ensuring asynchronous communication and event propagation across the system.</li></ol><h3>⚙️ Step 2: Format Conversion with AWS Elastic Transcoder</h3><p>After the file is securely stored, the transformation process begins with <strong>AWS Elastic Transcoder</strong>. This service sits between two S3 buckets:</p><ul><li><strong>Input Bucket:</strong> Where the original user-uploaded files reside</li><li><strong>Output Bucket:</strong> Where transformed .wav files are stored</li></ul><p>Elastic Transcoder supports a range of input formats:</p><ul><li>.m4a, .flac, .mp3, .mp4, .wav, .wma, .aac, .amr</li></ul><p>It converts these into the required <strong>8000 Hz, 16-bit .wav format</strong>, preparing them for the next stage of our pipeline.</p><h3>📣 Step 3: Notifications via SNS</h3><p>Once a file is transcoded, AWS <strong>Simple Notification Service (SNS)</strong> monitors the output S3 bucket for events like:</p><ul><li>Successful transcoding</li><li>Transcoding failures</li></ul><p>These events automatically trigger notifications to the next component in the chain.</p><h3>🔄 Step 4: AWS Lambda + RabbitMQ Integration</h3><p>The SNS notifications invoke an <strong>AWS Lambda function</strong>, which:</p><ul><li>Processes the event</li><li>Pushes it into our <strong>in-house RabbitMQ queue</strong>, hosted on AWS</li></ul><p>This final step ensures that the processed audio files are now available to downstream systems for additional processing, analytics, or user feedback.</p><h3>🚀 Conclusion</h3><p>This pipeline demonstrates how various AWS services — S3, Elastic Transcoder, SNS, Lambda — can be combined with external systems like Kafka and RabbitMQ to build a <strong>robust, event-driven architecture</strong> for audio file processing.</p><p>By automating format conversions and integrating real-time event handling, we’ve streamlined the entire process — offering both scalability and reliability.</p><h3>📚 References</h3><ul><li><a href="https://aws.amazon.com/solutions/implementations/video-on-demand-on-aws/">Video on Demand on AWS — Solution Overview</a></li><li><a href="https://github.com/aws-solutions/video-on-demand-on-aws-foundation">GitHub: AWS Video on Demand Foundation</a></li><li><a href="https://docs.aws.amazon.com/solutions/latest/video-on-demand-on-aws-foundation/solution-overview.html">AWS Docs: Video on Demand on AWS</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a23601dc3dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Streamlining Index Lifecycle Management with ElasticSearch]]></title>
            <link>https://jainsaket-1994.medium.com/streamlining-index-lifecycle-management-with-elasticsearch-c9e62ce37138?source=rss-1a8ba5e78f2b------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9e62ce37138</guid>
            <category><![CDATA[elasticsearch]]></category>
            <dc:creator><![CDATA[ ]]></dc:creator>
            <pubDate>Fri, 02 May 2025 06:57:46 GMT</pubDate>
            <atom:updated>2025-05-02T06:57:46.834Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/427/1*6UgK6Bv36FBdYC34S1zh_g.png" /></figure><p><strong>Streamlining Index Lifecycle Management in Elasticsearch</strong></p><p>In the realm of data management with Elasticsearch, orchestrating the lifecycle of indices is a critical responsibility. By effectively managing how indices are created, maintained, and retired, organizations can optimize storage, improve performance, and ensure efficient data access. This guide outlines a structured approach to implement Index Lifecycle Management (ILM) using Elasticsearch’s native capabilities.</p><h3>1. Crafting an ILM Policy</h3><p>The cornerstone of efficient index lifecycle management lies in crafting a robust ILM policy. Let’s outline a structured approach:</p><p>The foundation of efficient index management lies in defining a robust ILM policy. This policy outlines how indices progress through different lifecycle phases:</p><pre>PUT /_ilm/policy/sample.rollover_policy<br>{<br>  &quot;policy&quot;: {<br>    &quot;phases&quot;: {<br>      &quot;hot&quot;: {<br>        &quot;min_age&quot;: &quot;0ms&quot;,<br>        &quot;actions&quot;: {<br>          &quot;rollover&quot;: {<br>            &quot;max_age&quot;: &quot;1d&quot;<br>          },<br>          &quot;set_priority&quot;: {<br>            &quot;priority&quot;: 100<br>          }<br>        }<br>      },<br>      &quot;warm&quot;: {<br>        &quot;min_age&quot;: &quot;1d&quot;,<br>        &quot;actions&quot;: {<br>          &quot;set_priority&quot;: {<br>            &quot;priority&quot;: 50<br>          },<br>          &quot;allocate&quot;: {<br>            &quot;number_of_replicas&quot;: 1<br>          }<br>        }<br>      },<br>      &quot;delete&quot;: {<br>        &quot;min_age&quot;: &quot;93d&quot;,<br>        &quot;actions&quot;: {<br>          &quot;delete&quot;: {}<br>        }<br>      }<br>    }<br>  }<br>}</pre><p>ILM Policy Configuration</p><p>Initiate the process by formulating an ILM policy that dictates the lifecycle stages of our indices. Here’s a detailed breakdown of the policy’s phases:</p><ul><li><strong>Hot Phase</strong>: During this phase, indices are prioritized for immediate access.</li><li><strong>Warm Phase</strong>: As indices age, their priority decreases, and the replica shard count reduces.</li><li><strong>Delete Phase</strong>: Eventually, aged indices are deleted to reclaim disk space.</li></ul><h3>2. Creating an Index Template</h3><p>To apply consistent settings and mappings to new indices, define an index template:</p><pre>PUT /_index_template/sample.customer_events_template<br>{<br>  &quot;index_patterns&quot;: [&quot;sample.customers_events.*&quot;],<br>  &quot;template&quot;: {<br>    &quot;settings&quot;: {<br>      &quot;number_of_shards&quot;: 3,<br>      &quot;number_of_replicas&quot;: 2,<br>      &quot;index.lifecycle.name&quot;: &quot;sample.rollover_policy&quot;,<br>      &quot;index.lifecycle.rollover_alias&quot;: &quot;sample.customer_events&quot;<br>    }<br>  }<br>}</pre><h3>3. Managing Indices</h3><p>With the ILM policy and index template in place, managing indices becomes seamless.</p><h4>Initial Index Creation</h4><p>Manually create the first index that follows the naming pattern and settings:</p><pre>PUT /%3Csample.customer_events.%7Bnow%2Fd%7D-000001%3E<br>{<br>  &quot;aliases&quot;: {<br>    &quot;sample.customer_events&quot;: {<br>      &quot;is_write_index&quot;: true<br>    }<br>  },<br>  &quot;settings&quot;: {<br>    &quot;lifecycle.name&quot;: &quot;sample.rollover_policy&quot;<br>  }<br>}Querying and Testing</pre><h4>Querying and Testing</h4><ul><li><strong>Validate settings</strong>: Use _ilm/explain to verify lifecycle phase status.</li><li><strong>Insert sample data</strong>: Write data via the alias sample.customer_events to confirm correct routing.</li></ul><h3>4. Integrating Existing Indices</h3><p>To bring legacy indices under ILM management:</p><h4>Make the Index Read-Only</h4><pre>PUT /customer_events/_settings<br>{<br>  &quot;settings&quot;: {<br>    &quot;index.blocks.write&quot;: true<br>  }<br>}</pre><h4>Clone and Apply Lifecycle Policy</h4><pre>POST /customer_events/_clone/sample.customer_events.2022.09.12–000001<br>{<br>  &quot;aliases&quot;: {<br>    &quot;sample.customer_events&quot;: {<br>      &quot;is_write_index&quot;: true<br>    }<br>  },<br>  &quot;settings&quot;: {<br>    &quot;index.blocks.write&quot;: null,<br>    &quot;index.lifecycle.name&quot;: &quot;sample.rollover_policy&quot;,<br>    &quot;index.lifecycle.rollover_alias&quot;: &quot;sample.customer_events&quot;<br>  }<br>}</pre><h3>Conclusion</h3><p>Properly managing index lifecycles in Elasticsearch is vital for ensuring data integrity, maintaining performance, and optimizing infrastructure costs. By crafting thoughtful ILM policies, applying consistent index templates, and integrating existing data, organizations can maximize the benefits of Elasticsearch’s lifecycle management capabilities.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9e62ce37138" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fixing Elasticsearch java.security.AccessControlException: access denied Error on Redhat Family OS]]></title>
            <link>https://jainsaket-1994.medium.com/fixing-elasticsearch-java-security-accesscontrolexception-access-denied-error-on-redhat-family-os-53e4ea2cbc20?source=rss-1a8ba5e78f2b------2</link>
            <guid isPermaLink="false">https://medium.com/p/53e4ea2cbc20</guid>
            <category><![CDATA[secuirty]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[ ]]></dc:creator>
            <pubDate>Thu, 25 Apr 2024 07:07:54 GMT</pubDate>
            <atom:updated>2024-04-25T07:07:54.048Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/387/1*ZBex6odTcauaMkw3q-PfSw.png" /></figure><p>Issue: We have encountered an issue where Elasticsearch is incompatible with new versions of OpenJDK on certain nodes running Redhat family OSes. The specific error message is:</p><pre>Caused by: java.security.AccessControlException: access denied (&quot;java.io.FilePermission&quot; &quot;/etc/pki/java/cacerts&quot; &quot;read&quot;)</pre><p>Resolution: To resolve this issue, follow these steps:</p><ul><li>Identify the Java policy path for the open JDK belonging to your OS. For example:</li></ul><pre>/etc/java/java-1.8.0-openjdk/java-1.8.0-openjdk-1.8.0.352.b08-2.el8_7.x86_64/lib/security/java.policy</pre><ul><li>Append the following permission using the sed command:</li></ul><pre>sed -i &quot;s~permission java.util.PropertyPermission \&quot;sun.security.pkcs11.disableKeyExtraction\&quot;, \&quot;read\&quot;;~permission java.util.PropertyPermission \&quot;sun.security.pkcs11.disableKeyExtraction\&quot;, \&quot;read\&quot;;\n\tpermission java.io.FilePermission \&quot;/etc/pki/java/cacerts\&quot;, \&quot;read\&quot;;~g&quot; /etc/java/java-1.8.0-openjdk/java-1.8.0-openjdk-1.8.0.352.b08-2.el8_7.x86_64/lib/security/java.policy</pre><ul><li>Restart the Elasticsearch service:</li></ul><pre>systemctl restart elasticsearch</pre><p>This should resolve the access denied error in Elasticsearch on Redhat family OSes.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=53e4ea2cbc20" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Migrating/Downgrading from Kong Enterprise to Kong Community Edition]]></title>
            <link>https://jainsaket-1994.medium.com/migrating-downgrading-from-kong-enterprise-to-kong-community-edition-5b8e9730b086?source=rss-1a8ba5e78f2b------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b8e9730b086</guid>
            <category><![CDATA[kong]]></category>
            <category><![CDATA[api-gateway]]></category>
            <category><![CDATA[migration]]></category>
            <dc:creator><![CDATA[ ]]></dc:creator>
            <pubDate>Thu, 25 Apr 2024 07:07:13 GMT</pubDate>
            <atom:updated>2024-04-25T07:07:13.603Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g7-07AZvWFF7zgTxsogZAw.png" /></figure><p>Introduction: Transitioning from Kong Enterprise to Kong Community Edition involves migrating crucial data and ensuring a seamless transfer to maintain API gateway functionality. Here’s a step-by-step guide to facilitate the migration process:</p><p>Steps to Migrate:</p><ol><li>Set up Fresh Kong and Cassandra Clusters: Establish a new Kong cluster and a separate Cassandra cluster to store data.</li><li>Recreate Old Kong Data in New Kong: Recreate data from the old Kong instance in the new cluster. For reference you can use the below Python script to fetch and migrate data such as upstreams, targets, routes, services, consumers, and plugins. Run each module separately for safety.</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2c8bdde39f52542f450bff5a98090734/href">https://medium.com/media/2c8bdde39f52542f450bff5a98090734/href</a></iframe><p>3. Verify Plugin Compatibility: Ensure all plugins are migrated properly and verify compatibility with the Kong Community Edition, as some plugins may not be supported.</p><p>4. Initial Testing: Gradually divert traffic to the new Kong cluster by adding nodes to the load balancer. Start with one node and incrementally increase traffic until fully migrated. Perform thorough testing to ensure functionality.</p><p>5. Slow Removal of Enterprise: Maintain the Kong Enterprise cluster for at least 15 days after migration before removing it from the load balancer. This allows time to address any unforeseen issues and ensures a smooth transition.</p><p>Conclusion: Migrating from Kong Enterprise to Kong Community Edition requires careful planning and execution to ensure minimal disruption to API services. By following these steps and conducting thorough testing, you can successfully transition to the Community Edition while maintaining service continuity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2RDBy8wZd2_iXkdl2oieeg.png" /></figure><p>Reference :</p><p><a href="https://jainsaket-1994.medium.com/kong-to-kong-data-migration-kong-consumer-credential-migration-6be5cf7ca4e1">Kong to Kong Data Migration &amp; Kong Consumer Credential Migration</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b8e9730b086" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setup Kafka cluster with Kraft]]></title>
            <link>https://jainsaket-1994.medium.com/setup-kafka-cluster-with-kraft-561f281b8e2a?source=rss-1a8ba5e78f2b------2</link>
            <guid isPermaLink="false">https://medium.com/p/561f281b8e2a</guid>
            <category><![CDATA[kraft]]></category>
            <category><![CDATA[apache-kafka]]></category>
            <category><![CDATA[kafka]]></category>
            <dc:creator><![CDATA[ ]]></dc:creator>
            <pubDate>Mon, 15 Apr 2024 14:04:28 GMT</pubDate>
            <atom:updated>2024-04-15T14:04:28.154Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/858/0*AxN7J93JYB89u0z2" /></figure><p>We provided a set of instructions for setting up Apache Kafka version 3.6.1 along with necessary configurations and system tuning on CentOS/RHEL-based systems. These instructions guide you through setting up Kafka, configuring log rolling policies, configuring Kafka service, setting up cluster-ID, managing permissions, enabling and starting Kafka service, and performing OS-level tuning.</p><p>Apache Kafka’s KRaft mode, which is a replicated mode of Kafka controllers that relies on the Raft consensus algorithm for leader election and replication.</p><p>Here’s a breakdown of the steps:</p><p>Requests:</p><p>Install Utilities and Dependencies:</p><pre>yum install curl <br>wget java-1.8.0-openjdk-devel -y</pre><h3>Setting up a kafka cluster without zookeeper</h3><p><strong>Download Kafka Binaries</strong></p><p>Extract kafka</p><pre>wget https://downloads.apache.org/kafka/3.6.1/kafka_2.13-3.6.1.tgz<br><br>tar -xzf kafka_2.13-3.6.1.tgz</pre><p><strong>Create Kafka User and Group</strong></p><pre>useradd -r -s /sbin/nologin kafka<br>groupadd kafka</pre><p><strong>Folder Creation</strong></p><pre>mkdir -p /etc/kafka /data/log/kafka /data/kafka</pre><p><strong>Move the Binaries to the Respective Directory</strong></p><pre>cp -rp ~/kafka_2.13–3.6.1/* /etc/kafka</pre><p><strong>Download the JMX Exporter Jar and Jolokia Jar</strong></p><pre>wget https://repo.maven.apache.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.20.0/jmx_prometheus_javaagent-0.20.0.jar #JMX Exporter Jar<br>wget https://repo1.maven.org/maven2/org/jolokia/jolokia-jvm/1.5.0/jolokia-jvm-1.5.0-agent.jar #jolokia agent jar</pre><p><strong>Move the downloaded jar to a specific folder</strong></p><pre>cp ~/jmx_prometheus_javaagent-0.20.0.jar /etc/kafka/libs/<br>cp ~/jolokia-jvm-1.5.0-agent.jar /etc/kafka/libs/</pre><p><strong>Create Profile for JMX exporter</strong></p><pre>echo -e &quot;<br><br>rules:<br>- pattern: &quot;.*&quot;<br>&quot; &gt; /etc/kafka/config/jmx_exporter_kraft.yml</pre><p><strong>update log4j property file to roll daily basis and delete after 3 days</strong></p><p>Execute the following command to configure log4j to delete logs older than 3 days and roll the logs daily</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/279e462605134acbd8f80417d0b00c6b/href">https://medium.com/media/279e462605134acbd8f80417d0b00c6b/href</a></iframe><p><strong>Create a service file for the Kafka</strong></p><pre>vi /etc/systemd/system/kafka.service</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/76771917c14b9bb3d357fabe753f6cc1/href">https://medium.com/media/76771917c14b9bb3d357fabe753f6cc1/href</a></iframe><h3>Kafka cluster configuration</h3><p>If you go to config/kraft folder inside the kafka home directory, you will see a file called server.properties. This is a sample file which is provided by kafka, to show how kafka can be started without zookeeper</p><p>Create 3 new files from server.properties. This is because we will be creating a 3 node cluster</p><pre>cd config/kraft<br>cp server.properties server1.properties<br>cp server.properties server2.properties<br>cp server.properties server3.properties</pre><p>In server1.properties, modify the following properties. Please keep the other properties as is.</p><pre>node.id=1<br>process.roles=broker,controller<br>inter.broker.listener.name=PLAINTEXT<br>controller.listener.names=CONTROLLER<br>listeners=PLAINTEXT://:9092,CONTROLLER://:19092<br>log.dirs=/tmp/server1/kraft-combined-logs<br>listener.security.protocol.map=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,SSL:SSL,SASL_PLAINTEXT:SASL_PLAINTEXT,SASL_SSL:SASL_SSL<br>controller.quorum.voters=1@localhost:19092,2@localhost:19093,3@localhost:19094</pre><p>Let me explain what these properties do:</p><p><strong>node.id</strong>: This will act as the node Id in the cluster. This will help us identify which broker this is. It will also help us identify which kraft controller node this is.</p><p><strong>process.roles</strong>: A node can act as a <strong>broker</strong> or <strong>controller</strong> or <strong>both</strong>. Here we are indicating that this node can be both a kafka broker and a kraft controller node.</p><p><strong>inter.broker.listener.name</strong>: Here the broker listener name is set to <strong>PLAINTEXT</strong></p><p><strong>controller.listener.names</strong>: Here the controller listener name is set to <strong>CONTROLLER</strong></p><p><strong>listeners</strong>: Here we indicate that the broker will use port 9092 and the kraft controller will use port 19092</p><p><strong>log.dirs</strong>: This is the log directory where kafka will store the data</p><p><strong>listener.security.protocol.map</strong>: Here the connection security details are added</p><p><strong>controller.quorum.voters</strong>: This is used to indicate all the kraft controllers which are available. Here we are indicating that we will have 3 kraft controller nodes running on ports 19092, 19093 and 19094</p><p>For <strong>server2.properties</strong> modify the following properties. Please keep the other properties as is.</p><pre>node.id=2<br>process.roles=broker,controller<br>controller.quorum.voters=1@localhost:19092,2@localhost:19093,3@localhost:19094<br>listeners=PLAINTEXT://:9093,CONTROLLER://:19093<br>inter.broker.listener.name=PLAINTEXT<br>controller.listener.names=CONTROLLER<br>log.dirs=/tmp/server2/kraft-combined-logs<br>listener.security.protocol.map=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,SSL:SSL,SASL_PLAINTEXT:SASL_PLAINTEXT,SASL_SSL:SASL_SSL</pre><p>In Server 2, the broker port is 9093 and controller port is 19093. Also the log.dirs is different</p><p>For <strong>server3.properties</strong> modify the following properties. Please keep the other properties as is.</p><pre>node.id=3<br>process.roles=broker,controller<br>controller.quorum.voters=1@localhost:19092,2@localhost:19093,3@localhost:19094<br>listeners=PLAINTEXT://:9094,CONTROLLER://:19094<br>inter.broker.listener.name=PLAINTEXT<br>controller.listener.names=CONTROLLER<br>log.dirs=/tmp/server3/kraft-combined-logs<br>listener.security.protocol.map=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,SSL:SSL,SASL_PLAINTEXT:SASL_PLAINTEXT,SASL_SSL:SASL_SSL</pre><p>In Server 3 the broker port is 9094 and the controller port is 19094. Also the log.dirs is different</p><h3>Configuration of broker/Controller node</h3><ul><li><strong>if we are configuring controller node, then we need to select /etc/kafka/config/kraft/controller.properties</strong></li><li><strong>if we are configuring broker node, then we need to select /etc/kafka/config/kraft/broker.properties</strong></li><li><strong>if we are configuring both broker and controller node, then we need to select /etc/kafka/config/kraft/server.properties</strong></li><li><strong>Whatever we are configuring, we need to give the same path in the above kafka.service file in the ExecStart parameter</strong></li></ul><p><strong>In the following config</strong></p><ul><li><strong>process.roles need to be mentioned for Kraft otherwise it will look for zookeeper mode.</strong></li><li><strong>process.roles value can be a broker for broker node, controller for the controller node and broker, controller and for both.</strong></li><li><strong>node.id is unique id for each node and for kraft mode, it is required.</strong></li><li><strong>controller.quorum.voters contain all controller nodes to from Quorom</strong></li><li><strong>Mode of communication will be PLAINTEXT for broker and CONTROLLER for controller node, mentioned in controller.listener.names.</strong></li><li><strong>The rest of the config is the same as the old Kafka with the zookeeper setup.</strong></li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/24027c27af6f9e3c7cefad922d4bca81/href">https://medium.com/media/24027c27af6f9e3c7cefad922d4bca81/href</a></iframe><h3>Setup Cluster ID</h3><p>we need to form a cluster id for the cluster for the new Kafka versions like the following and the <strong>cluster ID should be the same among all nodes in the cluster</strong></p><pre>/etc/kafka/bin/kafka-storage.sh format -c /etc/kafka/config/kraft/broker.properties --cluster-id MwFA64stS0-rQS5k9vNhbQ<br><br>chown -R kafka:kafka /data/kafka #data directory path to give permission of files generated by above command</pre><p>We can generate random id from</p><pre>/etc/kafka/bin/kafka-storage.sh random-uuid</pre><h3>Set Folder Permission</h3><pre>chown -R kafka:kafka /data /etc/kafka #data directory path to give permission of files generated by above command</pre><h3>Service Enable and Start</h3><pre>systemctl daemon-reload<br>systemctl enable kafka<br>service kafka restart<br>service kafka status</pre><h3>OS Tuning</h3><p>In file/etc/sysctl.conf</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/83abd9a5b7151e5437e2e089101f3906/href">https://medium.com/media/83abd9a5b7151e5437e2e089101f3906/href</a></iframe><p>For /etc/security/limits.conf</p><pre>kafka soft nofile unlimited<br>kafka hard nofile unlimited<br>kafka soft nproc unlimited<br>kafka hard nproc unlimited<br>root soft nofile 95000<br>root hard nofile 95000<br>root soft nproc 95000<br>root hard nproc 95000</pre><h3>Disable Transparent Huge Pages</h3><pre>echo never &gt; /sys/kernel/mm/transparent_hugepage/defrag<br>echo never &gt; /sys/kernel/mm/transparent_hugepage/enabled</pre><p>These steps will guide you through setting up an Apache Kafka cluster with Kraft mode on CentOS/RHEL-based systems. Make sure to follow each step carefully to ensure a successful setup.</p><h3>Congratulations 😊</h3><p>You have now learnt how to setup kafka without zookeeper</p><h3>Understanding KRaft and its Benefits</h3><p><a href="https://jainsaket-1994.medium.com/migrating-from-zookeeper-to-kraft-mode-in-apache-kafka-understanding-kraft-and-its-benefits-dd01d3dff00a">Migrating from Zookeeper to Kraft Mode in Apache Kafka: Understanding KRaft and its Benefits</a></p><h3>References</h3><p><a href="https://kafka.apache.org/">https://kafka.apache.org/</a></p><p><a href="https://cwiki.apache.org/confluence/display/KAFKA/KIP-500%3A+Replace+ZooKeeper+with+a+Self-Managed+Metadata+Quorum">https://cwiki.apache.org/confluence/display/KAFKA/KIP-500</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=561f281b8e2a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kong to Kong Data Migration & Kong Consumer Credential Migration]]></title>
            <link>https://jainsaket-1994.medium.com/kong-to-kong-data-migration-kong-consumer-credential-migration-6be5cf7ca4e1?source=rss-1a8ba5e78f2b------2</link>
            <guid isPermaLink="false">https://medium.com/p/6be5cf7ca4e1</guid>
            <category><![CDATA[konga]]></category>
            <category><![CDATA[kong]]></category>
            <category><![CDATA[api-gateway]]></category>
            <category><![CDATA[migration]]></category>
            <dc:creator><![CDATA[ ]]></dc:creator>
            <pubDate>Mon, 15 Apr 2024 11:12:07 GMT</pubDate>
            <atom:updated>2024-04-15T11:12:07.823Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mp0s5QsO3AdRik1G.png" /></figure><p>To setup a new kong and migrate data from old kong to new kong.</p><ol><li>Setup new kong .</li><li>Take Snapshot from konga from old kong</li><li>import the konga snapshot to new kong for routes, service, consumer, plugins, upstreams and targets etc.,</li></ol><p><strong>Issue :</strong></p><p>Since Consumer Password is encrypted by sha1 algorithm by customer id as salt, the konga snapshot will not be migrated properly the credentials of the consumer.</p><p>So in order to properly migrate the consumer, kindly follow the steps:</p><ol><li>Even though consumer password will be different between two kongs, the consumer id and username will be same in both.</li><li>We need to login to cassandra db console using cqlsh on old kong’s cassandra and get the encoded password and consumer id of all username from the basic_auth_credentails table in kong database.</li><li>Now we need to get the id of all rows of the respective username in new kong cassandra db, as the update query only works with primary key which is id column, not consumer_id or any other columns</li><li>Once we get the password of all username from basic_auth_credentails table along with username and consumer_id and id of new kong cassandra db of the all username, we form a query to update new password with id on where condition which is respective to the corresponding consumer_id and username.</li><li>Once we formed all the queries, then we need to execute all the queries.</li></ol><p><strong>Queries :</strong></p><p><strong>To get the details from old Kong db.</strong></p><pre>select consumer_id, username, password from basicauth_credentials</pre><p><strong>To get the id of all corresponding usernames on the new Kong db.</strong></p><pre>select id from basicauth_credentials where consumer_id=’consumer_ids’ and username=’usernames’</pre><p><strong>To update the correct credentials in the new Kong Cassandra DB.</strong></p><pre>update basicauth_credentials set password=’fetched-password-respective of consumer’ where id=’id’</pre><p><strong>Rest api’s for creating and updating consumers</strong></p><p><strong>for create consumer :</strong><br> — — — — — — — — — — — — — — — — — — -</p><pre><br>curl -i -X POST — url http://{kong_ip}:{kong_port}/consumers — data “username={consumer-name}” — data “custom_id={some_id}”</pre><p><strong>for update consumer:</strong><br> — — — — — — — — — — — — — — — — — — -</p><pre><br>curl -i -X POST — url http://{kong_ip}:{kong_port}/consumers/{consumer_name or consumer_id} — data “username={new consumer_name}” — data “custom_id={custom_id}”</pre><p><strong>for delete consumer :</strong><br> — — — — — — — — — — — — — — — — — — -</p><pre><br>curl -i -X DELETE — url http://{kong_ip}:{kong_port}/consumers/{consumer-name}</pre><p><strong>for create basic-auth for consumer:</strong><br> — — — — — — — — — — — — — — — — — — -</p><pre><br>curl -i -X POST — url http://{kong_ip}:{kong_port}/consumers/{consumer_name or consumer_id}/basic-auth/ — data “username={username}” — data “password={password}”</pre><p><strong>for update basic-auth for consumer:</strong><br> — — — — — — — — — — — — — — — — — — -</p><pre><br>curl http://{kong_ip}:{kong_port}/consumers/{consumer-name}/basic-auth/ = get the plugin id<br>curl -i -X PUT — url http://{kong_ip}:{kong_port}/consumers/{consumer-name}/basic-auth/{plugin_id} — data “username={new username}” — data “password={new password}”</pre><p><strong>for delete basic-auth for consumer: </strong><br> — — — — — — — — — — — — — — — — — — -</p><pre><br>curl http://{kong_ip}:{kong_port}/consumers/{consumer-name}/basic-auth/ = get the plugin id<br>curl -i -X DELETE — url http://{kong_ip}:{kong_port}/consumers/{consumer-name}/basic-auth/{plugin_id}</pre><p><strong>CREATE RATE LIMITING</strong><br> — — — — — — — — — — — —</p><pre><br>curl -X POST http://{kong_ip}:{kong_port}/consumers/${consumer_name}/plugins/ \<br> — data “name=rate-limiting” \<br> — data “config.second={requst count limit per second}” \<br> — data “config.minute={requst count limit per minute}” \<br> — data “config.hour={requst count limit per hour}” \<br> — data “config.day={requst count limit per day}” \<br> — data “config.month={requst count limit per month}” \<br> — data “config.year={requst count limit per year}” \<br> — data “config.policy=cluster” \<br> — data “config.hide_client_headers=false”</pre><p><strong>GET RATE LIMITING DETAILS (plugin id)</strong><br> — — — — — — — — — — — — — — — — — — — -</p><pre><br>CURL http://{kong_ip}:{kong_port}/consumers/{consumer_name}/plugins = here we need to iterate the dictionary object to get ratelimit plugin and fetch plugin id</pre><p><strong>DELETE RATE LIMITING for consumer</strong><br> — — — — — — — — — — — — — — — — — — — -</p><pre><br>curl -X DELETE http://{kong_ip}:{kong_port}/consumers/{consumer_name}/plugins/{plugin_id}</pre><p><strong>UPDATE RATE LIMITING for consumer</strong><br> — — — — — — — — — — — — — — — — — — — — —</p><pre><br>curl -X PATCH http://{kong_ip}:{kong_port}/consumers/{consumer_name}/plugins/{plugin_id} \<br> — data “name=rate-limiting” \<br> — data “config.second=5” \<br> — data “config.minute=10” \<br> — data “config.hour=10” \<br> — data “config.day=100” \<br> — data “config.month=1000” \<br> — data “config.year=10000” \<br> — data “config.policy=cluster” \<br> — data “config.hide_client_headers=false”</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6be5cf7ca4e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Migrating from Zookeeper to Kraft Mode in Apache Kafka: Understanding KRaft and its Benefits]]></title>
            <link>https://jainsaket-1994.medium.com/migrating-from-zookeeper-to-kraft-mode-in-apache-kafka-understanding-kraft-and-its-benefits-dd01d3dff00a?source=rss-1a8ba5e78f2b------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd01d3dff00a</guid>
            <category><![CDATA[kafka-kraft]]></category>
            <category><![CDATA[kraft]]></category>
            <category><![CDATA[zookeeper]]></category>
            <category><![CDATA[kafka]]></category>
            <dc:creator><![CDATA[ ]]></dc:creator>
            <pubDate>Thu, 04 Apr 2024 11:29:53 GMT</pubDate>
            <atom:updated>2024-04-04T11:29:53.063Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TB4m7ZfPMgHF_ljN" /></figure><h3>What is Kafka?</h3><p>Apache Kafka is a high-throughput, distributed streaming platform for handling real-time data pipelines. It ingests, stores, and processes streams of messages, enabling various applications like data analytics, log aggregation, and microservices communication.</p><h3>What was Zookeeper’s Role in Kafka?</h3><p>Traditionally, Kafka relied on Zookeeper for crucial metadata management tasks like:</p><ul><li><strong>Leader election:</strong> Selecting the leader broker in a multi-broker cluster.</li><li><strong>Topic configuration:</strong> Storing information about topics, partitions, and replicas.</li><li><strong>Consumer offsets:</strong> Tracking the message position consumers have already processed.</li></ul><p>While Zookeeper served these purposes well initially, it presented some limitations:</p><ul><li><strong>Single point of failure:</strong> If Zookeeper goes down, the entire Kafka cluster becomes unavailable.</li><li><strong>Scalability constraints:</strong> Zookeeper struggles to manage large deployments efficiently.</li><li><strong>Increased complexity:</strong> Maintaining and operating Zookeeper adds another layer of overhead.</li></ul><h3>Introducing KRaft: Enhanced Metadata Management for Kafka</h3><p>KRaft, also known as Kafka Raft Metadata mode, was introduced as a replacement for Zookeeper, addressing its limitations and improving Kafka’s overall architecture. KRaft leverages the Raft consensus algorithm, a distributed protocol ensuring:</p><ul><li><strong>High availability:</strong> No single point of failure, as the cluster can function even if some nodes are unavailable.</li><li><strong>Enhanced scalability:</strong> KRaft scales better with larger deployments compared to Zookeeper.</li><li><strong>Simplified architecture:</strong> KRaft eliminates the need for a separate Zookeeper service, streamlining the Kafka ecosystem.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5mYWsfkCugTM-wCQ.png" /></figure><h3>Components of Kafka with KRaft And its Architecture and Workflow: Orchestrating Metadata Management</h3><p>With KRaft mode, Kafka adopts a refined architecture for managing metadata, replacing Zookeeper with a more resilient and scalable approach. Here’s a breakdown of the key components and their interactions, accompanied by helpful reference images:</p><p><strong>1. Kafka Brokers:</strong></p><ul><li>The workhorses of the cluster, are responsible for receiving, storing, and forwarding messages.</li><li>Each broker maintains a replica of the topic partitions it hosts.</li><li>Brokers communicate with controllers and each other for data exchange and cluster coordination.</li></ul><p><strong>2. Controller Ensemble:</strong></p><ul><li>A group of specialized Kafka servers forming the core of KRaft mode.</li><li>They collectively manage metadata like topics, partitions, replicas, and consumer offsets.</li><li>The ensemble operates using the Raft consensus algorithm to ensure consistency and high availability.</li></ul><p><strong>3. Raft Algorithm:</strong></p><ul><li>The distributed consensus protocol powering KRaft, guaranteeing agreement on the current state of the metadata across controllers.</li><li>Involves leader election, vote exchange, and replication mechanisms for consistency and fault tolerance</li></ul><p><strong>4. Leader Controller:</strong></p><ul><li>One member of the ensemble elected through the Raft algorithm to process metadata updates and replicate them to other controllers.</li><li>Acts as the central point for handling metadata changes and coordinates with brokers.</li></ul><p><strong>5. Follower Controllers:</strong></p><ul><li>Members of the ensemble that keep their local metadata state synchronized with the leader.</li><li>Ready to take over as leader if the current leader fails, ensuring high availability.</li></ul><p><strong>6. Event-Sourced Metadata:</strong></p><ul><li>KRaft stores metadata as a sequence of events, allowing for transparent tracking of changes and simplified debugging.</li><li>Enables efficient state reconstruction if needed.</li></ul><p><strong>7. Kafka Clients (Producers and Consumers):</strong></p><ul><li>Applications interacting with Kafka to produce or consume messages.</li><li>Connect to brokers to send/receive messages and interact with metadata as needed.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9KffIWFw_pB_Lwlh" /></figure><p><strong>Additional Notes:</strong></p><ul><li>This diagram showcases the core components; a production environment might have additional tools for monitoring, security, and management.</li><li>The specific number of controller nodes in the ensemble depends on your desired level of fault tolerance and scalability.</li><li><strong>Quorum Controllers:</strong> These specialized Kafka services form the heart of KRaft, responsible for replicating and storing metadata across the cluster.</li><li><strong>Raft Algorithm:</strong> This distributed consensus protocol guarantees consistency and agreement among controllers on the current state of the metadata.</li><li><strong>Event-Sourcing:</strong> KRaft stores metadata as a sequence of events, allowing for efficient state reconstruction and easier debugging.</li><li><strong>Leadership and Replication:</strong> One controller acts as the leader, receiving metadata updates and replicating them to followers. Each controller maintains a complete copy of the metadata for redundancy.</li></ul><h3>Workflow of Topic Creation in Kraft</h3><p><strong>Imagine a new topic creation request:</strong></p><ol><li>The request arrives at a Kafka broker.</li><li>The broker forwards it to the leader controller.</li><li>The leader validates the request and proposes it to other controllers.</li><li>Controllers reach consensus using the Raft algorithm, ensuring consistency.</li><li>Upon agreement, the leader applies the change to its local state and replicates it to followers.</li><li>After successful replication, the leader informs the broker about the successful topic creation.</li></ol><h3>Workflow of Controller Leader Election in Kraft</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7BO-H3IvWe53pGAw.jpeg" /></figure><p>The leader election process in KRaft, powering Kafka’s metadata management, plays a crucial role in ensuring the cluster’s smooth operation and fault tolerance. Here’s a breakdown of this intriguing workflow:</p><p><strong>Triggering a Leader Election:</strong></p><ul><li>A leader election can be initiated in several scenarios:</li><li><strong>Startup:</strong> When Kafka brokers start, they initiate an election to determine the initial leader.</li><li><strong>Leader failure:</strong> If the current leader becomes unavailable, a new election is triggered to choose a successor.</li><li><strong>Partition rebalance:</strong> During the rebalancing of partitions to maintain consistency, a leader election might occur for specific partitions.</li></ul><p><strong>Raft Algorithm in Action:</strong></p><ol><li><strong>Nominating a Candidate:</strong> Each controller nominates itself or another eligible controller as the leader based on pre-defined rules like the current leader’s term and voting weight.</li><li><strong>Vote Exchange:</strong> Controllers exchange votes for their nominated candidates. A candidate needs a majority (quorum) of votes to become the leader.</li><li><strong>Term Advancement:</strong> If no candidate receives a majority in the current term, the term is incremented, and controllers repeat the nomination and vote exchange process.</li><li><strong>Leadership Established:</strong> Once a candidate secures a majority of votes in a given term, it becomes the new leader. Other controllers transition to follower roles, replicating data from the leader and remaining ready to participate in future elections.</li></ol><p><strong>Additional Considerations:</strong></p><ul><li><strong>Preventing Split Brain:</strong> The quorum requirement ensures consistency and avoids electing multiple leaders simultaneously.</li><li><strong>Leader Responsibilities:</strong> The leader processes metadata updates, replicates them to followers, and coordinates with brokers to maintain cluster state.</li><li><strong>Follower Responsibilities:</strong> Followers keep their local state synchronized with the leader and are prepared to take over as leader if necessary.</li><li><strong>Election Timeouts:</strong> Timeouts are used to bound the election process and prevent indefinite waiting in case of network issues or other delays.</li></ul><p><strong>Benefits of KRaft Leader Election:</strong></p><ul><li><strong>High Availability:</strong> Ensures a new leader is quickly elected after failures, minimizing downtime and maintaining cluster function.</li><li><strong>Fault Tolerance:</strong> Distributes leadership across controllers, eliminating single points of failure.</li><li><strong>Scalability:</strong> The election process adapts to changes in the cluster size and controller availability.</li></ul><h3>Why Migrate from Zookeeper to KRaft?</h3><p>Migrating your Kafka cluster from Zookeeper to KRaft offers several benefits:</p><ul><li><strong>Improved Availability:</strong> Eliminate the single point of failure risk associated with Zookeeper, ensuring higher uptime and resilience.</li><li><strong>Enhanced Scalability:</strong> Easily scale your Kafka cluster to handle growing data volumes and message throughput without performance bottlenecks.</li><li><strong>Simplified Operations:</strong> Reduce operational complexity by removing the need to manage and maintain Zookeeper alongside Kafka.</li><li><strong>Streamlined Architecture:</strong> Enjoy a more unified and cleaner Kafka setup with all metadata management handled within the Kafka framework.</li></ul><h3>Conclusion</h3><p>While Zookeeper served its purpose in the early stages of Kafka’s development, KRaft represents a significant advancement in terms of availability, scalability, and operational efficiency. Migrating your Kafka cluster to KRaft mode is a recommended step for future-proofing your infrastructure and unlocking the full potential of this powerful streaming platform.</p><h3>References</h3><ol><li><a href="https://zookeeper.apache.org/doc/r3.5.4-beta/zookeeperOver.html">https://zookeeper.apache.org/doc/r3.5.4-beta/zookeeperOver.html</a></li><li><a href="https://www.educative.io/courses/scalable-data-pipelines-kafka">https://www.educative.io/courses/scalable-data-pipelines-kafka</a></li><li><a href="https://www.youtube.com/watch?v=t0FDmj4kaIg">https://www.youtube.com/watch?v=t0FDmj4kaIg</a></li><li><a href="https://cwiki.apache.org/confluence/display/KAFKA/KIP-500%3A+Replace+ZooKeeper+with+a+Self-Managed+Metadata+Quorum">https://cwiki.apache.org/confluence/display/KAFKA/KIP-500%3A+Replace+ZooKeeper+with+a+Self-Managed+Metadata+Quorum</a></li><li><a href="https://cwiki.apache.org/confluence/display/KAFKA/KIP-833%3A+Mark+KRaft+as+Production+Ready">https://cwiki.apache.org/confluence/display/KAFKA/KIP-833%3A+Mark+KRaft+as+Production+Ready</a></li><li><a href="https://www.confluent.io/events/current-2022/introducing-kraft-kafka-without-zookeeper/">https://www.confluent.io/events/current-2022/introducing-kraft-kafka-without-zookeeper/</a></li><li><a href="https://developer.confluent.io/learn/kraft/">https://developer.confluent.io/learn/kraft/</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd01d3dff00a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Kong: An Open-Source API Gateway]]></title>
            <link>https://jainsaket-1994.medium.com/understanding-kong-an-open-source-api-gateway-a494fd7ed592?source=rss-1a8ba5e78f2b------2</link>
            <guid isPermaLink="false">https://medium.com/p/a494fd7ed592</guid>
            <category><![CDATA[api-gateway]]></category>
            <category><![CDATA[kong]]></category>
            <category><![CDATA[konga]]></category>
            <dc:creator><![CDATA[ ]]></dc:creator>
            <pubDate>Wed, 03 Apr 2024 08:46:49 GMT</pubDate>
            <atom:updated>2024-04-03T08:46:49.160Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/962/0*ki5gjJJKd6dDFsRP.jpg" /></figure><h3>Introduction:</h3><p>Kong is a powerful open-source API gateway designed to streamline and secure API management. It acts as a mediator between clients and backend services, offering a range of functionalities including traffic routing, rate limiting, authentication, and more.</p><p>Components of Kong:</p><ul><li>Routes</li><li>Services</li><li>Upstreams</li><li>Targets</li><li>Consumers</li><li>Plugins</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1xPZcHesoRFJ3oGjDINy7g.png" /></figure><h3>Working of Kong:</h3><p>When a client initiates an API request, Kong manages the routing process as follows:</p><ul><li>The request is directed to a specified path configured in Kong’s route instead of directly hitting the microservices.</li><li><strong>Route</strong>: Defines the exposed path for clients and maps it to backend services.</li><li><strong>Service</strong>: Specifies the actual path of the backend microservice API.</li><li><strong>Upstream</strong>: Contains backend microservices’ machine details, health checks, and load balancing configurations.</li><li><strong>Targets</strong>: Individual microservice IP and port added to upstreams for load balancing.</li><li><strong>Consumers</strong>: Users or applications consuming the APIs.</li><li><strong>Plugins</strong>: Adds additional features to Kong’s workflow.</li></ul><h4>Our Current Architecture of Kong:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QCbw2unOdqjFecnwF1W5Vw.png" /></figure><ul><li>When a customer hits the API of openapi.example.in, the request is forwarded to Accamai GTM, then to F5 Load Balancer.</li><li>F5 Load Balancer utilizes path-based routing to divert traffic to the respective Kong clusters based on the API path.</li></ul><h4>Paths Mentioned in irule in my setup:</h4><p>A list of paths configured in F5’s irule for as per the Team’s.</p><h4>Kong Admin API:</h4><p>Kong provides an admin API exposed on port 8001, allowing users to monitor Kong, create routes, services, and modify Kong cluster components.</p><h4>Konga:</h4><p>Konga is a third-party tool that offers a user-friendly interface to interact with Kong, facilitating the creation of routes and other Kong components.</p><h4>Conclusion:</h4><p>Kong plays a vital role in managing and securing APIs, providing a robust infrastructure for routing and controlling API traffic. With its flexible architecture and rich feature set, Kong is a preferred choice for modern API management.</p><h4>Next Steps:</h4><ul><li>Explore Kong documentation for in-depth configuration options.</li><li>Experiment with Kong Admin API and Konga for managing Kong instances effectively.</li></ul><h4>References:</h4><ul><li><a href="https://docs.konghq.com/">Kong Documentation</a></li><li><a href="https://github.com/pantsel/konga">Konga GitHub Repository</a></li></ul><p>Feel free to reach out for any further assistance or queries.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a494fd7ed592" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Homer Installation Steps]]></title>
            <link>https://jainsaket-1994.medium.com/homer-installation-steps-a3d0266424ba?source=rss-1a8ba5e78f2b------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3d0266424ba</guid>
            <category><![CDATA[voip]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[homer]]></category>
            <dc:creator><![CDATA[ ]]></dc:creator>
            <pubDate>Wed, 03 Apr 2024 08:43:17 GMT</pubDate>
            <atom:updated>2024-04-03T08:43:17.690Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iUzOtQGOr5e51syX.jpg" /></figure><h3>Introduction</h3><p>The purpose of this guide is to provide step-by-step instructions for installing Homer, including setting up Docker, Heplify Server, Portainer, and the Homer app. Homer is a VoIP monitoring and troubleshooting tool that offers various features for analyzing SIP and RTP traffic.</p><ol><li>Install Docker</li><li>Install Heplify Server</li><li>Install Portainer</li><li>Install Homer App</li><li>Conclusion</li><li>Install Docker:</li></ol><pre>vi /etc/yum.repos.d/docker-ce.repo</pre><p>Add the following content:</p><pre>[docker-ce-stable]<br>name=Docker CE Stable - $basearch<br>baseurl=https://download.docker.com/linux/centos/$releasever/$basearch/stable<br>enabled=1<br>gpgcheck=1<br>gpgkey=https://download.docker.com/linux/centos/gpg</pre><p>Then, install Docker:</p><pre>yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin</pre><p>Start Docker:</p><pre>systemctl start docker</pre><p>Download and install Docker Compose:</p><pre>curl -L &quot;https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)&quot; -o /usr/local/bin/docker-compose<br>chmod +x /usr/local/bin/docker-compose<br>docker-compose --version</pre><p>Reload and restart the Docker service:</p><pre>systemctl daemon-reload<br>systemctl restart docker</pre><p>2. Install Heplify Server:</p><p>Create a directory for Docker containers:</p><pre>mkdir -p /data/dockers</pre><p>Create a Docker Compose file for Heplify Server:</p><pre>vi /data/dockers/docker-compose.yml</pre><p>Add the following content:</p><pre>version: &#39;2.1&#39;<br>services:<br>  AWS-HS-Promo-Cluster-1:<br>    image: sipcapture/heplify-server:latest<br>    container_name: AWS-HS-Promo-Cluster-1<br>    ports:<br>      - &quot;10041:10041&quot;<br>      - &quot;10041:10041/udp&quot;<br>      - &quot;10091:10091&quot;<br>    command:<br>      - &#39;./heplify-server&#39;<br>    environment:<br>      - &quot;HEPLIFYSERVER_HEPADDR=0.0.0.0:9041&quot;<br>      - &quot;HEPLIFYSERVER_HEPTLSADDR=0.0.0.0:9041&quot;<br>      - &quot;HEPLIFYSERVER_HEPTCPADDR=&quot;<br>      - &quot;HEPLIFYSERVER_LOGLVL=info&quot;<br>      - &quot;HEPLIFYSERVER_LOGSTD=true&quot;<br>      - &quot;HEPLIFYSERVER_PROMADDR=0.0.0.0:9091&quot;<br>      - &quot;HEPLIFYSERVER_DEDUP=false&quot;<br>      - &quot;HEPLIFYSERVER_DBPARTLOG=1h&quot;<br>      - &quot;HEPLIFYSERVER_DBPARTSIP=1h&quot;<br>      - &quot;HEPLIFYSERVER_DBPARTQOS=1h&quot;<br>      - &quot;HEPLIFYSERVER_LOKITIMER=2&quot;<br>      - &quot;HEPLIFYSERVER_DBMAXSIZE=50GB&quot;<br>    restart: unless-stopped<br>    expose:<br>      - 9090<br>    labels:<br>      org.label-schema.group: &quot;FixedLandlineKamailioProdBanglore Monitoring&quot;</pre><p>Then, start the Heplify Server:</p><pre>docker-compose -f /data/dockers/docker-compose.yml up -d<br>docker ps</pre><p>3. Install Portainer:</p><pre>docker run -d -p 8080:8080 -p 9000:9000 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:2.11.1</pre><p>4. Install Homer app:</p><pre>vi /etc/yum.repos.d/qxip_sipcapture.repo</pre><p>Add the following content:</p><pre>[qxip_sipcapture]<br>name=qxip_sipcapture<br>baseurl=https://packagecloud.io/qxip/sipcapture/el/7/$basearch<br>repo_gpgcheck=1<br>gpgcheck=0<br>enabled=1<br>gpgkey=https://packagecloud.io/qxip/sipcapture/gpgkey<br>sslverify=1<br>sslcacert=/etc/pki/tls/certs/ca-bundle.crt<br>metadata_expire=300</pre><pre>[qxip_sipcapture-source]<br>name=qxip_sipcapture-source<br>baseurl=https://packagecloud.io/qxip/sipcapture/el/7/SRPMS<br>repo_gpgcheck=1<br>gpgcheck=0<br>enabled=1<br>gpgkey=https://packagecloud.io/qxip/sipcapture/gpgkey<br>sslverify=1<br>sslcacert=/etc/pki/tls/certs/ca-bundle.crt<br>metadata_expire=300</pre><p>Then, install the Homer app:</p><pre>yum install homer-app</pre><p>Edit the Homer web app configuration file as needed:</p><pre>vi /usr/local/homer/etc/webapp_config.json</pre><p>Edit DB settings as needed</p><pre>systemctl start homer-app</pre><h3>Conclusion</h3><p>In conclusion, this guide has provided instructions for setting up Homer, a powerful VoIP monitoring tool, by installing Docker, Heplify Server, Portainer, and the Homer app. By following these steps, users can effectively monitor and troubleshoot their VoIP infrastructure.</p><p>This comprehensive guide should assist you in successfully setting up Homer for your VoIP monitoring needs. If you encounter any issues during the installation process, refer back to the corresponding sections or consult the documentation provided by the respective software packages.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3d0266424ba" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>